FpMLv53 (empty) → 0.1
raw patch · 60 files changed
+54306/−0 lines, 60 filesdep +HaXmldep +basesetup-changed
Dependencies added: HaXml, base
Files
- COPYRIGHT +59/−0
- Data/FpML/V53/Asset.hs +3193/−0
- Data/FpML/V53/Asset.hs-boot +626/−0
- Data/FpML/V53/CD.hs +2495/−0
- Data/FpML/V53/CD.hs-boot +341/−0
- Data/FpML/V53/Com.hs +5007/−0
- Data/FpML/V53/Com.hs-boot +1045/−0
- Data/FpML/V53/Doc.hs +2290/−0
- Data/FpML/V53/Doc.hs-boot +606/−0
- Data/FpML/V53/Enum.hs +3383/−0
- Data/FpML/V53/Enum.hs-boot +819/−0
- Data/FpML/V53/Eqd.hs +1168/−0
- Data/FpML/V53/Eqd.hs-boot +144/−0
- Data/FpML/V53/Events/Business.hs +1268/−0
- Data/FpML/V53/Events/Business.hs-boot +244/−0
- Data/FpML/V53/FX.hs +1650/−0
- Data/FpML/V53/FX.hs-boot +277/−0
- Data/FpML/V53/Generic.hs +266/−0
- Data/FpML/V53/Generic.hs-boot +52/−0
- Data/FpML/V53/IRD.hs +3117/−0
- Data/FpML/V53/IRD.hs-boot +564/−0
- Data/FpML/V53/Main.hs +156/−0
- Data/FpML/V53/Main.hs-boot +67/−0
- Data/FpML/V53/Mktenv.hs +1081/−0
- Data/FpML/V53/Mktenv.hs-boot +201/−0
- Data/FpML/V53/Msg.hs +1966/−0
- Data/FpML/V53/Msg.hs-boot +491/−0
- Data/FpML/V53/Notification/CreditEvent.hs +356/−0
- Data/FpML/V53/Notification/CreditEvent.hs-boot +120/−0
- Data/FpML/V53/Option/Bond.hs +327/−0
- Data/FpML/V53/Option/Bond.hs-boot +58/−0
- Data/FpML/V53/Processes/Recordkeeping.hs +343/−0
- Data/FpML/V53/Processes/Recordkeeping.hs-boot +41/−0
- Data/FpML/V53/Reporting/Valuation.hs +508/−0
- Data/FpML/V53/Reporting/Valuation.hs-boot +93/−0
- Data/FpML/V53/Riskdef.hs +1045/−0
- Data/FpML/V53/Riskdef.hs-boot +287/−0
- Data/FpML/V53/Shared.hs +7912/−0
- Data/FpML/V53/Shared.hs-boot +2163/−0
- Data/FpML/V53/Shared/EQ.hs +2483/−0
- Data/FpML/V53/Shared/EQ.hs-boot +477/−0
- Data/FpML/V53/Shared/Option.hs +1259/−0
- Data/FpML/V53/Shared/Option.hs-boot +269/−0
- Data/FpML/V53/Standard.hs +84/−0
- Data/FpML/V53/Standard.hs-boot +28/−0
- Data/FpML/V53/Swaps/Correlation.hs +252/−0
- Data/FpML/V53/Swaps/Correlation.hs-boot +41/−0
- Data/FpML/V53/Swaps/Dividend.hs +381/−0
- Data/FpML/V53/Swaps/Dividend.hs-boot +57/−0
- Data/FpML/V53/Swaps/Return.hs +185/−0
- Data/FpML/V53/Swaps/Return.hs-boot +24/−0
- Data/FpML/V53/Swaps/Variance.hs +494/−0
- Data/FpML/V53/Swaps/Variance.hs-boot +65/−0
- Data/FpML/V53/Valuation.hs +684/−0
- Data/FpML/V53/Valuation.hs-boot +151/−0
- Data/Xmldsig/Core/Schema.hs +754/−0
- Data/Xmldsig/Core/Schema.hs-boot +216/−0
- FpMLv53.cabal +64/−0
- LICENCE-LGPL +507/−0
- Setup.hs +2/−0
+ COPYRIGHT view
@@ -0,0 +1,59 @@+The FpMLv53 package is automatically generated from the FpML specifications+(XSD files) version 5.3-lcwd (Last Call Working Draft).++(In as much as auto-generated code can be copyrighted:)+This FpMLv53 package for Haskell is+ (c) copyright 2012 Malcolm Wallace+The processing software which generated it (FpMLToHaskell) is available+under the same copyright, as part of the HaXml package (v 1.23.3 or later).++The FpML specifications themselves have a rather free/liberal license,+allowing world-wide, royalty-free, non-exclusive use of the specifications,+with or without modifications, as part of a Larger Work (including but+not limited to computer software that combines the specifications, or+portions thereof, with material not governed by the FpML Public License).+For more details, see http://www.fpml.org/license/license.html++----++The owners of the FpML specification require me to bring to your attention+the following additional notices:++ * The FpML Specifications of this document are subject to the FpML+ Public License (the "License"); you may not use the FpML Specifications+ except in compliance with the License. You may obtain a copy of the+ License at http://www.FpML.org.++ * The FpML Specifications distributed under the License are distributed+ on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or+ implied. See the License for the specific language governing rights and+ limitations under the License.++ * The Licensor of the FpML Specifications is the International Swaps+ and Derivatives Association, Inc. All Rights Reserved.+++----++The Haskell modules in the present package are licensed under the terms+of the GNU Lesser General Public Licence (LGPL), which can be found in+the file called LICENCE-LGPL, with the following special exception:++----+As a relaxation of clause 6 of the LGPL, the copyright holders of this+library give permission to use, copy, link, modify, and distribute,+binary-only object-code versions of an executable linked with the+original unmodified Library, without requiring the supply of any+mechanism to modify or replace the Library and relink (clauses 6a,+6b, 6c, 6d, 6e), provided that all the other terms of clause 6 are+complied with.+----++This library is distributed in the hope that it will be useful, but+WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU+Licence for more details.++If these code licensing terms are not acceptable to you, please contact+me for negotiation. :-)+ Malcolm.Wallace@me.com
+ Data/FpML/V53/Asset.hs view
@@ -0,0 +1,3193 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Asset+ ( module Data.FpML.V53.Asset+ , 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+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +data ActualPrice = ActualPrice+ { actualPrice_currency :: Maybe Currency+ -- ^ Specifies the currency associated with the net price. This + -- element is not present if the price is expressed in + -- percentage terms (as specified through the priceExpression + -- element).+ , actualPrice_amount :: Maybe Xsd.Decimal+ -- ^ Specifies the net price amount. In the case of a fixed + -- income security or a convertible bond, this price includes + -- the accrued interests.+ , actualPrice_priceExpression :: Maybe PriceExpressionEnum+ -- ^ Specifies whether the price is expressed in absolute or + -- relative terms.+ }+ deriving (Eq,Show)+instance SchemaType ActualPrice where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ActualPrice+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "amount")+ `apply` optional (parseSchemaType "priceExpression")+ schemaTypeToXML s x@ActualPrice{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "currency") $ actualPrice_currency x+ , maybe [] (schemaTypeToXML "amount") $ actualPrice_amount x+ , maybe [] (schemaTypeToXML "priceExpression") $ actualPrice_priceExpression x+ ]+ +-- | A reference to an asset, e.g. a portfolio, trade, or +-- reference instrument..+data AnyAssetReference = AnyAssetReference+ { anyAssetRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType AnyAssetReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (AnyAssetReference a0)+ schemaTypeToXML s x@AnyAssetReference{} =+ toXMLElement s [ toXMLAttribute "href" $ anyAssetRef_href x+ ]+ []+instance Extension AnyAssetReference Reference where+ supertype v = Reference_AnyAssetReference v+ +-- | Abstract base class for all underlying assets.+data Asset+ = Asset_IdentifiedAsset IdentifiedAsset+ | Asset_Cash Cash+ | Asset_Basket Basket+ + deriving (Eq,Show)+instance SchemaType Asset where+ parseSchemaType s = do+ (fmap Asset_IdentifiedAsset $ parseSchemaType s)+ `onFail`+ (fmap Asset_Cash $ parseSchemaType s)+ `onFail`+ (fmap Asset_Basket $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of Asset,\n\+\ namely one of:\n\+\IdentifiedAsset,Cash,Basket"+ schemaTypeToXML _s (Asset_IdentifiedAsset x) = schemaTypeToXML "identifiedAsset" x+ schemaTypeToXML _s (Asset_Cash x) = schemaTypeToXML "cash" x+ schemaTypeToXML _s (Asset_Basket x) = schemaTypeToXML "basket" x+ +-- | A scheme identifying the types of measures that can be used +-- to describe an asset.+data AssetMeasureType = AssetMeasureType Scheme AssetMeasureTypeAttributes deriving (Eq,Show)+data AssetMeasureTypeAttributes = AssetMeasureTypeAttributes+ { assetMeasureTypeAttrib_assetMeasureScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType AssetMeasureType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "assetMeasureScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ AssetMeasureType v (AssetMeasureTypeAttributes a0)+ schemaTypeToXML s (AssetMeasureType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "assetMeasureScheme") $ assetMeasureTypeAttrib_assetMeasureScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension AssetMeasureType Scheme where+ supertype (AssetMeasureType s _) = s+ +-- | A scheme identifying the types of pricing model used to +-- evaluate the price of an asset. Examples include Intrinsic, +-- ClosedForm, MonteCarlo, BackwardInduction.+data PricingModel = PricingModel Scheme PricingModelAttributes deriving (Eq,Show)+data PricingModelAttributes = PricingModelAttributes+ { pricingModelAttrib_pricingModelScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType PricingModel where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "pricingModelScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ PricingModel v (PricingModelAttributes a0)+ schemaTypeToXML s (PricingModel bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "pricingModelScheme") $ pricingModelAttrib_pricingModelScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension PricingModel Scheme where+ supertype (PricingModel s _) = s+ +-- | Characterise the asset pool behind an asset backed bond.+data AssetPool = AssetPool+ { assetPool_version :: Maybe Xsd.NonNegativeInteger+ -- ^ The version number+ , assetPool_effectiveDate :: Maybe IdentifiedDate+ -- ^ Optionally it is possible to specify a version effective + -- date when a versionId is supplied.+ , assetPool_initialFactor :: Maybe Xsd.Decimal+ -- ^ The part of the mortgage that is outstanding on trade + -- inception, i.e. has not been repaid yet as principal. It is + -- expressed as a multiplier factor to the morgage: 1 means + -- that the whole mortage amount is outstanding, 0.8 means + -- that 20% has been repaid.+ , assetPool_currentFactor :: Maybe Xsd.Decimal+ -- ^ The part of the mortgage that is currently outstanding. It + -- is expressed similarly to the initial factor, as factor + -- multiplier to the mortgage. This term is formally defined + -- as part of the "ISDA Standard Terms Supplement for use with + -- credit derivatives transactions on mortgage-backed security + -- with pas-as-you-go or physical settlement".+ }+ deriving (Eq,Show)+instance SchemaType AssetPool where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return AssetPool+ `apply` optional (parseSchemaType "version")+ `apply` optional (parseSchemaType "effectiveDate")+ `apply` optional (parseSchemaType "initialFactor")+ `apply` optional (parseSchemaType "currentFactor")+ schemaTypeToXML s x@AssetPool{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "version") $ assetPool_version x+ , maybe [] (schemaTypeToXML "effectiveDate") $ assetPool_effectiveDate x+ , maybe [] (schemaTypeToXML "initialFactor") $ assetPool_initialFactor x+ , maybe [] (schemaTypeToXML "currentFactor") $ assetPool_currentFactor x+ ]+ +-- | Reference to an underlying asset.+data AssetReference = AssetReference+ { assetRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType AssetReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (AssetReference a0)+ schemaTypeToXML s x@AssetReference{} =+ toXMLElement s [ toXMLAttribute "href" $ assetRef_href x+ ]+ []+instance Extension AssetReference Reference where+ supertype v = Reference_AssetReference v+ +-- | Some kind of numerical measure about an asset, eg. its NPV, +-- together with characteristics of that measure.+data BasicQuotation = BasicQuotation+ { basicQuot_ID :: Maybe Xsd.ID+ , basicQuot_value :: Maybe Xsd.Decimal+ -- ^ The value of the the quotation.+ , basicQuot_measureType :: Maybe AssetMeasureType+ -- ^ The type of the value that is measured. This could be an + -- NPV, a cash flow, a clean price, etc.+ , basicQuot_quoteUnits :: Maybe PriceQuoteUnits+ -- ^ The optional units that the measure is expressed in. If not + -- supplied, this is assumed to be a price/value in currency + -- units.+ , basicQuot_side :: Maybe QuotationSideEnum+ -- ^ The side (bid/mid/ask) of the measure.+ , basicQuot_currency :: Maybe Currency+ -- ^ The optional currency that the measure is expressed in. If + -- not supplied, this is defaulted from the reportingCurrency + -- in the valuationScenarioDefinition.+ , basicQuot_currencyType :: Maybe ReportingCurrencyType+ -- ^ The optional currency that the measure is expressed in. If + -- not supplied, this is defaulted from the reportingCurrency + -- in the valuationScenarioDefinition.+ , basicQuot_timing :: Maybe QuoteTiming+ -- ^ When during a day the quote is for. Typically, if this + -- element is supplied, the QuoteLocation needs also to be + -- supplied.+ , basicQuot_choice7 :: (Maybe (OneOf2 BusinessCenter ExchangeId))+ -- ^ Choice between:+ -- + -- (1) A city or other business center.+ -- + -- (2) The exchange (e.g. stock or futures exchange) from + -- which the quote is obtained.+ , basicQuot_informationSource :: [InformationSource]+ -- ^ The information source where a published or displayed + -- market rate will be obtained, e.g. Telerate Page 3750.+ , basicQuot_pricingModel :: Maybe PricingModel+ -- ^ .+ , basicQuot_time :: Maybe Xsd.DateTime+ -- ^ When the quote was observed or derived.+ , basicQuot_valuationDate :: Maybe Xsd.Date+ -- ^ When the quote was computed.+ , basicQuot_expiryTime :: Maybe Xsd.DateTime+ -- ^ When does the quote cease to be valid.+ , basicQuot_cashflowType :: Maybe CashflowType+ -- ^ For cash flows, the type of the cash flows. Examples + -- include: Coupon payment, Premium Fee, Settlement Fee, + -- Brokerage Fee, etc.+ }+ deriving (Eq,Show)+instance SchemaType BasicQuotation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (BasicQuotation a0)+ `apply` optional (parseSchemaType "value")+ `apply` optional (parseSchemaType "measureType")+ `apply` optional (parseSchemaType "quoteUnits")+ `apply` optional (parseSchemaType "side")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "currencyType")+ `apply` optional (parseSchemaType "timing")+ `apply` optional (oneOf' [ ("BusinessCenter", fmap OneOf2 (parseSchemaType "businessCenter"))+ , ("ExchangeId", fmap TwoOf2 (parseSchemaType "exchangeId"))+ ])+ `apply` many (parseSchemaType "informationSource")+ `apply` optional (parseSchemaType "pricingModel")+ `apply` optional (parseSchemaType "time")+ `apply` optional (parseSchemaType "valuationDate")+ `apply` optional (parseSchemaType "expiryTime")+ `apply` optional (parseSchemaType "cashflowType")+ schemaTypeToXML s x@BasicQuotation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ basicQuot_ID x+ ]+ [ maybe [] (schemaTypeToXML "value") $ basicQuot_value x+ , maybe [] (schemaTypeToXML "measureType") $ basicQuot_measureType x+ , maybe [] (schemaTypeToXML "quoteUnits") $ basicQuot_quoteUnits x+ , maybe [] (schemaTypeToXML "side") $ basicQuot_side x+ , maybe [] (schemaTypeToXML "currency") $ basicQuot_currency x+ , maybe [] (schemaTypeToXML "currencyType") $ basicQuot_currencyType x+ , maybe [] (schemaTypeToXML "timing") $ basicQuot_timing x+ , maybe [] (foldOneOf2 (schemaTypeToXML "businessCenter")+ (schemaTypeToXML "exchangeId")+ ) $ basicQuot_choice7 x+ , concatMap (schemaTypeToXML "informationSource") $ basicQuot_informationSource x+ , maybe [] (schemaTypeToXML "pricingModel") $ basicQuot_pricingModel x+ , maybe [] (schemaTypeToXML "time") $ basicQuot_time x+ , maybe [] (schemaTypeToXML "valuationDate") $ basicQuot_valuationDate x+ , maybe [] (schemaTypeToXML "expiryTime") $ basicQuot_expiryTime x+ , maybe [] (schemaTypeToXML "cashflowType") $ basicQuot_cashflowType x+ ]+ +-- | A type describing the underlyer features of a basket swap. +-- Each of the basket constituents are described through an +-- embedded component, the basketConstituentsType.+data Basket = Basket+ { basket_ID :: Maybe Xsd.ID+ , basket_openUnits :: Maybe Xsd.Decimal+ -- ^ The number of units (index or securities) that constitute + -- the underlyer of the swap. In the case of a basket swap, + -- this element is used to reference both the number of basket + -- units, and the number of each asset components of the + -- basket when these are expressed in absolute terms.+ , basket_constituent :: [BasketConstituent]+ -- ^ Describes each of the components of the basket.+ , basket_divisor :: Maybe Xsd.Decimal+ -- ^ Specifies the basket divisor amount. This value is normally + -- used to adjust the constituent weight for pricing or to + -- adjust for dividends, or other corporate actions.+ , basket_choice3 :: (Maybe (OneOf1 ((Maybe (BasketName)),[BasketId])))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The name of the basket expressed as a free format + -- string. FpML does not define usage rules for this + -- element.+ -- + -- * A CDS basket identifier+ , basket_currency :: Maybe Currency+ -- ^ Specifies the currency for this basket.+ }+ deriving (Eq,Show)+instance SchemaType Basket where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Basket a0)+ `apply` optional (parseSchemaType "openUnits")+ `apply` many (parseSchemaType "basketConstituent")+ `apply` optional (parseSchemaType "basketDivisor")+ `apply` optional (oneOf' [ ("Maybe BasketName [BasketId]", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "basketName")+ `apply` many (parseSchemaType "basketId")))+ ])+ `apply` optional (parseSchemaType "basketCurrency")+ schemaTypeToXML s x@Basket{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ basket_ID x+ ]+ [ maybe [] (schemaTypeToXML "openUnits") $ basket_openUnits x+ , concatMap (schemaTypeToXML "basketConstituent") $ basket_constituent x+ , maybe [] (schemaTypeToXML "basketDivisor") $ basket_divisor x+ , maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "basketName") a+ , concatMap (schemaTypeToXML "basketId") b+ ])+ ) $ basket_choice3 x+ , maybe [] (schemaTypeToXML "basketCurrency") $ basket_currency x+ ]+instance Extension Basket Asset where+ supertype v = Asset_Basket v+ +-- | A type describing each of the constituents of a basket.+data BasketConstituent = BasketConstituent+ { basketConstit_ID :: Maybe Xsd.ID+ , basketConstit_underlyingAsset :: Maybe Asset+ -- ^ Define the underlying asset, either a listed security or + -- other instrument.+ , basketConstit_constituentWeight :: Maybe ConstituentWeight+ -- ^ Specifies the weight of each of the underlyer constituent + -- within the basket, either in absolute or relative terms. + -- This is an optional component, as certain swaps do not + -- specify a specific weight for each of their basket + -- constituents.+ , basketConstit_dividendPayout :: Maybe DividendPayout+ -- ^ Specifies the dividend payout ratio associated with an + -- equity underlyer. A basket swap can have different payout + -- ratios across the various underlying constituents. In + -- certain cases the actual ratio is not known on trade + -- inception, and only general conditions are then specified. + -- Users should note that FpML makes a distinction between the + -- derivative contract and the underlyer of the contract. It + -- would be better if the agreed dividend payout on a + -- derivative contract was modelled at the level of the + -- derivative contract, an approach which may be adopted in + -- the next major version of FpML.+ , basketConstit_underlyerPrice :: Maybe Price+ -- ^ Specifies the price that is associated with each of the + -- basket constituents. This component is optional, as it is + -- not absolutely required to accurately describe the + -- economics of the trade, considering the price that + -- characterizes the equity swap is associated to the leg of + -- the trade.+ , basketConstit_underlyerNotional :: Maybe Money+ -- ^ Specifies the notional (i.e. price * quantity) that is + -- associated with each of the basket constituents. This + -- component is optional, as it is not absolutely required to + -- accurately describe the economics of the trade, considering + -- the notional that characterizes the equity swap is + -- associated to the leg of the trade.+ , basketConstit_underlyerSpread :: Maybe SpreadScheduleReference+ -- ^ Provides a link to the spread schedule used for this + -- underlyer.+ , basketConstit_couponPayment :: Maybe PendingPayment+ -- ^ The next upcoming coupon payment.+ }+ deriving (Eq,Show)+instance SchemaType BasketConstituent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (BasketConstituent a0)+ `apply` optional (elementUnderlyingAsset)+ `apply` optional (parseSchemaType "constituentWeight")+ `apply` optional (parseSchemaType "dividendPayout")+ `apply` optional (parseSchemaType "underlyerPrice")+ `apply` optional (parseSchemaType "underlyerNotional")+ `apply` optional (parseSchemaType "underlyerSpread")+ `apply` optional (parseSchemaType "couponPayment")+ schemaTypeToXML s x@BasketConstituent{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ basketConstit_ID x+ ]+ [ maybe [] (elementToXMLUnderlyingAsset) $ basketConstit_underlyingAsset x+ , maybe [] (schemaTypeToXML "constituentWeight") $ basketConstit_constituentWeight x+ , maybe [] (schemaTypeToXML "dividendPayout") $ basketConstit_dividendPayout x+ , maybe [] (schemaTypeToXML "underlyerPrice") $ basketConstit_underlyerPrice x+ , maybe [] (schemaTypeToXML "underlyerNotional") $ basketConstit_underlyerNotional x+ , maybe [] (schemaTypeToXML "underlyerSpread") $ basketConstit_underlyerSpread x+ , maybe [] (schemaTypeToXML "couponPayment") $ basketConstit_couponPayment x+ ]+ +data BasketId = BasketId Scheme BasketIdAttributes deriving (Eq,Show)+data BasketIdAttributes = BasketIdAttributes+ { basketIdAttrib_basketIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType BasketId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "basketIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ BasketId v (BasketIdAttributes a0)+ schemaTypeToXML s (BasketId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "basketIdScheme") $ basketIdAttrib_basketIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension BasketId Scheme where+ supertype (BasketId s _) = s+ +data BasketName = BasketName Scheme BasketNameAttributes deriving (Eq,Show)+data BasketNameAttributes = BasketNameAttributes+ { basketNameAttrib_basketNameScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType BasketName where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "basketNameScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ BasketName v (BasketNameAttributes a0)+ schemaTypeToXML s (BasketName bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "basketNameScheme") $ basketNameAttrib_basketNameScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension BasketName Scheme where+ supertype (BasketName s _) = s+ +-- | An exchange traded bond.+data Bond = Bond+ { bond_ID :: Maybe Xsd.ID+ , bond_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , bond_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , bond_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , bond_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , bond_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , bond_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , bond_choice6 :: (Maybe (OneOf2 Xsd.XsdString PartyReference))+ -- ^ Specifies the issuer name of a fixed income security or + -- convertible bond. This name can either be explicitly + -- stated, or specified as an href into another element of the + -- document, such as the obligor.+ -- + -- Choice between:+ -- + -- (1) issuerName+ -- + -- (2) issuerPartyReference+ , bond_seniority :: Maybe CreditSeniority+ -- ^ The repayment precedence of a debt instrument.+ , bond_couponType :: Maybe CouponType+ -- ^ Specifies if the bond has a variable coupon, step-up/down + -- coupon or a zero-coupon.+ , bond_couponRate :: Maybe Xsd.Decimal+ -- ^ Specifies the coupon rate (expressed in percentage) of a + -- fixed income security or convertible bond.+ , bond_maturity :: Maybe Xsd.Date+ -- ^ The date when the principal amount of a security becomes + -- due and payable.+ , bond_parValue :: Maybe Xsd.Decimal+ -- ^ Specifies the nominal amount of a fixed income security or + -- convertible bond.+ , bond_faceAmount :: Maybe Xsd.Decimal+ -- ^ Specifies the total amount of the issue. Corresponds to the + -- par value multiplied by the number of issued security.+ , bond_paymentFrequency :: Maybe Period+ -- ^ Specifies the frequency at which the bond pays, e.g. 6M.+ , bond_dayCountFraction :: Maybe DayCountFraction+ -- ^ The day count basis for the bond.+ }+ deriving (Eq,Show)+instance SchemaType Bond where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Bond a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` optional (oneOf' [ ("Xsd.XsdString", fmap OneOf2 (parseSchemaType "issuerName"))+ , ("PartyReference", fmap TwoOf2 (parseSchemaType "issuerPartyReference"))+ ])+ `apply` optional (parseSchemaType "seniority")+ `apply` optional (parseSchemaType "couponType")+ `apply` optional (parseSchemaType "couponRate")+ `apply` optional (parseSchemaType "maturity")+ `apply` optional (parseSchemaType "parValue")+ `apply` optional (parseSchemaType "faceAmount")+ `apply` optional (parseSchemaType "paymentFrequency")+ `apply` optional (parseSchemaType "dayCountFraction")+ schemaTypeToXML s x@Bond{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ bond_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ bond_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ bond_description x+ , maybe [] (schemaTypeToXML "currency") $ bond_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ bond_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ bond_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ bond_definition x+ , maybe [] (foldOneOf2 (schemaTypeToXML "issuerName")+ (schemaTypeToXML "issuerPartyReference")+ ) $ bond_choice6 x+ , maybe [] (schemaTypeToXML "seniority") $ bond_seniority x+ , maybe [] (schemaTypeToXML "couponType") $ bond_couponType x+ , maybe [] (schemaTypeToXML "couponRate") $ bond_couponRate x+ , maybe [] (schemaTypeToXML "maturity") $ bond_maturity x+ , maybe [] (schemaTypeToXML "parValue") $ bond_parValue x+ , maybe [] (schemaTypeToXML "faceAmount") $ bond_faceAmount x+ , maybe [] (schemaTypeToXML "paymentFrequency") $ bond_paymentFrequency x+ , maybe [] (schemaTypeToXML "dayCountFraction") $ bond_dayCountFraction x+ ]+instance Extension Bond UnderlyingAsset where+ supertype v = UnderlyingAsset_Bond v+instance Extension Bond IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: Bond -> UnderlyingAsset)+ +instance Extension Bond Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: Bond -> UnderlyingAsset)+ + +data Cash = Cash+ { cash_ID :: Maybe Xsd.ID+ , cash_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , cash_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , cash_currency :: Maybe Currency+ -- ^ The currency in which an amount is denominated.+ }+ deriving (Eq,Show)+instance SchemaType Cash where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Cash a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ schemaTypeToXML s x@Cash{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ cash_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ cash_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ cash_description x+ , maybe [] (schemaTypeToXML "currency") $ cash_currency x+ ]+instance Extension Cash Asset where+ supertype v = Asset_Cash v+ +-- | A type describing the commission that will be charged for +-- each of the hedge transactions.+data Commission = Commission+ { commission_denomination :: Maybe CommissionDenominationEnum+ -- ^ The type of units used to express a commission.+ , commission_amount :: Maybe Xsd.Decimal+ -- ^ The commission amount, expressed in the way indicated by + -- the commissionType element.+ , commission_currency :: Maybe Currency+ -- ^ The currency in which an amount is denominated.+ , commission_perTrade :: Maybe Xsd.Decimal+ -- ^ The total commission per trade.+ , commission_fxRate :: [FxRate]+ -- ^ FX Rates that have been used to convert commissions to a + -- single currency.+ }+ deriving (Eq,Show)+instance SchemaType Commission where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Commission+ `apply` optional (parseSchemaType "commissionDenomination")+ `apply` optional (parseSchemaType "commissionAmount")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "commissionPerTrade")+ `apply` many (parseSchemaType "fxRate")+ schemaTypeToXML s x@Commission{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "commissionDenomination") $ commission_denomination x+ , maybe [] (schemaTypeToXML "commissionAmount") $ commission_amount x+ , maybe [] (schemaTypeToXML "currency") $ commission_currency x+ , maybe [] (schemaTypeToXML "commissionPerTrade") $ commission_perTrade x+ , concatMap (schemaTypeToXML "fxRate") $ commission_fxRate x+ ]+ +-- | A type describing a commodity underlying asset.+data Commodity = Commodity+ { commodity_ID :: Maybe Xsd.ID+ , commodity_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , commodity_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , commodity_base :: Maybe CommodityBase+ -- ^ A coding scheme value to identify the base type of the + -- commodity being traded. Where possible, this should follow + -- the naming convention used in the 2005 ISDA Commodity + -- Definitions. For example, 'Oil'.+ , commodity_details :: Maybe CommodityDetails+ -- ^ A coding scheme value to identify the commodity being + -- traded more specifically. Where possible, this should + -- follow the naming convention used in the 2005 ISDA + -- Commodity Definitions. For example, 'Brent'.+ , commodity_unit :: Maybe QuantityUnit+ -- ^ A coding scheme value to identify the unit in which the + -- undelryer is denominated. Where possible, this should + -- follow the naming convention used in the 2005 ISDA + -- Commodity Definitions.+ , commodity_currency :: Maybe Currency+ -- ^ The currency in which the Commodity Reference Price is + -- published.+ , commodity_choice6 :: (Maybe (OneOf2 ExchangeId InformationSource))+ -- ^ Choice between:+ -- + -- (1) For those commodities being traded with reference to + -- the price of a listed future, the exchange where that + -- future is listed should be specified here.+ -- + -- (2) For those commodities being traded with reference to a + -- price distributed by a publication, that publication + -- should be specified here.+ , commodity_specifiedPrice :: Maybe SpecifiedPriceEnum+ -- ^ The Specified Price is not defined in the Commodity + -- Reference Price and so needs to be stated in the Underlyer + -- definition as it will impact the calculation of the + -- Floating Price.+ , commodity_choice8 :: (Maybe (OneOf3 DeliveryDatesEnum AdjustableDate Xsd.GYearMonth))+ -- ^ Choice between:+ -- + -- (1) The Delivery Date is a NearbyMonth, for use when the + -- Commodity Transaction references Futures Contract.+ -- + -- (2) The Delivery Date is a fixed, single day.+ -- + -- (3) The Delivery Date is a fixed, single month.+ , commodity_deliveryDateRollConvention :: Maybe Offset+ -- ^ Specifies, for a Commodity Transaction that references a + -- listed future via the deliveryDates element, the day on + -- which the specified future will roll to the next nearby + -- month when the referenced future expires. If the future + -- will not roll at all - i.e. the price will be taken from + -- the expiring contract, 0 should be specified here. If the + -- future will roll to the next nearby on the last trading day + -- - i.e. the price will be taken from the next nearby on the + -- last trading day, then 1 should be specified and so on.+ , commodity_multiplier :: Maybe PositiveDecimal+ -- ^ Specifies the multiplier associated with a Transaction.+ }+ deriving (Eq,Show)+instance SchemaType Commodity where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Commodity a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "commodityBase")+ `apply` optional (parseSchemaType "commodityDetails")+ `apply` optional (parseSchemaType "unit")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (oneOf' [ ("ExchangeId", fmap OneOf2 (parseSchemaType "exchangeId"))+ , ("InformationSource", fmap TwoOf2 (parseSchemaType "publication"))+ ])+ `apply` optional (parseSchemaType "specifiedPrice")+ `apply` optional (oneOf' [ ("DeliveryDatesEnum", fmap OneOf3 (parseSchemaType "deliveryDates"))+ , ("AdjustableDate", fmap TwoOf3 (parseSchemaType "deliveryDate"))+ , ("Xsd.GYearMonth", fmap ThreeOf3 (parseSchemaType "deliveryDateYearMonth"))+ ])+ `apply` optional (parseSchemaType "deliveryDateRollConvention")+ `apply` optional (parseSchemaType "multiplier")+ schemaTypeToXML s x@Commodity{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodity_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ commodity_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ commodity_description x+ , maybe [] (schemaTypeToXML "commodityBase") $ commodity_base x+ , maybe [] (schemaTypeToXML "commodityDetails") $ commodity_details x+ , maybe [] (schemaTypeToXML "unit") $ commodity_unit x+ , maybe [] (schemaTypeToXML "currency") $ commodity_currency x+ , maybe [] (foldOneOf2 (schemaTypeToXML "exchangeId")+ (schemaTypeToXML "publication")+ ) $ commodity_choice6 x+ , maybe [] (schemaTypeToXML "specifiedPrice") $ commodity_specifiedPrice x+ , maybe [] (foldOneOf3 (schemaTypeToXML "deliveryDates")+ (schemaTypeToXML "deliveryDate")+ (schemaTypeToXML "deliveryDateYearMonth")+ ) $ commodity_choice8 x+ , maybe [] (schemaTypeToXML "deliveryDateRollConvention") $ commodity_deliveryDateRollConvention x+ , maybe [] (schemaTypeToXML "multiplier") $ commodity_multiplier x+ ]+instance Extension Commodity IdentifiedAsset where+ supertype v = IdentifiedAsset_Commodity v+instance Extension Commodity Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: Commodity -> IdentifiedAsset)+ + +data CommodityBase = CommodityBase Scheme CommodityBaseAttributes deriving (Eq,Show)+data CommodityBaseAttributes = CommodityBaseAttributes+ { commodBaseAttrib_commodityBaseScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CommodityBase where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "commodityBaseScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CommodityBase v (CommodityBaseAttributes a0)+ schemaTypeToXML s (CommodityBase bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "commodityBaseScheme") $ commodBaseAttrib_commodityBaseScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CommodityBase Scheme where+ supertype (CommodityBase s _) = s+ +-- | Defines a commodity business day calendar.+data CommodityBusinessCalendar = CommodityBusinessCalendar Scheme CommodityBusinessCalendarAttributes deriving (Eq,Show)+data CommodityBusinessCalendarAttributes = CommodityBusinessCalendarAttributes+ { cbca_commodityBusinessCalendarScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CommodityBusinessCalendar where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "commodityBusinessCalendarScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CommodityBusinessCalendar v (CommodityBusinessCalendarAttributes a0)+ schemaTypeToXML s (CommodityBusinessCalendar bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "commodityBusinessCalendarScheme") $ cbca_commodityBusinessCalendarScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CommodityBusinessCalendar Scheme where+ supertype (CommodityBusinessCalendar s _) = s+ +-- | Specifies the time with respect to a commodity business +-- calendar.+data CommodityBusinessCalendarTime = CommodityBusinessCalendarTime+ { commodBusCalTime_hourMinuteTime :: Maybe HourMinuteTime+ -- ^ A time specified as Hour Ending in hh:mm:ss format where + -- the second component must be '00', e.g. 11am would be + -- represented as 11:00:00.+ , commodBusCalTime_timeZone :: Maybe TimeZone+ -- ^ An identifier for a specific location or region which + -- translates into a combination of rules for calculating the + -- UTC offset.+ , commodBusCalTime_businessCalendar :: Maybe CommodityBusinessCalendar+ -- ^ Identifies a commodity business day calendar.+ }+ deriving (Eq,Show)+instance SchemaType CommodityBusinessCalendarTime where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CommodityBusinessCalendarTime+ `apply` optional (parseSchemaType "hourMinuteTime")+ `apply` optional (parseSchemaType "timeZone")+ `apply` optional (parseSchemaType "businessCalendar")+ schemaTypeToXML s x@CommodityBusinessCalendarTime{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "hourMinuteTime") $ commodBusCalTime_hourMinuteTime x+ , maybe [] (schemaTypeToXML "timeZone") $ commodBusCalTime_timeZone x+ , maybe [] (schemaTypeToXML "businessCalendar") $ commodBusCalTime_businessCalendar x+ ]+ +data CommodityDetails = CommodityDetails Scheme CommodityDetailsAttributes deriving (Eq,Show)+data CommodityDetailsAttributes = CommodityDetailsAttributes+ { commodDetailsAttrib_commodityDetailsScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CommodityDetails where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "commodityDetailsScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CommodityDetails v (CommodityDetailsAttributes a0)+ schemaTypeToXML s (CommodityDetails bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "commodityDetailsScheme") $ commodDetailsAttrib_commodityDetailsScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CommodityDetails Scheme where+ supertype (CommodityDetails s _) = s+ +-- | A type describing the weight of each of the underlyer +-- constituent within the basket, either in absolute or +-- relative terms.+data ConstituentWeight = ConstituentWeight+ { constitWeight_choice0 :: (Maybe (OneOf3 Xsd.Decimal RestrictedPercentage Money))+ -- ^ Choice between:+ -- + -- (1) The number of units (index or securities) that + -- constitute the underlyer of the swap. In the case of a + -- basket swap, this element is used to reference both the + -- number of basket units, and the number of each asset + -- components of the basket when these are expressed in + -- absolute terms.+ -- + -- (2) The relative weight of each respective basket + -- constituent, expressed in percentage. A basket + -- percentage of 5% would be represented as 0.05.+ -- + -- (3) DEPRECATED. The relative weight of each respective + -- basket constituent, expressed as a monetary amount.+ }+ deriving (Eq,Show)+instance SchemaType ConstituentWeight where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ConstituentWeight+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf3 (parseSchemaType "openUnits"))+ , ("RestrictedPercentage", fmap TwoOf3 (parseSchemaType "basketPercentage"))+ , ("Money", fmap ThreeOf3 (parseSchemaType "basketAmount"))+ ])+ schemaTypeToXML s x@ConstituentWeight{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "openUnits")+ (schemaTypeToXML "basketPercentage")+ (schemaTypeToXML "basketAmount")+ ) $ constitWeight_choice0 x+ ]+ +data ConvertibleBond = ConvertibleBond+ { convertBond_ID :: Maybe Xsd.ID+ , convertBond_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , convertBond_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , convertBond_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , convertBond_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , convertBond_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , convertBond_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , convertBond_choice6 :: (Maybe (OneOf2 Xsd.XsdString PartyReference))+ -- ^ Specifies the issuer name of a fixed income security or + -- convertible bond. This name can either be explicitly + -- stated, or specified as an href into another element of the + -- document, such as the obligor.+ -- + -- Choice between:+ -- + -- (1) issuerName+ -- + -- (2) issuerPartyReference+ , convertBond_seniority :: Maybe CreditSeniority+ -- ^ The repayment precedence of a debt instrument.+ , convertBond_couponType :: Maybe CouponType+ -- ^ Specifies if the bond has a variable coupon, step-up/down + -- coupon or a zero-coupon.+ , convertBond_couponRate :: Maybe Xsd.Decimal+ -- ^ Specifies the coupon rate (expressed in percentage) of a + -- fixed income security or convertible bond.+ , convertBond_maturity :: Maybe Xsd.Date+ -- ^ The date when the principal amount of a security becomes + -- due and payable.+ , convertBond_parValue :: Maybe Xsd.Decimal+ -- ^ Specifies the nominal amount of a fixed income security or + -- convertible bond.+ , convertBond_faceAmount :: Maybe Xsd.Decimal+ -- ^ Specifies the total amount of the issue. Corresponds to the + -- par value multiplied by the number of issued security.+ , convertBond_paymentFrequency :: Maybe Period+ -- ^ Specifies the frequency at which the bond pays, e.g. 6M.+ , convertBond_dayCountFraction :: Maybe DayCountFraction+ -- ^ The day count basis for the bond.+ , convertBond_underlyingEquity :: Maybe EquityAsset+ -- ^ Specifies the equity in which the convertible bond can be + -- converted.+ , convertBond_redemptionDate :: Maybe Xsd.Date+ -- ^ Earlier date between the convertible bond put dates and its + -- maturity date.+ }+ deriving (Eq,Show)+instance SchemaType ConvertibleBond where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ConvertibleBond a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` optional (oneOf' [ ("Xsd.XsdString", fmap OneOf2 (parseSchemaType "issuerName"))+ , ("PartyReference", fmap TwoOf2 (parseSchemaType "issuerPartyReference"))+ ])+ `apply` optional (parseSchemaType "seniority")+ `apply` optional (parseSchemaType "couponType")+ `apply` optional (parseSchemaType "couponRate")+ `apply` optional (parseSchemaType "maturity")+ `apply` optional (parseSchemaType "parValue")+ `apply` optional (parseSchemaType "faceAmount")+ `apply` optional (parseSchemaType "paymentFrequency")+ `apply` optional (parseSchemaType "dayCountFraction")+ `apply` optional (parseSchemaType "underlyingEquity")+ `apply` optional (parseSchemaType "redemptionDate")+ schemaTypeToXML s x@ConvertibleBond{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ convertBond_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ convertBond_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ convertBond_description x+ , maybe [] (schemaTypeToXML "currency") $ convertBond_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ convertBond_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ convertBond_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ convertBond_definition x+ , maybe [] (foldOneOf2 (schemaTypeToXML "issuerName")+ (schemaTypeToXML "issuerPartyReference")+ ) $ convertBond_choice6 x+ , maybe [] (schemaTypeToXML "seniority") $ convertBond_seniority x+ , maybe [] (schemaTypeToXML "couponType") $ convertBond_couponType x+ , maybe [] (schemaTypeToXML "couponRate") $ convertBond_couponRate x+ , maybe [] (schemaTypeToXML "maturity") $ convertBond_maturity x+ , maybe [] (schemaTypeToXML "parValue") $ convertBond_parValue x+ , maybe [] (schemaTypeToXML "faceAmount") $ convertBond_faceAmount x+ , maybe [] (schemaTypeToXML "paymentFrequency") $ convertBond_paymentFrequency x+ , maybe [] (schemaTypeToXML "dayCountFraction") $ convertBond_dayCountFraction x+ , maybe [] (schemaTypeToXML "underlyingEquity") $ convertBond_underlyingEquity x+ , maybe [] (schemaTypeToXML "redemptionDate") $ convertBond_redemptionDate x+ ]+instance Extension ConvertibleBond Bond where+ supertype (ConvertibleBond a0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14 e15 e16) =+ Bond a0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14+instance Extension ConvertibleBond UnderlyingAsset where+ supertype = (supertype :: Bond -> UnderlyingAsset)+ . (supertype :: ConvertibleBond -> Bond)+ +instance Extension ConvertibleBond IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: Bond -> UnderlyingAsset)+ . (supertype :: ConvertibleBond -> Bond)+ +instance Extension ConvertibleBond Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: Bond -> UnderlyingAsset)+ . (supertype :: ConvertibleBond -> Bond)+ + +-- | Defines a scheme of values for specifiying if the bond has +-- a variable coupon, step-up/down coupon or a zero-coupon.+data CouponType = CouponType Scheme CouponTypeAttributes deriving (Eq,Show)+data CouponTypeAttributes = CouponTypeAttributes+ { couponTypeAttrib_couponTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CouponType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "couponTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CouponType v (CouponTypeAttributes a0)+ schemaTypeToXML s (CouponType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "couponTypeScheme") $ couponTypeAttrib_couponTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CouponType Scheme where+ supertype (CouponType s _) = s+ +-- | Abstract base class for instruments intended to be used +-- primarily for building curves.+-- (There are no subtypes defined for this abstract type.)+data CurveInstrument = CurveInstrument deriving (Eq,Show)+instance SchemaType CurveInstrument where+ parseSchemaType s = fail "Parse failed when expecting an extension type of CurveInstrument:\n No extension types are known."+ schemaTypeToXML s _ = toXMLElement s [] []+instance Extension CurveInstrument IdentifiedAsset where+ supertype v = IdentifiedAsset_CurveInstrument v+ +data Deposit = Deposit+ { deposit_ID :: Maybe Xsd.ID+ , deposit_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , deposit_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , deposit_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , deposit_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , deposit_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , deposit_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , deposit_term :: Maybe Period+ -- ^ Specifies the term of the deposit, e.g. 5Y.+ , deposit_paymentFrequency :: Maybe Period+ -- ^ Specifies the frequency at which the deposit pays, e.g. 6M.+ , deposit_dayCountFraction :: Maybe DayCountFraction+ -- ^ The day count basis for the deposit.+ }+ deriving (Eq,Show)+instance SchemaType Deposit where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Deposit a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` optional (parseSchemaType "term")+ `apply` optional (parseSchemaType "paymentFrequency")+ `apply` optional (parseSchemaType "dayCountFraction")+ schemaTypeToXML s x@Deposit{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ deposit_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ deposit_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ deposit_description x+ , maybe [] (schemaTypeToXML "currency") $ deposit_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ deposit_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ deposit_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ deposit_definition x+ , maybe [] (schemaTypeToXML "term") $ deposit_term x+ , maybe [] (schemaTypeToXML "paymentFrequency") $ deposit_paymentFrequency x+ , maybe [] (schemaTypeToXML "dayCountFraction") $ deposit_dayCountFraction x+ ]+instance Extension Deposit UnderlyingAsset where+ supertype v = UnderlyingAsset_Deposit v+instance Extension Deposit IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: Deposit -> UnderlyingAsset)+ +instance Extension Deposit Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: Deposit -> UnderlyingAsset)+ + +-- | A type describing the dividend payout ratio associated with +-- an equity underlyer. In certain cases the actual ratio is +-- not known on trade inception, and only general conditions +-- are then specified.+data DividendPayout = DividendPayout+ { dividPayout_choice0 :: (Maybe (OneOf2 Xsd.Decimal Xsd.XsdString))+ -- ^ Choice between:+ -- + -- (1) Specifies the actual dividend payout ratio associated + -- with the equity underlyer.+ -- + -- (2) Specifies the dividend payout conditions that will be + -- applied in the case where the actual ratio is not + -- known, typically because of regulatory or legal + -- uncertainties.+ , dividPayout_dividendPayment :: [PendingPayment]+ -- ^ The next upcoming dividend payment or payments.+ }+ deriving (Eq,Show)+instance SchemaType DividendPayout where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DividendPayout+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "dividendPayoutRatio"))+ , ("Xsd.XsdString", fmap TwoOf2 (parseSchemaType "dividendPayoutConditions"))+ ])+ `apply` many (parseSchemaType "dividendPayment")+ schemaTypeToXML s x@DividendPayout{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "dividendPayoutRatio")+ (schemaTypeToXML "dividendPayoutConditions")+ ) $ dividPayout_choice0 x+ , concatMap (schemaTypeToXML "dividendPayment") $ dividPayout_dividendPayment x+ ]+ +-- | An exchange traded equity asset.+data EquityAsset = EquityAsset+ { equityAsset_ID :: Maybe Xsd.ID+ , equityAsset_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , equityAsset_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , equityAsset_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , equityAsset_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , equityAsset_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , equityAsset_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , equityAsset_relatedExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for a related exchange. If + -- the element is not present then the exchange shall be the + -- primary exchange on which listed futures and options on the + -- underlying are listed. The term "Exchange" is assumed to + -- have the meaning as defined in the ISDA 2002 Equity + -- Derivatives Definitions.+ , equityAsset_optionsExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for an exchange on which the + -- reference option contract is listed. This is to address the + -- case where the reference exchange for the future is + -- different than the one for the option. The options Exchange + -- is referenced on share options when Merger Elections are + -- selected as Options Exchange Adjustment.+ , equityAsset_specifiedExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for a specified exchange. If + -- the element is not present then the exchange shall be + -- default terms as defined in the MCA; unless otherwise + -- specified in the Transaction Supplement.+ }+ deriving (Eq,Show)+instance SchemaType EquityAsset where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (EquityAsset a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` many (parseSchemaType "relatedExchangeId")+ `apply` many (parseSchemaType "optionsExchangeId")+ `apply` many (parseSchemaType "specifiedExchangeId")+ schemaTypeToXML s x@EquityAsset{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ equityAsset_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ equityAsset_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ equityAsset_description x+ , maybe [] (schemaTypeToXML "currency") $ equityAsset_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ equityAsset_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ equityAsset_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ equityAsset_definition x+ , concatMap (schemaTypeToXML "relatedExchangeId") $ equityAsset_relatedExchangeId x+ , concatMap (schemaTypeToXML "optionsExchangeId") $ equityAsset_optionsExchangeId x+ , concatMap (schemaTypeToXML "specifiedExchangeId") $ equityAsset_specifiedExchangeId x+ ]+instance Extension EquityAsset ExchangeTraded where+ supertype v = ExchangeTraded_EquityAsset v+instance Extension EquityAsset UnderlyingAsset where+ supertype = (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: EquityAsset -> ExchangeTraded)+ +instance Extension EquityAsset IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: EquityAsset -> ExchangeTraded)+ +instance Extension EquityAsset Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: EquityAsset -> ExchangeTraded)+ + +-- | An abstract base class for all exchange traded financial +-- products.+data ExchangeTraded+ = ExchangeTraded_Future Future+ | ExchangeTraded_ExchangeTradedContract ExchangeTradedContract+ | ExchangeTraded_ExchangeTradedCalculatedPrice ExchangeTradedCalculatedPrice+ | ExchangeTraded_EquityAsset EquityAsset+ + deriving (Eq,Show)+instance SchemaType ExchangeTraded where+ parseSchemaType s = do+ (fmap ExchangeTraded_Future $ parseSchemaType s)+ `onFail`+ (fmap ExchangeTraded_ExchangeTradedContract $ parseSchemaType s)+ `onFail`+ (fmap ExchangeTraded_ExchangeTradedCalculatedPrice $ parseSchemaType s)+ `onFail`+ (fmap ExchangeTraded_EquityAsset $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of ExchangeTraded,\n\+\ namely one of:\n\+\Future,ExchangeTradedContract,ExchangeTradedCalculatedPrice,EquityAsset"+ schemaTypeToXML _s (ExchangeTraded_Future x) = schemaTypeToXML "future" x+ schemaTypeToXML _s (ExchangeTraded_ExchangeTradedContract x) = schemaTypeToXML "exchangeTradedContract" x+ schemaTypeToXML _s (ExchangeTraded_ExchangeTradedCalculatedPrice x) = schemaTypeToXML "exchangeTradedCalculatedPrice" x+ schemaTypeToXML _s (ExchangeTraded_EquityAsset x) = schemaTypeToXML "equityAsset" x+instance Extension ExchangeTraded UnderlyingAsset where+ supertype v = UnderlyingAsset_ExchangeTraded v+ +-- | Abstract base class for all exchange traded financial +-- products with a price which is calculated from exchange +-- traded constituents.+data ExchangeTradedCalculatedPrice+ = ExchangeTradedCalculatedPrice_Index Index+ | ExchangeTradedCalculatedPrice_ExchangeTradedFund ExchangeTradedFund+ + deriving (Eq,Show)+instance SchemaType ExchangeTradedCalculatedPrice where+ parseSchemaType s = do+ (fmap ExchangeTradedCalculatedPrice_Index $ parseSchemaType s)+ `onFail`+ (fmap ExchangeTradedCalculatedPrice_ExchangeTradedFund $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of ExchangeTradedCalculatedPrice,\n\+\ namely one of:\n\+\Index,ExchangeTradedFund"+ schemaTypeToXML _s (ExchangeTradedCalculatedPrice_Index x) = schemaTypeToXML "index" x+ schemaTypeToXML _s (ExchangeTradedCalculatedPrice_ExchangeTradedFund x) = schemaTypeToXML "exchangeTradedFund" x+instance Extension ExchangeTradedCalculatedPrice ExchangeTraded where+ supertype v = ExchangeTraded_ExchangeTradedCalculatedPrice v+ +-- | An exchange traded derivative contract.+data ExchangeTradedContract = ExchangeTradedContract+ { exchTradedContr_ID :: Maybe Xsd.ID+ , exchTradedContr_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , exchTradedContr_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , exchTradedContr_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , exchTradedContr_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , exchTradedContr_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , exchTradedContr_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , exchTradedContr_relatedExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for a related exchange. If + -- the element is not present then the exchange shall be the + -- primary exchange on which listed futures and options on the + -- underlying are listed. The term "Exchange" is assumed to + -- have the meaning as defined in the ISDA 2002 Equity + -- Derivatives Definitions.+ , exchTradedContr_optionsExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for an exchange on which the + -- reference option contract is listed. This is to address the + -- case where the reference exchange for the future is + -- different than the one for the option. The options Exchange + -- is referenced on share options when Merger Elections are + -- selected as Options Exchange Adjustment.+ , exchTradedContr_specifiedExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for a specified exchange. If + -- the element is not present then the exchange shall be + -- default terms as defined in the MCA; unless otherwise + -- specified in the Transaction Supplement.+ , exchTradedContr_multiplier :: Maybe Xsd.PositiveInteger+ -- ^ Specifies the contract multiplier that can be associated + -- with the number of units.+ , exchTradedContr_contractReference :: Maybe Xsd.XsdString+ -- ^ Specifies the contract that can be referenced, besides the + -- undelyer type.+ , exchTradedContr_expirationDate :: Maybe AdjustableOrRelativeDate+ -- ^ The date when the contract expires.+ }+ deriving (Eq,Show)+instance SchemaType ExchangeTradedContract where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ExchangeTradedContract a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` many (parseSchemaType "relatedExchangeId")+ `apply` many (parseSchemaType "optionsExchangeId")+ `apply` many (parseSchemaType "specifiedExchangeId")+ `apply` optional (parseSchemaType "multiplier")+ `apply` optional (parseSchemaType "contractReference")+ `apply` optional (parseSchemaType "expirationDate")+ schemaTypeToXML s x@ExchangeTradedContract{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ exchTradedContr_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ exchTradedContr_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ exchTradedContr_description x+ , maybe [] (schemaTypeToXML "currency") $ exchTradedContr_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ exchTradedContr_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ exchTradedContr_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ exchTradedContr_definition x+ , concatMap (schemaTypeToXML "relatedExchangeId") $ exchTradedContr_relatedExchangeId x+ , concatMap (schemaTypeToXML "optionsExchangeId") $ exchTradedContr_optionsExchangeId x+ , concatMap (schemaTypeToXML "specifiedExchangeId") $ exchTradedContr_specifiedExchangeId x+ , maybe [] (schemaTypeToXML "multiplier") $ exchTradedContr_multiplier x+ , maybe [] (schemaTypeToXML "contractReference") $ exchTradedContr_contractReference x+ , maybe [] (schemaTypeToXML "expirationDate") $ exchTradedContr_expirationDate x+ ]+instance Extension ExchangeTradedContract ExchangeTraded where+ supertype v = ExchangeTraded_ExchangeTradedContract v+instance Extension ExchangeTradedContract UnderlyingAsset where+ supertype = (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: ExchangeTradedContract -> ExchangeTraded)+ +instance Extension ExchangeTradedContract IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: ExchangeTradedContract -> ExchangeTraded)+ +instance Extension ExchangeTradedContract Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: ExchangeTradedContract -> ExchangeTraded)+ + +-- | An exchange traded fund whose price depends on exchange +-- traded constituents.+data ExchangeTradedFund = ExchangeTradedFund+ { exchTradedFund_ID :: Maybe Xsd.ID+ , exchTradedFund_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , exchTradedFund_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , exchTradedFund_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , exchTradedFund_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , exchTradedFund_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , exchTradedFund_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , exchTradedFund_relatedExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for a related exchange. If + -- the element is not present then the exchange shall be the + -- primary exchange on which listed futures and options on the + -- underlying are listed. The term "Exchange" is assumed to + -- have the meaning as defined in the ISDA 2002 Equity + -- Derivatives Definitions.+ , exchTradedFund_optionsExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for an exchange on which the + -- reference option contract is listed. This is to address the + -- case where the reference exchange for the future is + -- different than the one for the option. The options Exchange + -- is referenced on share options when Merger Elections are + -- selected as Options Exchange Adjustment.+ , exchTradedFund_specifiedExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for a specified exchange. If + -- the element is not present then the exchange shall be + -- default terms as defined in the MCA; unless otherwise + -- specified in the Transaction Supplement.+ , exchTradedFund_constituentExchangeId :: [ExchangeId]+ -- ^ Identification of all the exchanges where constituents are + -- traded. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , exchTradedFund_fundManager :: Maybe Xsd.XsdString+ -- ^ Specifies the fund manager that is in charge of the fund.+ }+ deriving (Eq,Show)+instance SchemaType ExchangeTradedFund where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ExchangeTradedFund a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` many (parseSchemaType "relatedExchangeId")+ `apply` many (parseSchemaType "optionsExchangeId")+ `apply` many (parseSchemaType "specifiedExchangeId")+ `apply` many (parseSchemaType "constituentExchangeId")+ `apply` optional (parseSchemaType "fundManager")+ schemaTypeToXML s x@ExchangeTradedFund{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ exchTradedFund_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ exchTradedFund_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ exchTradedFund_description x+ , maybe [] (schemaTypeToXML "currency") $ exchTradedFund_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ exchTradedFund_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ exchTradedFund_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ exchTradedFund_definition x+ , concatMap (schemaTypeToXML "relatedExchangeId") $ exchTradedFund_relatedExchangeId x+ , concatMap (schemaTypeToXML "optionsExchangeId") $ exchTradedFund_optionsExchangeId x+ , concatMap (schemaTypeToXML "specifiedExchangeId") $ exchTradedFund_specifiedExchangeId x+ , concatMap (schemaTypeToXML "constituentExchangeId") $ exchTradedFund_constituentExchangeId x+ , maybe [] (schemaTypeToXML "fundManager") $ exchTradedFund_fundManager x+ ]+instance Extension ExchangeTradedFund ExchangeTradedCalculatedPrice where+ supertype v = ExchangeTradedCalculatedPrice_ExchangeTradedFund v+instance Extension ExchangeTradedFund ExchangeTraded where+ supertype = (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)+ . (supertype :: ExchangeTradedFund -> ExchangeTradedCalculatedPrice)+ +instance Extension ExchangeTradedFund UnderlyingAsset where+ supertype = (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)+ . (supertype :: ExchangeTradedFund -> ExchangeTradedCalculatedPrice)+ +instance Extension ExchangeTradedFund IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)+ . (supertype :: ExchangeTradedFund -> ExchangeTradedCalculatedPrice)+ +instance Extension ExchangeTradedFund Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)+ . (supertype :: ExchangeTradedFund -> ExchangeTradedCalculatedPrice)+ + +-- | A type describing the type of loan facility.+data FacilityType = FacilityType Scheme FacilityTypeAttributes deriving (Eq,Show)+data FacilityTypeAttributes = FacilityTypeAttributes+ { facilTypeAttrib_facilityTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType FacilityType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "facilityTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ FacilityType v (FacilityTypeAttributes a0)+ schemaTypeToXML s (FacilityType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "facilityTypeScheme") $ facilTypeAttrib_facilityTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension FacilityType Scheme where+ supertype (FacilityType s _) = s+ +-- | An exchange traded future contract.+data Future = Future+ { future_ID :: Maybe Xsd.ID+ , future_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , future_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , future_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , future_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , future_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , future_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , future_relatedExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for a related exchange. If + -- the element is not present then the exchange shall be the + -- primary exchange on which listed futures and options on the + -- underlying are listed. The term "Exchange" is assumed to + -- have the meaning as defined in the ISDA 2002 Equity + -- Derivatives Definitions.+ , future_optionsExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for an exchange on which the + -- reference option contract is listed. This is to address the + -- case where the reference exchange for the future is + -- different than the one for the option. The options Exchange + -- is referenced on share options when Merger Elections are + -- selected as Options Exchange Adjustment.+ , future_specifiedExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for a specified exchange. If + -- the element is not present then the exchange shall be + -- default terms as defined in the MCA; unless otherwise + -- specified in the Transaction Supplement.+ , future_multiplier :: Maybe Xsd.PositiveInteger+ -- ^ Specifies the contract multiplier that can be associated + -- with the number of units.+ , future_contractReference :: Maybe Xsd.XsdString+ -- ^ Specifies the future contract that can be referenced, + -- besides the equity or index reference defined as part of + -- the UnderlyerAsset type.+ , future_maturity :: Maybe Xsd.Date+ -- ^ The date when the future contract expires.+ }+ deriving (Eq,Show)+instance SchemaType Future where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Future a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` many (parseSchemaType "relatedExchangeId")+ `apply` many (parseSchemaType "optionsExchangeId")+ `apply` many (parseSchemaType "specifiedExchangeId")+ `apply` optional (parseSchemaType "multiplier")+ `apply` optional (parseSchemaType "futureContractReference")+ `apply` optional (parseSchemaType "maturity")+ schemaTypeToXML s x@Future{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ future_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ future_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ future_description x+ , maybe [] (schemaTypeToXML "currency") $ future_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ future_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ future_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ future_definition x+ , concatMap (schemaTypeToXML "relatedExchangeId") $ future_relatedExchangeId x+ , concatMap (schemaTypeToXML "optionsExchangeId") $ future_optionsExchangeId x+ , concatMap (schemaTypeToXML "specifiedExchangeId") $ future_specifiedExchangeId x+ , maybe [] (schemaTypeToXML "multiplier") $ future_multiplier x+ , maybe [] (schemaTypeToXML "futureContractReference") $ future_contractReference x+ , maybe [] (schemaTypeToXML "maturity") $ future_maturity x+ ]+instance Extension Future ExchangeTraded where+ supertype v = ExchangeTraded_Future v+instance Extension Future UnderlyingAsset where+ supertype = (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: Future -> ExchangeTraded)+ +instance Extension Future IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: Future -> ExchangeTraded)+ +instance Extension Future Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: Future -> ExchangeTraded)+ + +-- | A type defining a short form unique identifier for a future +-- contract.+data FutureId = FutureId Scheme FutureIdAttributes deriving (Eq,Show)+data FutureIdAttributes = FutureIdAttributes+ { futureIdAttrib_futureIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType FutureId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "futureIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ FutureId v (FutureIdAttributes a0)+ schemaTypeToXML s (FutureId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "futureIdScheme") $ futureIdAttrib_futureIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension FutureId Scheme where+ supertype (FutureId s _) = s+ +data FxConversion = FxConversion+ { fxConversion_choice0 :: (Maybe (OneOf2 AmountReference [FxRate]))+ -- ^ Choice between:+ -- + -- (1) amountRelativeTo+ -- + -- (2) Specifies a currency conversion rate.+ }+ deriving (Eq,Show)+instance SchemaType FxConversion where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxConversion+ `apply` optional (oneOf' [ ("AmountReference", fmap OneOf2 (parseSchemaType "amountRelativeTo"))+ , ("[FxRate]", fmap TwoOf2 (many1 (parseSchemaType "fxRate")))+ ])+ schemaTypeToXML s x@FxConversion{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "amountRelativeTo")+ (concatMap (schemaTypeToXML "fxRate"))+ ) $ fxConversion_choice0 x+ ]+ +data FxRateAsset = FxRateAsset+ { fxRateAsset_ID :: Maybe Xsd.ID+ , fxRateAsset_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , fxRateAsset_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , fxRateAsset_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , fxRateAsset_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , fxRateAsset_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , fxRateAsset_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , fxRateAsset_quotedCurrencyPair :: Maybe QuotedCurrencyPair+ -- ^ Defines the two currencies for an FX trade and the + -- quotation relationship between the two currencies.+ , fxRateAsset_rateSource :: Maybe FxSpotRateSource+ -- ^ Defines the source of the FX rate.+ }+ deriving (Eq,Show)+instance SchemaType FxRateAsset where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FxRateAsset a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` optional (parseSchemaType "quotedCurrencyPair")+ `apply` optional (parseSchemaType "rateSource")+ schemaTypeToXML s x@FxRateAsset{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxRateAsset_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ fxRateAsset_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ fxRateAsset_description x+ , maybe [] (schemaTypeToXML "currency") $ fxRateAsset_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ fxRateAsset_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ fxRateAsset_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ fxRateAsset_definition x+ , maybe [] (schemaTypeToXML "quotedCurrencyPair") $ fxRateAsset_quotedCurrencyPair x+ , maybe [] (schemaTypeToXML "rateSource") $ fxRateAsset_rateSource x+ ]+instance Extension FxRateAsset UnderlyingAsset where+ supertype v = UnderlyingAsset_FxRateAsset v+instance Extension FxRateAsset IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: FxRateAsset -> UnderlyingAsset)+ +instance Extension FxRateAsset Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: FxRateAsset -> UnderlyingAsset)+ + +-- | A generic type describing an identified asset.+data IdentifiedAsset+ = IdentifiedAsset_UnderlyingAsset UnderlyingAsset+ | IdentifiedAsset_CurveInstrument CurveInstrument+ | IdentifiedAsset_Commodity Commodity+ + deriving (Eq,Show)+instance SchemaType IdentifiedAsset where+ parseSchemaType s = do+ (fmap IdentifiedAsset_UnderlyingAsset $ parseSchemaType s)+ `onFail`+ (fmap IdentifiedAsset_CurveInstrument $ parseSchemaType s)+ `onFail`+ (fmap IdentifiedAsset_Commodity $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of IdentifiedAsset,\n\+\ namely one of:\n\+\UnderlyingAsset,CurveInstrument,Commodity"+ schemaTypeToXML _s (IdentifiedAsset_UnderlyingAsset x) = schemaTypeToXML "underlyingAsset" x+ schemaTypeToXML _s (IdentifiedAsset_CurveInstrument x) = schemaTypeToXML "curveInstrument" x+ schemaTypeToXML _s (IdentifiedAsset_Commodity x) = schemaTypeToXML "commodity" x+instance Extension IdentifiedAsset Asset where+ supertype v = Asset_IdentifiedAsset v+ +-- | A published index whose price depends on exchange traded +-- constituents.+data Index = Index+ { index_ID :: Maybe Xsd.ID+ , index_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , index_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , index_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , index_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , index_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , index_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , index_relatedExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for a related exchange. If + -- the element is not present then the exchange shall be the + -- primary exchange on which listed futures and options on the + -- underlying are listed. The term "Exchange" is assumed to + -- have the meaning as defined in the ISDA 2002 Equity + -- Derivatives Definitions.+ , index_optionsExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for an exchange on which the + -- reference option contract is listed. This is to address the + -- case where the reference exchange for the future is + -- different than the one for the option. The options Exchange + -- is referenced on share options when Merger Elections are + -- selected as Options Exchange Adjustment.+ , index_specifiedExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for a specified exchange. If + -- the element is not present then the exchange shall be + -- default terms as defined in the MCA; unless otherwise + -- specified in the Transaction Supplement.+ , index_constituentExchangeId :: [ExchangeId]+ -- ^ Identification of all the exchanges where constituents are + -- traded. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , index_futureId :: Maybe FutureId+ -- ^ A short form unique identifier for the reference future + -- contract in the case of an index underlyer.+ }+ deriving (Eq,Show)+instance SchemaType Index where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Index a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` many (parseSchemaType "relatedExchangeId")+ `apply` many (parseSchemaType "optionsExchangeId")+ `apply` many (parseSchemaType "specifiedExchangeId")+ `apply` many (parseSchemaType "constituentExchangeId")+ `apply` optional (parseSchemaType "futureId")+ schemaTypeToXML s x@Index{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ index_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ index_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ index_description x+ , maybe [] (schemaTypeToXML "currency") $ index_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ index_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ index_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ index_definition x+ , concatMap (schemaTypeToXML "relatedExchangeId") $ index_relatedExchangeId x+ , concatMap (schemaTypeToXML "optionsExchangeId") $ index_optionsExchangeId x+ , concatMap (schemaTypeToXML "specifiedExchangeId") $ index_specifiedExchangeId x+ , concatMap (schemaTypeToXML "constituentExchangeId") $ index_constituentExchangeId x+ , maybe [] (schemaTypeToXML "futureId") $ index_futureId x+ ]+instance Extension Index ExchangeTradedCalculatedPrice where+ supertype v = ExchangeTradedCalculatedPrice_Index v+instance Extension Index ExchangeTraded where+ supertype = (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)+ . (supertype :: Index -> ExchangeTradedCalculatedPrice)+ +instance Extension Index UnderlyingAsset where+ supertype = (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)+ . (supertype :: Index -> ExchangeTradedCalculatedPrice)+ +instance Extension Index IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)+ . (supertype :: Index -> ExchangeTradedCalculatedPrice)+ +instance Extension Index Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: ExchangeTraded -> UnderlyingAsset)+ . (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)+ . (supertype :: Index -> ExchangeTradedCalculatedPrice)+ + +-- | A type describing the liens associated with a loan +-- facility.+data Lien = Lien Scheme LienAttributes deriving (Eq,Show)+data LienAttributes = LienAttributes+ { lienAttrib_lienScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType Lien where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "lienScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ Lien v (LienAttributes a0)+ schemaTypeToXML s (Lien bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "lienScheme") $ lienAttrib_lienScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension Lien Scheme where+ supertype (Lien s _) = s+ +-- | A type describing a loan underlying asset.+data Loan = Loan+ { loan_ID :: Maybe Xsd.ID+ , loan_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , loan_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , loan_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , loan_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , loan_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , loan_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , loan_choice6 :: [OneOf2 LegalEntity LegalEntityReference]+ -- ^ Specifies the borrower. There can be more than one + -- borrower. It is meant to be used in the event that there is + -- no Bloomberg Id or the Secured List isn't applicable.+ -- + -- Choice between:+ -- + -- (1) borrower+ -- + -- (2) borrowerReference+ , loan_lien :: Maybe Lien+ -- ^ Specifies the seniority level of the lien.+ , loan_facilityType :: Maybe FacilityType+ -- ^ The type of loan facility (letter of credit, revolving, + -- ...).+ , loan_maturity :: Maybe Xsd.Date+ -- ^ The date when the principal amount of the loan becomes due + -- and payable.+ , loan_creditAgreementDate :: Maybe Xsd.Date+ -- ^ The credit agreement date is the closing date (the date + -- where the agreement has been signed) for the loans in the + -- credit agreement. Funding of the facilities occurs on (or + -- sometimes a little after) the Credit Agreement date. This + -- underlyer attribute is used to help identify which of the + -- company's outstanding loans are being referenced by knowing + -- to which credit agreement it belongs. ISDA Standards Terms + -- Supplement term: Date of Original Credit Agreement.+ , loan_tranche :: Maybe UnderlyingAssetTranche+ -- ^ The loan tranche that is subject to the derivative + -- transaction. It will typically be referenced as the + -- Bloomberg tranche number. ISDA Standards Terms Supplement + -- term: Bloomberg Tranche Number.+ }+ deriving (Eq,Show)+instance SchemaType Loan where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Loan a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` many (oneOf' [ ("LegalEntity", fmap OneOf2 (parseSchemaType "borrower"))+ , ("LegalEntityReference", fmap TwoOf2 (parseSchemaType "borrowerReference"))+ ])+ `apply` optional (parseSchemaType "lien")+ `apply` optional (parseSchemaType "facilityType")+ `apply` optional (parseSchemaType "maturity")+ `apply` optional (parseSchemaType "creditAgreementDate")+ `apply` optional (parseSchemaType "tranche")+ schemaTypeToXML s x@Loan{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ loan_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ loan_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ loan_description x+ , maybe [] (schemaTypeToXML "currency") $ loan_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ loan_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ loan_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ loan_definition x+ , concatMap (foldOneOf2 (schemaTypeToXML "borrower")+ (schemaTypeToXML "borrowerReference")+ ) $ loan_choice6 x+ , maybe [] (schemaTypeToXML "lien") $ loan_lien x+ , maybe [] (schemaTypeToXML "facilityType") $ loan_facilityType x+ , maybe [] (schemaTypeToXML "maturity") $ loan_maturity x+ , maybe [] (schemaTypeToXML "creditAgreementDate") $ loan_creditAgreementDate x+ , maybe [] (schemaTypeToXML "tranche") $ loan_tranche x+ ]+instance Extension Loan UnderlyingAsset where+ supertype v = UnderlyingAsset_Loan v+instance Extension Loan IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: Loan -> UnderlyingAsset)+ +instance Extension Loan Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: Loan -> UnderlyingAsset)+ + +-- | A type describing a mortgage asset.+data Mortgage = Mortgage+ { mortgage_ID :: Maybe Xsd.ID+ , mortgage_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , mortgage_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , mortgage_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , mortgage_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , mortgage_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , mortgage_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , mortgage_choice6 :: (Maybe (OneOf2 LegalEntity LegalEntityReference))+ -- ^ Applicable to the case of default swaps on MBS terms. For + -- specifying the insurer name, when applicable (when the + -- element is not present, it signifies that the insurer is + -- Not Applicable)+ -- + -- Choice between:+ -- + -- (1) insurer+ -- + -- (2) insurerReference+ , mortgage_choice7 :: (Maybe (OneOf2 Xsd.XsdString PartyReference))+ -- ^ Specifies the issuer name of a fixed income security or + -- convertible bond. This name can either be explicitly + -- stated, or specified as an href into another element of the + -- document, such as the obligor.+ -- + -- Choice between:+ -- + -- (1) issuerName+ -- + -- (2) issuerPartyReference+ , mortgage_seniority :: Maybe CreditSeniority+ -- ^ The repayment precedence of a debt instrument.+ , mortgage_couponType :: Maybe CouponType+ -- ^ Specifies if the bond has a variable coupon, step-up/down + -- coupon or a zero-coupon.+ , mortgage_couponRate :: Maybe Xsd.Decimal+ -- ^ Specifies the coupon rate (expressed in percentage) of a + -- fixed income security or convertible bond.+ , mortgage_maturity :: Maybe Xsd.Date+ -- ^ The date when the principal amount of a security becomes + -- due and payable.+ , mortgage_paymentFrequency :: Maybe Period+ -- ^ Specifies the frequency at which the bond pays, e.g. 6M.+ , mortgage_dayCountFraction :: Maybe DayCountFraction+ -- ^ The day count basis for the bond.+ , mortgage_originalPrincipalAmount :: Maybe Xsd.Decimal+ -- ^ The initial issued amount of the mortgage obligation.+ , mortgage_pool :: Maybe AssetPool+ -- ^ The morgage pool that is underneath the mortgage + -- obligation.+ , mortgage_sector :: Maybe MortgageSector+ -- ^ The sector classification of the mortgage obligation.+ , mortgage_tranche :: Maybe Xsd.Token+ -- ^ The mortgage obligation tranche that is subject to the + -- derivative transaction.+ }+ deriving (Eq,Show)+instance SchemaType Mortgage where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Mortgage a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` optional (oneOf' [ ("LegalEntity", fmap OneOf2 (parseSchemaType "insurer"))+ , ("LegalEntityReference", fmap TwoOf2 (parseSchemaType "insurerReference"))+ ])+ `apply` optional (oneOf' [ ("Xsd.XsdString", fmap OneOf2 (parseSchemaType "issuerName"))+ , ("PartyReference", fmap TwoOf2 (parseSchemaType "issuerPartyReference"))+ ])+ `apply` optional (parseSchemaType "seniority")+ `apply` optional (parseSchemaType "couponType")+ `apply` optional (parseSchemaType "couponRate")+ `apply` optional (parseSchemaType "maturity")+ `apply` optional (parseSchemaType "paymentFrequency")+ `apply` optional (parseSchemaType "dayCountFraction")+ `apply` optional (parseSchemaType "originalPrincipalAmount")+ `apply` optional (parseSchemaType "pool")+ `apply` optional (parseSchemaType "sector")+ `apply` optional (parseSchemaType "tranche")+ schemaTypeToXML s x@Mortgage{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ mortgage_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ mortgage_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ mortgage_description x+ , maybe [] (schemaTypeToXML "currency") $ mortgage_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ mortgage_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ mortgage_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ mortgage_definition x+ , maybe [] (foldOneOf2 (schemaTypeToXML "insurer")+ (schemaTypeToXML "insurerReference")+ ) $ mortgage_choice6 x+ , maybe [] (foldOneOf2 (schemaTypeToXML "issuerName")+ (schemaTypeToXML "issuerPartyReference")+ ) $ mortgage_choice7 x+ , maybe [] (schemaTypeToXML "seniority") $ mortgage_seniority x+ , maybe [] (schemaTypeToXML "couponType") $ mortgage_couponType x+ , maybe [] (schemaTypeToXML "couponRate") $ mortgage_couponRate x+ , maybe [] (schemaTypeToXML "maturity") $ mortgage_maturity x+ , maybe [] (schemaTypeToXML "paymentFrequency") $ mortgage_paymentFrequency x+ , maybe [] (schemaTypeToXML "dayCountFraction") $ mortgage_dayCountFraction x+ , maybe [] (schemaTypeToXML "originalPrincipalAmount") $ mortgage_originalPrincipalAmount x+ , maybe [] (schemaTypeToXML "pool") $ mortgage_pool x+ , maybe [] (schemaTypeToXML "sector") $ mortgage_sector x+ , maybe [] (schemaTypeToXML "tranche") $ mortgage_tranche x+ ]+instance Extension Mortgage UnderlyingAsset where+ supertype v = UnderlyingAsset_Mortgage v+instance Extension Mortgage IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: Mortgage -> UnderlyingAsset)+ +instance Extension Mortgage Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: Mortgage -> UnderlyingAsset)+ + +-- | A type describing the typology of mortgage obligations.+data MortgageSector = MortgageSector Scheme MortgageSectorAttributes deriving (Eq,Show)+data MortgageSectorAttributes = MortgageSectorAttributes+ { mortgSectorAttrib_mortgageSectorScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MortgageSector where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "mortgageSectorScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MortgageSector v (MortgageSectorAttributes a0)+ schemaTypeToXML s (MortgageSector bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "mortgageSectorScheme") $ mortgSectorAttrib_mortgageSectorScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MortgageSector Scheme where+ supertype (MortgageSector s _) = s+ +data MutualFund = MutualFund+ { mutualFund_ID :: Maybe Xsd.ID+ , mutualFund_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , mutualFund_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , mutualFund_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , mutualFund_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , mutualFund_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , mutualFund_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , mutualFund_openEndedFund :: Maybe Xsd.Boolean+ -- ^ Boolean indicator to specify whether the mutual fund is an + -- open-ended mutual fund.+ , mutualFund_fundManager :: Maybe Xsd.XsdString+ -- ^ Specifies the fund manager that is in charge of the fund.+ }+ deriving (Eq,Show)+instance SchemaType MutualFund where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (MutualFund a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` optional (parseSchemaType "openEndedFund")+ `apply` optional (parseSchemaType "fundManager")+ schemaTypeToXML s x@MutualFund{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ mutualFund_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ mutualFund_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ mutualFund_description x+ , maybe [] (schemaTypeToXML "currency") $ mutualFund_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ mutualFund_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ mutualFund_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ mutualFund_definition x+ , maybe [] (schemaTypeToXML "openEndedFund") $ mutualFund_openEndedFund x+ , maybe [] (schemaTypeToXML "fundManager") $ mutualFund_fundManager x+ ]+instance Extension MutualFund UnderlyingAsset where+ supertype v = UnderlyingAsset_MutualFund v+instance Extension MutualFund IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: MutualFund -> UnderlyingAsset)+ +instance Extension MutualFund Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: MutualFund -> UnderlyingAsset)+ + +-- | A structure representing a pending dividend or coupon +-- payment.+data PendingPayment = PendingPayment+ { pendingPayment_ID :: Maybe Xsd.ID+ , pendingPayment_paymentDate :: Maybe Xsd.Date+ -- ^ The date that the dividend or coupon is due.+ , pendingPayment_amount :: Maybe Money+ -- ^ The amount of the dividend or coupon payment. Value of + -- dividends or coupon between ex and pay date. Stock: if we + -- are between ex-date and pay-date and the dividend is + -- payable under the swap, then this should be the ex-div + -- amount * # of securities. Bond: regardless of where we are + -- vis-a-vis resets: (coupon % * face of bonds on swap * (bond + -- day count fraction using days last coupon pay date of the + -- bond through today).+ , pendingPayment_accruedInterest :: Maybe Money+ -- ^ Accrued interest on the dividend or coupon payment. When + -- the TRS is structured to pay a dividend or coupon on reset + -- after payable date, you may earn interest on these amounts. + -- This field indicates the interest accrued on + -- dividend/coupon from pay date to statement date. This will + -- only apply to a handful of agreements where dividendss are + -- held to the next reset AND you receive/pay interest on + -- unpaid amounts.+ }+ deriving (Eq,Show)+instance SchemaType PendingPayment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PendingPayment a0)+ `apply` optional (parseSchemaType "paymentDate")+ `apply` optional (parseSchemaType "amount")+ `apply` optional (parseSchemaType "accruedInterest")+ schemaTypeToXML s x@PendingPayment{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ pendingPayment_ID x+ ]+ [ maybe [] (schemaTypeToXML "paymentDate") $ pendingPayment_paymentDate x+ , maybe [] (schemaTypeToXML "amount") $ pendingPayment_amount x+ , maybe [] (schemaTypeToXML "accruedInterest") $ pendingPayment_accruedInterest x+ ]+instance Extension PendingPayment PaymentBase where+ supertype v = PaymentBase_PendingPayment v+ +-- | A type describing the strike price.+data Price = Price+ { price_commission :: Maybe Commission+ -- ^ This optional component specifies the commission to be + -- charged for executing the hedge transactions.+ , price_choice1 :: OneOf3 (DeterminationMethod,(Maybe (ActualPrice)),(Maybe (ActualPrice)),(Maybe (Xsd.Decimal)),(Maybe (FxConversion))) AmountReference ((Maybe (ActualPrice)),(Maybe (ActualPrice)),(Maybe (Xsd.Decimal)),(Maybe (FxConversion)))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * Specifies the method according to which an amount + -- or a date is determined.+ -- + -- * Specifies the price of the underlyer, before + -- commissions.+ -- + -- * Specifies the price of the underlyer, net of + -- commissions.+ -- + -- * Specifies the accrued interest that are part of the + -- dirty price in the case of a fixed income security + -- or a convertible bond. Expressed in percentage of + -- the notional.+ -- + -- * Specifies the currency conversion rate that applies + -- to an amount. This rate can either be defined + -- elsewhere in the document (case of a quanto swap), + -- or explicitly described through this component.+ -- + -- (2) The href attribute value will be a pointer style + -- reference to the element or component elsewhere in the + -- document where the anchor amount is defined.+ -- + -- (3) Sequence of:+ -- + -- * Specifies the price of the underlyer, before + -- commissions.+ -- + -- * Specifies the price of the underlyer, net of + -- commissions.+ -- + -- * Specifies the accrued interest that are part of the + -- dirty price in the case of a fixed income security + -- or a convertible bond. Expressed in percentage of + -- the notional.+ -- + -- * Specifies the currency conversion rate that applies + -- to an amount. This rate can either be defined + -- elsewhere in the document (case of a quanto swap), + -- or explicitly described through this component.+ , price_cleanNetPrice :: Maybe Xsd.Decimal+ -- ^ The net price excluding accrued interest. The "Dirty Price" + -- for bonds is put in the "netPrice" element, which includes + -- accrued interest. Thus netPrice - cleanNetPrice = + -- accruedInterest. The currency and price expression for this + -- field are the same as those for the (dirty) netPrice.+ , price_quotationCharacteristics :: Maybe QuotationCharacteristics+ -- ^ Allows information about how the price was quoted to be + -- provided.+ }+ deriving (Eq,Show)+instance SchemaType Price where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Price+ `apply` optional (parseSchemaType "commission")+ `apply` oneOf' [ ("DeterminationMethod Maybe ActualPrice Maybe ActualPrice Maybe Xsd.Decimal Maybe FxConversion", fmap OneOf3 (return (,,,,) `apply` parseSchemaType "determinationMethod"+ `apply` optional (parseSchemaType "grossPrice")+ `apply` optional (parseSchemaType "netPrice")+ `apply` optional (parseSchemaType "accruedInterestPrice")+ `apply` optional (parseSchemaType "fxConversion")))+ , ("AmountReference", fmap TwoOf3 (parseSchemaType "amountRelativeTo"))+ , ("Maybe ActualPrice Maybe ActualPrice Maybe Xsd.Decimal Maybe FxConversion", fmap ThreeOf3 (return (,,,) `apply` optional (parseSchemaType "grossPrice")+ `apply` optional (parseSchemaType "netPrice")+ `apply` optional (parseSchemaType "accruedInterestPrice")+ `apply` optional (parseSchemaType "fxConversion")))+ ]+ `apply` optional (parseSchemaType "cleanNetPrice")+ `apply` optional (parseSchemaType "quotationCharacteristics")+ schemaTypeToXML s x@Price{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "commission") $ price_commission x+ , foldOneOf3 (\ (a,b,c,d,e) -> concat [ schemaTypeToXML "determinationMethod" a+ , maybe [] (schemaTypeToXML "grossPrice") b+ , maybe [] (schemaTypeToXML "netPrice") c+ , maybe [] (schemaTypeToXML "accruedInterestPrice") d+ , maybe [] (schemaTypeToXML "fxConversion") e+ ])+ (schemaTypeToXML "amountRelativeTo")+ (\ (a,b,c,d) -> concat [ maybe [] (schemaTypeToXML "grossPrice") a+ , maybe [] (schemaTypeToXML "netPrice") b+ , maybe [] (schemaTypeToXML "accruedInterestPrice") c+ , maybe [] (schemaTypeToXML "fxConversion") d+ ])+ $ price_choice1 x+ , maybe [] (schemaTypeToXML "cleanNetPrice") $ price_cleanNetPrice x+ , maybe [] (schemaTypeToXML "quotationCharacteristics") $ price_quotationCharacteristics x+ ]+ +-- | The units in which a price is quoted.+data PriceQuoteUnits = PriceQuoteUnits Scheme PriceQuoteUnitsAttributes deriving (Eq,Show)+data PriceQuoteUnitsAttributes = PriceQuoteUnitsAttributes+ { priceQuoteUnitsAttrib_priceQuoteUnitsScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType PriceQuoteUnits where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "priceQuoteUnitsScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ PriceQuoteUnits v (PriceQuoteUnitsAttributes a0)+ schemaTypeToXML s (PriceQuoteUnits bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "priceQuoteUnitsScheme") $ priceQuoteUnitsAttrib_priceQuoteUnitsScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension PriceQuoteUnits Scheme where+ supertype (PriceQuoteUnits s _) = s+ +data QuantityUnit = QuantityUnit Scheme QuantityUnitAttributes deriving (Eq,Show)+data QuantityUnitAttributes = QuantityUnitAttributes+ { quantUnitAttrib_quantityUnitScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType QuantityUnit where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "quantityUnitScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ QuantityUnit v (QuantityUnitAttributes a0)+ schemaTypeToXML s (QuantityUnit bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "quantityUnitScheme") $ quantUnitAttrib_quantityUnitScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension QuantityUnit Scheme where+ supertype (QuantityUnit s _) = s+ +-- | A type representing a set of characteristics that describe +-- a quotation.+data QuotationCharacteristics = QuotationCharacteristics+ { quotChar_measureType :: Maybe AssetMeasureType+ -- ^ The type of the value that is measured. This could be an + -- NPV, a cash flow, a clean price, etc.+ , quotChar_quoteUnits :: Maybe PriceQuoteUnits+ -- ^ The optional units that the measure is expressed in. If not + -- supplied, this is assumed to be a price/value in currency + -- units.+ , quotChar_side :: Maybe QuotationSideEnum+ -- ^ The side (bid/mid/ask) of the measure.+ , quotChar_currency :: Maybe Currency+ -- ^ The optional currency that the measure is expressed in. If + -- not supplied, this is defaulted from the reportingCurrency + -- in the valuationScenarioDefinition.+ , quotChar_currencyType :: Maybe ReportingCurrencyType+ -- ^ The optional currency that the measure is expressed in. If + -- not supplied, this is defaulted from the reportingCurrency + -- in the valuationScenarioDefinition.+ , quotChar_timing :: Maybe QuoteTiming+ -- ^ When during a day the quote is for. Typically, if this + -- element is supplied, the QuoteLocation needs also to be + -- supplied.+ , quotChar_choice6 :: (Maybe (OneOf2 BusinessCenter ExchangeId))+ -- ^ Choice between:+ -- + -- (1) A city or other business center.+ -- + -- (2) The exchange (e.g. stock or futures exchange) from + -- which the quote is obtained.+ , quotChar_informationSource :: [InformationSource]+ -- ^ The information source where a published or displayed + -- market rate will be obtained, e.g. Telerate Page 3750.+ , quotChar_pricingModel :: Maybe PricingModel+ -- ^ .+ , quotChar_time :: Maybe Xsd.DateTime+ -- ^ When the quote was observed or derived.+ , quotChar_valuationDate :: Maybe Xsd.Date+ -- ^ When the quote was computed.+ , quotChar_expiryTime :: Maybe Xsd.DateTime+ -- ^ When does the quote cease to be valid.+ , quotChar_cashflowType :: Maybe CashflowType+ -- ^ For cash flows, the type of the cash flows. Examples + -- include: Coupon payment, Premium Fee, Settlement Fee, + -- Brokerage Fee, etc.+ }+ deriving (Eq,Show)+instance SchemaType QuotationCharacteristics where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return QuotationCharacteristics+ `apply` optional (parseSchemaType "measureType")+ `apply` optional (parseSchemaType "quoteUnits")+ `apply` optional (parseSchemaType "side")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "currencyType")+ `apply` optional (parseSchemaType "timing")+ `apply` optional (oneOf' [ ("BusinessCenter", fmap OneOf2 (parseSchemaType "businessCenter"))+ , ("ExchangeId", fmap TwoOf2 (parseSchemaType "exchangeId"))+ ])+ `apply` many (parseSchemaType "informationSource")+ `apply` optional (parseSchemaType "pricingModel")+ `apply` optional (parseSchemaType "time")+ `apply` optional (parseSchemaType "valuationDate")+ `apply` optional (parseSchemaType "expiryTime")+ `apply` optional (parseSchemaType "cashflowType")+ schemaTypeToXML s x@QuotationCharacteristics{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "measureType") $ quotChar_measureType x+ , maybe [] (schemaTypeToXML "quoteUnits") $ quotChar_quoteUnits x+ , maybe [] (schemaTypeToXML "side") $ quotChar_side x+ , maybe [] (schemaTypeToXML "currency") $ quotChar_currency x+ , maybe [] (schemaTypeToXML "currencyType") $ quotChar_currencyType x+ , maybe [] (schemaTypeToXML "timing") $ quotChar_timing x+ , maybe [] (foldOneOf2 (schemaTypeToXML "businessCenter")+ (schemaTypeToXML "exchangeId")+ ) $ quotChar_choice6 x+ , concatMap (schemaTypeToXML "informationSource") $ quotChar_informationSource x+ , maybe [] (schemaTypeToXML "pricingModel") $ quotChar_pricingModel x+ , maybe [] (schemaTypeToXML "time") $ quotChar_time x+ , maybe [] (schemaTypeToXML "valuationDate") $ quotChar_valuationDate x+ , maybe [] (schemaTypeToXML "expiryTime") $ quotChar_expiryTime x+ , maybe [] (schemaTypeToXML "cashflowType") $ quotChar_cashflowType x+ ]+ +-- | The type of the time of the quote.+data QuoteTiming = QuoteTiming Scheme QuoteTimingAttributes deriving (Eq,Show)+data QuoteTimingAttributes = QuoteTimingAttributes+ { quoteTimingAttrib_quoteTimingScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType QuoteTiming where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "quoteTimingScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ QuoteTiming v (QuoteTimingAttributes a0)+ schemaTypeToXML s (QuoteTiming bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "quoteTimingScheme") $ quoteTimingAttrib_quoteTimingScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension QuoteTiming Scheme where+ supertype (QuoteTiming s _) = s+ +data RateIndex = RateIndex+ { rateIndex_ID :: Maybe Xsd.ID+ , rateIndex_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , rateIndex_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , rateIndex_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , rateIndex_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , rateIndex_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , rateIndex_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , rateIndex_floatingRateIndex :: Maybe FloatingRateIndex+ , rateIndex_term :: Maybe Period+ -- ^ Specifies the term of the simple swap, e.g. 5Y.+ , rateIndex_paymentFrequency :: Maybe Period+ -- ^ Specifies the frequency at which the index pays, e.g. 6M.+ , rateIndex_dayCountFraction :: Maybe DayCountFraction+ -- ^ The day count basis for the index.+ }+ deriving (Eq,Show)+instance SchemaType RateIndex where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (RateIndex a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` optional (parseSchemaType "floatingRateIndex")+ `apply` optional (parseSchemaType "term")+ `apply` optional (parseSchemaType "paymentFrequency")+ `apply` optional (parseSchemaType "dayCountFraction")+ schemaTypeToXML s x@RateIndex{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ rateIndex_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ rateIndex_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ rateIndex_description x+ , maybe [] (schemaTypeToXML "currency") $ rateIndex_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ rateIndex_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ rateIndex_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ rateIndex_definition x+ , maybe [] (schemaTypeToXML "floatingRateIndex") $ rateIndex_floatingRateIndex x+ , maybe [] (schemaTypeToXML "term") $ rateIndex_term x+ , maybe [] (schemaTypeToXML "paymentFrequency") $ rateIndex_paymentFrequency x+ , maybe [] (schemaTypeToXML "dayCountFraction") $ rateIndex_dayCountFraction x+ ]+instance Extension RateIndex UnderlyingAsset where+ supertype v = UnderlyingAsset_RateIndex v+instance Extension RateIndex IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: RateIndex -> UnderlyingAsset)+ +instance Extension RateIndex Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: RateIndex -> UnderlyingAsset)+ + +-- | A scheme identifying the type of currency that was used to +-- report the value of an asset. For example, this could +-- contain values like SettlementCurrency, QuoteCurrency, +-- UnitCurrency, etc.+data ReportingCurrencyType = ReportingCurrencyType Scheme ReportingCurrencyTypeAttributes deriving (Eq,Show)+data ReportingCurrencyTypeAttributes = ReportingCurrencyTypeAttributes+ { reportCurrenTypeAttrib_reportingCurrencyTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ReportingCurrencyType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "reportingCurrencyTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ReportingCurrencyType v (ReportingCurrencyTypeAttributes a0)+ schemaTypeToXML s (ReportingCurrencyType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "reportingCurrencyTypeScheme") $ reportCurrenTypeAttrib_reportingCurrencyTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ReportingCurrencyType Scheme where+ supertype (ReportingCurrencyType s _) = s+ +data SimpleCreditDefaultSwap = SimpleCreditDefaultSwap+ { simpleCreditDefaultSwap_ID :: Maybe Xsd.ID+ , simpleCreditDefaultSwap_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , simpleCreditDefaultSwap_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , simpleCreditDefaultSwap_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , simpleCreditDefaultSwap_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , simpleCreditDefaultSwap_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , simpleCreditDefaultSwap_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , simpleCreditDefaultSwap_choice6 :: (Maybe (OneOf2 LegalEntity LegalEntityReference))+ -- ^ Choice between:+ -- + -- (1) The entity for which this is defined.+ -- + -- (2) An XML reference a credit entity defined elsewhere in + -- the document.+ , simpleCreditDefaultSwap_term :: Maybe Period+ -- ^ Specifies the term of the simple CD swap, e.g. 5Y.+ , simpleCreditDefaultSwap_paymentFrequency :: Maybe Period+ -- ^ Specifies the frequency at which the swap pays, e.g. 6M.+ }+ deriving (Eq,Show)+instance SchemaType SimpleCreditDefaultSwap where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (SimpleCreditDefaultSwap a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` optional (oneOf' [ ("LegalEntity", fmap OneOf2 (parseSchemaType "referenceEntity"))+ , ("LegalEntityReference", fmap TwoOf2 (parseSchemaType "creditEntityReference"))+ ])+ `apply` optional (parseSchemaType "term")+ `apply` optional (parseSchemaType "paymentFrequency")+ schemaTypeToXML s x@SimpleCreditDefaultSwap{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ simpleCreditDefaultSwap_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ simpleCreditDefaultSwap_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ simpleCreditDefaultSwap_description x+ , maybe [] (schemaTypeToXML "currency") $ simpleCreditDefaultSwap_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ simpleCreditDefaultSwap_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ simpleCreditDefaultSwap_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ simpleCreditDefaultSwap_definition x+ , maybe [] (foldOneOf2 (schemaTypeToXML "referenceEntity")+ (schemaTypeToXML "creditEntityReference")+ ) $ simpleCreditDefaultSwap_choice6 x+ , maybe [] (schemaTypeToXML "term") $ simpleCreditDefaultSwap_term x+ , maybe [] (schemaTypeToXML "paymentFrequency") $ simpleCreditDefaultSwap_paymentFrequency x+ ]+instance Extension SimpleCreditDefaultSwap UnderlyingAsset where+ supertype v = UnderlyingAsset_SimpleCreditDefaultSwap v+instance Extension SimpleCreditDefaultSwap IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: SimpleCreditDefaultSwap -> UnderlyingAsset)+ +instance Extension SimpleCreditDefaultSwap Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: SimpleCreditDefaultSwap -> UnderlyingAsset)+ + +data SimpleFra = SimpleFra+ { simpleFra_ID :: Maybe Xsd.ID+ , simpleFra_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , simpleFra_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , simpleFra_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , simpleFra_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , simpleFra_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , simpleFra_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , simpleFra_startTerm :: Maybe Period+ -- ^ Specifies the start term of the simple fra, e.g. 3M.+ , simpleFra_endTerm :: Maybe Period+ -- ^ Specifies the end term of the simple fra, e.g. 9M.+ , simpleFra_dayCountFraction :: Maybe DayCountFraction+ -- ^ The day count basis for the FRA.+ }+ deriving (Eq,Show)+instance SchemaType SimpleFra where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (SimpleFra a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` optional (parseSchemaType "startTerm")+ `apply` optional (parseSchemaType "endTerm")+ `apply` optional (parseSchemaType "dayCountFraction")+ schemaTypeToXML s x@SimpleFra{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ simpleFra_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ simpleFra_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ simpleFra_description x+ , maybe [] (schemaTypeToXML "currency") $ simpleFra_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ simpleFra_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ simpleFra_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ simpleFra_definition x+ , maybe [] (schemaTypeToXML "startTerm") $ simpleFra_startTerm x+ , maybe [] (schemaTypeToXML "endTerm") $ simpleFra_endTerm x+ , maybe [] (schemaTypeToXML "dayCountFraction") $ simpleFra_dayCountFraction x+ ]+instance Extension SimpleFra UnderlyingAsset where+ supertype v = UnderlyingAsset_SimpleFra v+instance Extension SimpleFra IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: SimpleFra -> UnderlyingAsset)+ +instance Extension SimpleFra Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: SimpleFra -> UnderlyingAsset)+ + +data SimpleIRSwap = SimpleIRSwap+ { simpleIRSwap_ID :: Maybe Xsd.ID+ , simpleIRSwap_instrumentId :: [InstrumentId]+ -- ^ Identification of the underlying asset, using public and/or + -- private identifiers.+ , simpleIRSwap_description :: Maybe Xsd.XsdString+ -- ^ Long name of the underlying asset.+ , simpleIRSwap_currency :: Maybe IdentifiedCurrency+ -- ^ Trading currency of the underlyer when transacted as a cash + -- instrument.+ , simpleIRSwap_exchangeId :: Maybe ExchangeId+ -- ^ Identification of the exchange on which this asset is + -- transacted for the purposes of calculating a contractural + -- payoff. The term "Exchange" is assumed to have the meaning + -- as defined in the ISDA 2002 Equity Derivatives Definitions.+ , simpleIRSwap_clearanceSystem :: Maybe ClearanceSystem+ -- ^ Identification of the clearance system associated with the + -- transaction exchange.+ , simpleIRSwap_definition :: Maybe ProductReference+ -- ^ An optional reference to a full FpML product that defines + -- the simple product in greater detail. In case of + -- inconsistency between the terms of the simple product and + -- those of the detailed definition, the values in the simple + -- product override those in the detailed definition.+ , simpleIRSwap_term :: Maybe Period+ -- ^ Specifies the term of the simple swap, e.g. 5Y.+ , simpleIRSwap_paymentFrequency :: Maybe Period+ -- ^ Specifies the frequency at which the swap pays, e.g. 6M.+ , simpleIRSwap_dayCountFraction :: Maybe DayCountFraction+ -- ^ The day count basis for the swap.+ }+ deriving (Eq,Show)+instance SchemaType SimpleIRSwap where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (SimpleIRSwap a0)+ `apply` many (parseSchemaType "instrumentId")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "exchangeId")+ `apply` optional (parseSchemaType "clearanceSystem")+ `apply` optional (parseSchemaType "definition")+ `apply` optional (parseSchemaType "term")+ `apply` optional (parseSchemaType "paymentFrequency")+ `apply` optional (parseSchemaType "dayCountFraction")+ schemaTypeToXML s x@SimpleIRSwap{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ simpleIRSwap_ID x+ ]+ [ concatMap (schemaTypeToXML "instrumentId") $ simpleIRSwap_instrumentId x+ , maybe [] (schemaTypeToXML "description") $ simpleIRSwap_description x+ , maybe [] (schemaTypeToXML "currency") $ simpleIRSwap_currency x+ , maybe [] (schemaTypeToXML "exchangeId") $ simpleIRSwap_exchangeId x+ , maybe [] (schemaTypeToXML "clearanceSystem") $ simpleIRSwap_clearanceSystem x+ , maybe [] (schemaTypeToXML "definition") $ simpleIRSwap_definition x+ , maybe [] (schemaTypeToXML "term") $ simpleIRSwap_term x+ , maybe [] (schemaTypeToXML "paymentFrequency") $ simpleIRSwap_paymentFrequency x+ , maybe [] (schemaTypeToXML "dayCountFraction") $ simpleIRSwap_dayCountFraction x+ ]+instance Extension SimpleIRSwap UnderlyingAsset where+ supertype v = UnderlyingAsset_SimpleIRSwap v+instance Extension SimpleIRSwap IdentifiedAsset where+ supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: SimpleIRSwap -> UnderlyingAsset)+ +instance Extension SimpleIRSwap Asset where+ supertype = (supertype :: IdentifiedAsset -> Asset)+ . (supertype :: UnderlyingAsset -> IdentifiedAsset)+ . (supertype :: SimpleIRSwap -> UnderlyingAsset)+ + +-- | A type describing a single underlyer+data SingleUnderlyer = SingleUnderlyer+ { singleUnderly_underlyingAsset :: Maybe Asset+ -- ^ Define the underlying asset, either a listed security or + -- other instrument.+ , singleUnderly_openUnits :: Maybe Xsd.Decimal+ -- ^ The number of units (index or securities) that constitute + -- the underlyer of the swap. In the case of a basket swap, + -- this element is used to reference both the number of basket + -- units, and the number of each asset components of the + -- basket when these are expressed in absolute terms.+ , singleUnderly_dividendPayout :: Maybe DividendPayout+ -- ^ Specifies the dividend payout ratio associated with an + -- equity underlyer. A basket swap can have different payout + -- ratios across the various underlying constituents. In + -- certain cases the actual ratio is not known on trade + -- inception, and only general conditions are then specified. + -- Users should note that FpML makes a distinction between the + -- derivative contract and the underlyer of the contract. It + -- would be better if the agreed dividend payout on a + -- derivative contract was modelled at the level of the + -- derivative contract, an approach which may be adopted in + -- the next major version of FpML.+ , singleUnderly_couponPayment :: Maybe PendingPayment+ -- ^ The next upcoming coupon payment.+ , singleUnderly_averageDailyTradingVolume :: Maybe AverageDailyTradingVolumeLimit+ -- ^ The average amount of individual securities traded in a day + -- or over a specified amount of time.+ , singleUnderly_depositoryReceipt :: Maybe Xsd.Boolean+ -- ^ A Depository Receipt is a negotiable certificate issued by + -- a trust company or security depository. This element is + -- used to represent whether a Depository Receipt is + -- applicable or not to the underlyer.+ }+ deriving (Eq,Show)+instance SchemaType SingleUnderlyer where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SingleUnderlyer+ `apply` optional (elementUnderlyingAsset)+ `apply` optional (parseSchemaType "openUnits")+ `apply` optional (parseSchemaType "dividendPayout")+ `apply` optional (parseSchemaType "couponPayment")+ `apply` optional (parseSchemaType "averageDailyTradingVolume")+ `apply` optional (parseSchemaType "depositoryReceipt")+ schemaTypeToXML s x@SingleUnderlyer{} =+ toXMLElement s []+ [ maybe [] (elementToXMLUnderlyingAsset) $ singleUnderly_underlyingAsset x+ , maybe [] (schemaTypeToXML "openUnits") $ singleUnderly_openUnits x+ , maybe [] (schemaTypeToXML "dividendPayout") $ singleUnderly_dividendPayout x+ , maybe [] (schemaTypeToXML "couponPayment") $ singleUnderly_couponPayment x+ , maybe [] (schemaTypeToXML "averageDailyTradingVolume") $ singleUnderly_averageDailyTradingVolume x+ , maybe [] (schemaTypeToXML "depositoryReceipt") $ singleUnderly_depositoryReceipt x+ ]+ +-- | Defines an identifier for a specific location or region +-- which translates into a combination of rules for +-- calculating the UTC offset.+data TimeZone = TimeZone Scheme TimeZoneAttributes deriving (Eq,Show)+data TimeZoneAttributes = TimeZoneAttributes+ { timeZoneAttrib_timeZoneScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType TimeZone where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "timeZoneScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ TimeZone v (TimeZoneAttributes a0)+ schemaTypeToXML s (TimeZone bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "timeZoneScheme") $ timeZoneAttrib_timeZoneScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension TimeZone Scheme where+ supertype (TimeZone s _) = s+ +-- | A type describing the whole set of possible underlyers: +-- single underlyers or multiple underlyers, each of these +-- having either security or index components.+data Underlyer = Underlyer+ { underlyer_choice0 :: (Maybe (OneOf2 SingleUnderlyer Basket))+ -- ^ Choice between:+ -- + -- (1) Describes the swap's underlyer when it has only one + -- asset component.+ -- + -- (2) Describes the swap's underlyer when it has multiple + -- asset components.+ }+ deriving (Eq,Show)+instance SchemaType Underlyer where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Underlyer+ `apply` optional (oneOf' [ ("SingleUnderlyer", fmap OneOf2 (parseSchemaType "singleUnderlyer"))+ , ("Basket", fmap TwoOf2 (parseSchemaType "basket"))+ ])+ schemaTypeToXML s x@Underlyer{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "singleUnderlyer")+ (schemaTypeToXML "basket")+ ) $ underlyer_choice0 x+ ]+ +-- | Abstract base class for all underlying assets.+data UnderlyingAsset+ = UnderlyingAsset_SimpleIRSwap SimpleIRSwap+ | UnderlyingAsset_SimpleFra SimpleFra+ | UnderlyingAsset_SimpleCreditDefaultSwap SimpleCreditDefaultSwap+ | UnderlyingAsset_RateIndex RateIndex+ | UnderlyingAsset_MutualFund MutualFund+ | UnderlyingAsset_Mortgage Mortgage+ | UnderlyingAsset_Loan Loan+ | UnderlyingAsset_FxRateAsset FxRateAsset+ | UnderlyingAsset_ExchangeTraded ExchangeTraded+ | UnderlyingAsset_Deposit Deposit+ | UnderlyingAsset_Bond Bond+ + deriving (Eq,Show)+instance SchemaType UnderlyingAsset where+ parseSchemaType s = do+ (fmap UnderlyingAsset_SimpleIRSwap $ parseSchemaType s)+ `onFail`+ (fmap UnderlyingAsset_SimpleFra $ parseSchemaType s)+ `onFail`+ (fmap UnderlyingAsset_SimpleCreditDefaultSwap $ parseSchemaType s)+ `onFail`+ (fmap UnderlyingAsset_RateIndex $ parseSchemaType s)+ `onFail`+ (fmap UnderlyingAsset_MutualFund $ parseSchemaType s)+ `onFail`+ (fmap UnderlyingAsset_Mortgage $ parseSchemaType s)+ `onFail`+ (fmap UnderlyingAsset_Loan $ parseSchemaType s)+ `onFail`+ (fmap UnderlyingAsset_FxRateAsset $ parseSchemaType s)+ `onFail`+ (fmap UnderlyingAsset_ExchangeTraded $ parseSchemaType s)+ `onFail`+ (fmap UnderlyingAsset_Deposit $ parseSchemaType s)+ `onFail`+ (fmap UnderlyingAsset_Bond $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of UnderlyingAsset,\n\+\ namely one of:\n\+\SimpleIRSwap,SimpleFra,SimpleCreditDefaultSwap,RateIndex,MutualFund,Mortgage,Loan,FxRateAsset,ExchangeTraded,Deposit,Bond"+ schemaTypeToXML _s (UnderlyingAsset_SimpleIRSwap x) = schemaTypeToXML "simpleIRSwap" x+ schemaTypeToXML _s (UnderlyingAsset_SimpleFra x) = schemaTypeToXML "simpleFra" x+ schemaTypeToXML _s (UnderlyingAsset_SimpleCreditDefaultSwap x) = schemaTypeToXML "simpleCreditDefaultSwap" x+ schemaTypeToXML _s (UnderlyingAsset_RateIndex x) = schemaTypeToXML "rateIndex" x+ schemaTypeToXML _s (UnderlyingAsset_MutualFund x) = schemaTypeToXML "mutualFund" x+ schemaTypeToXML _s (UnderlyingAsset_Mortgage x) = schemaTypeToXML "mortgage" x+ schemaTypeToXML _s (UnderlyingAsset_Loan x) = schemaTypeToXML "loan" x+ schemaTypeToXML _s (UnderlyingAsset_FxRateAsset x) = schemaTypeToXML "fxRateAsset" x+ schemaTypeToXML _s (UnderlyingAsset_ExchangeTraded x) = schemaTypeToXML "exchangeTraded" x+ schemaTypeToXML _s (UnderlyingAsset_Deposit x) = schemaTypeToXML "deposit" x+ schemaTypeToXML _s (UnderlyingAsset_Bond x) = schemaTypeToXML "bond" x+instance Extension UnderlyingAsset IdentifiedAsset where+ supertype v = IdentifiedAsset_UnderlyingAsset v+ +data UnderlyingAssetTranche = UnderlyingAssetTranche Scheme UnderlyingAssetTrancheAttributes deriving (Eq,Show)+data UnderlyingAssetTrancheAttributes = UnderlyingAssetTrancheAttributes+ { underlyAssetTrancheAttrib_loanTrancheScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType UnderlyingAssetTranche where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "loanTrancheScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ UnderlyingAssetTranche v (UnderlyingAssetTrancheAttributes a0)+ schemaTypeToXML s (UnderlyingAssetTranche bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "loanTrancheScheme") $ underlyAssetTrancheAttrib_loanTrancheScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension UnderlyingAssetTranche Scheme where+ supertype (UnderlyingAssetTranche s _) = s+ +-- | Defines the underlying asset when it is a basket.+elementBasket :: XMLParser Basket+elementBasket = parseSchemaType "basket"+elementToXMLBasket :: Basket -> [Content ()]+elementToXMLBasket = schemaTypeToXML "basket"+ +-- | Identifies the underlying asset when it is a series or a +-- class of bonds.+elementBond :: XMLParser Bond+elementBond = parseSchemaType "bond"+elementToXMLBond :: Bond -> [Content ()]+elementToXMLBond = schemaTypeToXML "bond"+ +-- | Identifies a simple underlying asset type that is a cash +-- payment. Used for specifying discounting factors for future +-- cash flows in the pricing and risk model.+elementCash :: XMLParser Cash+elementCash = parseSchemaType "cash"+elementToXMLCash :: Cash -> [Content ()]+elementToXMLCash = schemaTypeToXML "cash"+ +-- | Identifies the underlying asset when it is a listed +-- commodity.+elementCommodity :: XMLParser Commodity+elementCommodity = parseSchemaType "commodity"+elementToXMLCommodity :: Commodity -> [Content ()]+elementToXMLCommodity = schemaTypeToXML "commodity"+ +-- | Identifies the underlying asset when it is a convertible +-- bond.+elementConvertibleBond :: XMLParser ConvertibleBond+elementConvertibleBond = parseSchemaType "convertibleBond"+elementToXMLConvertibleBond :: ConvertibleBond -> [Content ()]+elementToXMLConvertibleBond = schemaTypeToXML "convertibleBond"+ +-- | Defines the underlying asset when it is a curve instrument.+elementCurveInstrument :: XMLParser Asset+elementCurveInstrument = fmap supertype elementSimpleIrSwap+ `onFail`+ fmap supertype elementSimpleFra+ `onFail`+ fmap supertype elementSimpleCreditDefaultSwap+ `onFail`+ fmap supertype elementRateIndex+ `onFail`+ fmap supertype elementFx+ `onFail`+ fmap supertype elementDeposit+ `onFail` fail "Parse failed when expecting an element in the substitution group for\n\+\ <curveInstrument>,\n\+\ namely one of:\n\+\<simpleIrSwap>, <simpleFra>, <simpleCreditDefaultSwap>, <rateIndex>, <fx>, <deposit>"+elementToXMLCurveInstrument :: Asset -> [Content ()]+elementToXMLCurveInstrument = schemaTypeToXML "curveInstrument"+ +-- | Identifies a simple underlying asset that is a term +-- deposit.+elementDeposit :: XMLParser Deposit+elementDeposit = parseSchemaType "deposit"+elementToXMLDeposit :: Deposit -> [Content ()]+elementToXMLDeposit = schemaTypeToXML "deposit"+ +-- | Identifies the underlying asset when it is a listed equity.+elementEquity :: XMLParser EquityAsset+elementEquity = parseSchemaType "equity"+elementToXMLEquity :: EquityAsset -> [Content ()]+elementToXMLEquity = schemaTypeToXML "equity"+ +-- | Identifies the underlying asset when it is an +-- exchange-traded fund.+elementExchangeTradedFund :: XMLParser ExchangeTradedFund+elementExchangeTradedFund = parseSchemaType "exchangeTradedFund"+elementToXMLExchangeTradedFund :: ExchangeTradedFund -> [Content ()]+elementToXMLExchangeTradedFund = schemaTypeToXML "exchangeTradedFund"+ +-- | Identifies the underlying asset when it is a listed future +-- contract.+elementFuture :: XMLParser Future+elementFuture = parseSchemaType "future"+elementToXMLFuture :: Future -> [Content ()]+elementToXMLFuture = schemaTypeToXML "future"+ +-- | Identifies a simple underlying asset type that is an FX +-- rate. Used for specifying FX rates in the pricing and risk +-- model.+elementFx :: XMLParser FxRateAsset+elementFx = parseSchemaType "fx"+elementToXMLFx :: FxRateAsset -> [Content ()]+elementToXMLFx = schemaTypeToXML "fx"+ +-- | Identifies the underlying asset when it is a financial +-- index.+elementIndex :: XMLParser Index+elementIndex = parseSchemaType "index"+elementToXMLIndex :: Index -> [Content ()]+elementToXMLIndex = schemaTypeToXML "index"+ +-- | Identifies a simple underlying asset that is a loan.+elementLoan :: XMLParser Loan+elementLoan = parseSchemaType "loan"+elementToXMLLoan :: Loan -> [Content ()]+elementToXMLLoan = schemaTypeToXML "loan"+ +-- | Identifies a mortgage backed security.+elementMortgage :: XMLParser Mortgage+elementMortgage = parseSchemaType "mortgage"+elementToXMLMortgage :: Mortgage -> [Content ()]+elementToXMLMortgage = schemaTypeToXML "mortgage"+ +-- | Identifies the class of unit issued by a fund.+elementMutualFund :: XMLParser MutualFund+elementMutualFund = parseSchemaType "mutualFund"+elementToXMLMutualFund :: MutualFund -> [Content ()]+elementToXMLMutualFund = schemaTypeToXML "mutualFund"+ +-- | Identifies a simple underlying asset that is an interest +-- rate index. Used for specifying benchmark assets in the +-- market environment in the pricing and risk model.+elementRateIndex :: XMLParser RateIndex+elementRateIndex = parseSchemaType "rateIndex"+elementToXMLRateIndex :: RateIndex -> [Content ()]+elementToXMLRateIndex = schemaTypeToXML "rateIndex"+ +-- | Identifies a simple underlying asset that is a credit +-- default swap.+elementSimpleCreditDefaultSwap :: XMLParser SimpleCreditDefaultSwap+elementSimpleCreditDefaultSwap = parseSchemaType "simpleCreditDefaultSwap"+elementToXMLSimpleCreditDefaultSwap :: SimpleCreditDefaultSwap -> [Content ()]+elementToXMLSimpleCreditDefaultSwap = schemaTypeToXML "simpleCreditDefaultSwap"+ +-- | Identifies a simple underlying asset that is a forward rate +-- agreement.+elementSimpleFra :: XMLParser SimpleFra+elementSimpleFra = parseSchemaType "simpleFra"+elementToXMLSimpleFra :: SimpleFra -> [Content ()]+elementToXMLSimpleFra = schemaTypeToXML "simpleFra"+ +-- | Identifies a simple underlying asset that is a swap.+elementSimpleIrSwap :: XMLParser SimpleIRSwap+elementSimpleIrSwap = parseSchemaType "simpleIrSwap"+elementToXMLSimpleIrSwap :: SimpleIRSwap -> [Content ()]+elementToXMLSimpleIrSwap = schemaTypeToXML "simpleIrSwap"+ +-- | Define the underlying asset, either a listed security or +-- other instrument.+elementUnderlyingAsset :: XMLParser Asset+elementUnderlyingAsset = fmap supertype elementMutualFund+ `onFail`+ fmap supertype elementMortgage+ `onFail`+ fmap supertype elementLoan+ `onFail`+ fmap supertype elementIndex+ `onFail`+ fmap supertype elementFuture+ `onFail`+ fmap supertype elementExchangeTradedFund+ `onFail`+ fmap supertype elementEquity+ `onFail`+ fmap supertype elementConvertibleBond+ `onFail`+ fmap supertype elementCommodity+ `onFail`+ fmap supertype elementCash+ `onFail`+ fmap supertype elementBond+ `onFail`+ fmap supertype elementBasket+ `onFail` fail "Parse failed when expecting an element in the substitution group for\n\+\ <underlyingAsset>,\n\+\ namely one of:\n\+\<mutualFund>, <mortgage>, <loan>, <index>, <future>, <exchangeTradedFund>, <equity>, <convertibleBond>, <commodity>, <cash>, <bond>, <basket>"+elementToXMLUnderlyingAsset :: Asset -> [Content ()]+elementToXMLUnderlyingAsset = schemaTypeToXML "underlyingAsset"+ + + + + + + + + + + +
+ Data/FpML/V53/Asset.hs-boot view
@@ -0,0 +1,626 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Asset+ ( module Data.FpML.V53.Asset+ , 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 qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Shared+ +data ActualPrice+instance Eq ActualPrice+instance Show ActualPrice+instance SchemaType ActualPrice+ +-- | A reference to an asset, e.g. a portfolio, trade, or +-- reference instrument.. +data AnyAssetReference+instance Eq AnyAssetReference+instance Show AnyAssetReference+instance SchemaType AnyAssetReference+instance Extension AnyAssetReference Reference+ +-- | Abstract base class for all underlying assets. +data Asset+instance Eq Asset+instance Show Asset+instance SchemaType Asset+ +-- | A scheme identifying the types of measures that can be used +-- to describe an asset. +data AssetMeasureType+data AssetMeasureTypeAttributes+instance Eq AssetMeasureType+instance Eq AssetMeasureTypeAttributes+instance Show AssetMeasureType+instance Show AssetMeasureTypeAttributes+instance SchemaType AssetMeasureType+instance Extension AssetMeasureType Scheme+ +-- | A scheme identifying the types of pricing model used to +-- evaluate the price of an asset. Examples include Intrinsic, +-- ClosedForm, MonteCarlo, BackwardInduction. +data PricingModel+data PricingModelAttributes+instance Eq PricingModel+instance Eq PricingModelAttributes+instance Show PricingModel+instance Show PricingModelAttributes+instance SchemaType PricingModel+instance Extension PricingModel Scheme+ +-- | Characterise the asset pool behind an asset backed bond. +data AssetPool+instance Eq AssetPool+instance Show AssetPool+instance SchemaType AssetPool+ +-- | Reference to an underlying asset. +data AssetReference+instance Eq AssetReference+instance Show AssetReference+instance SchemaType AssetReference+instance Extension AssetReference Reference+ +-- | Some kind of numerical measure about an asset, eg. its NPV, +-- together with characteristics of that measure. +data BasicQuotation+instance Eq BasicQuotation+instance Show BasicQuotation+instance SchemaType BasicQuotation+ +-- | A type describing the underlyer features of a basket swap. +-- Each of the basket constituents are described through an +-- embedded component, the basketConstituentsType. +data Basket+instance Eq Basket+instance Show Basket+instance SchemaType Basket+instance Extension Basket Asset+ +-- | A type describing each of the constituents of a basket. +data BasketConstituent+instance Eq BasketConstituent+instance Show BasketConstituent+instance SchemaType BasketConstituent+ +data BasketId+data BasketIdAttributes+instance Eq BasketId+instance Eq BasketIdAttributes+instance Show BasketId+instance Show BasketIdAttributes+instance SchemaType BasketId+instance Extension BasketId Scheme+ +data BasketName+data BasketNameAttributes+instance Eq BasketName+instance Eq BasketNameAttributes+instance Show BasketName+instance Show BasketNameAttributes+instance SchemaType BasketName+instance Extension BasketName Scheme+ +-- | An exchange traded bond. +data Bond+instance Eq Bond+instance Show Bond+instance SchemaType Bond+instance Extension Bond UnderlyingAsset+instance Extension Bond IdentifiedAsset+instance Extension Bond Asset+ +data Cash+instance Eq Cash+instance Show Cash+instance SchemaType Cash+instance Extension Cash Asset+ +-- | A type describing the commission that will be charged for +-- each of the hedge transactions. +data Commission+instance Eq Commission+instance Show Commission+instance SchemaType Commission+ +-- | A type describing a commodity underlying asset. +data Commodity+instance Eq Commodity+instance Show Commodity+instance SchemaType Commodity+instance Extension Commodity IdentifiedAsset+instance Extension Commodity Asset+ +data CommodityBase+data CommodityBaseAttributes+instance Eq CommodityBase+instance Eq CommodityBaseAttributes+instance Show CommodityBase+instance Show CommodityBaseAttributes+instance SchemaType CommodityBase+instance Extension CommodityBase Scheme+ +-- | Defines a commodity business day calendar. +data CommodityBusinessCalendar+data CommodityBusinessCalendarAttributes+instance Eq CommodityBusinessCalendar+instance Eq CommodityBusinessCalendarAttributes+instance Show CommodityBusinessCalendar+instance Show CommodityBusinessCalendarAttributes+instance SchemaType CommodityBusinessCalendar+instance Extension CommodityBusinessCalendar Scheme+ +-- | Specifies the time with respect to a commodity business +-- calendar. +data CommodityBusinessCalendarTime+instance Eq CommodityBusinessCalendarTime+instance Show CommodityBusinessCalendarTime+instance SchemaType CommodityBusinessCalendarTime+ +data CommodityDetails+data CommodityDetailsAttributes+instance Eq CommodityDetails+instance Eq CommodityDetailsAttributes+instance Show CommodityDetails+instance Show CommodityDetailsAttributes+instance SchemaType CommodityDetails+instance Extension CommodityDetails Scheme+ +-- | A type describing the weight of each of the underlyer +-- constituent within the basket, either in absolute or +-- relative terms. +data ConstituentWeight+instance Eq ConstituentWeight+instance Show ConstituentWeight+instance SchemaType ConstituentWeight+ +data ConvertibleBond+instance Eq ConvertibleBond+instance Show ConvertibleBond+instance SchemaType ConvertibleBond+instance Extension ConvertibleBond Bond+instance Extension ConvertibleBond UnderlyingAsset+instance Extension ConvertibleBond IdentifiedAsset+instance Extension ConvertibleBond Asset+ +-- | Defines a scheme of values for specifiying if the bond has +-- a variable coupon, step-up/down coupon or a zero-coupon. +data CouponType+data CouponTypeAttributes+instance Eq CouponType+instance Eq CouponTypeAttributes+instance Show CouponType+instance Show CouponTypeAttributes+instance SchemaType CouponType+instance Extension CouponType Scheme+ +-- | Abstract base class for instruments intended to be used +-- primarily for building curves. +data CurveInstrument+instance Eq CurveInstrument+instance Show CurveInstrument+instance SchemaType CurveInstrument+instance Extension CurveInstrument IdentifiedAsset+ +data Deposit+instance Eq Deposit+instance Show Deposit+instance SchemaType Deposit+instance Extension Deposit UnderlyingAsset+instance Extension Deposit IdentifiedAsset+instance Extension Deposit Asset+ +-- | A type describing the dividend payout ratio associated with +-- an equity underlyer. In certain cases the actual ratio is +-- not known on trade inception, and only general conditions +-- are then specified. +data DividendPayout+instance Eq DividendPayout+instance Show DividendPayout+instance SchemaType DividendPayout+ +-- | An exchange traded equity asset. +data EquityAsset+instance Eq EquityAsset+instance Show EquityAsset+instance SchemaType EquityAsset+instance Extension EquityAsset ExchangeTraded+instance Extension EquityAsset UnderlyingAsset+instance Extension EquityAsset IdentifiedAsset+instance Extension EquityAsset Asset+ +-- | An abstract base class for all exchange traded financial +-- products. +data ExchangeTraded+instance Eq ExchangeTraded+instance Show ExchangeTraded+instance SchemaType ExchangeTraded+instance Extension ExchangeTraded UnderlyingAsset+ +-- | Abstract base class for all exchange traded financial +-- products with a price which is calculated from exchange +-- traded constituents. +data ExchangeTradedCalculatedPrice+instance Eq ExchangeTradedCalculatedPrice+instance Show ExchangeTradedCalculatedPrice+instance SchemaType ExchangeTradedCalculatedPrice+instance Extension ExchangeTradedCalculatedPrice ExchangeTraded+ +-- | An exchange traded derivative contract. +data ExchangeTradedContract+instance Eq ExchangeTradedContract+instance Show ExchangeTradedContract+instance SchemaType ExchangeTradedContract+instance Extension ExchangeTradedContract ExchangeTraded+instance Extension ExchangeTradedContract UnderlyingAsset+instance Extension ExchangeTradedContract IdentifiedAsset+instance Extension ExchangeTradedContract Asset+ +-- | An exchange traded fund whose price depends on exchange +-- traded constituents. +data ExchangeTradedFund+instance Eq ExchangeTradedFund+instance Show ExchangeTradedFund+instance SchemaType ExchangeTradedFund+instance Extension ExchangeTradedFund ExchangeTradedCalculatedPrice+instance Extension ExchangeTradedFund ExchangeTraded+instance Extension ExchangeTradedFund UnderlyingAsset+instance Extension ExchangeTradedFund IdentifiedAsset+instance Extension ExchangeTradedFund Asset+ +-- | A type describing the type of loan facility. +data FacilityType+data FacilityTypeAttributes+instance Eq FacilityType+instance Eq FacilityTypeAttributes+instance Show FacilityType+instance Show FacilityTypeAttributes+instance SchemaType FacilityType+instance Extension FacilityType Scheme+ +-- | An exchange traded future contract. +data Future+instance Eq Future+instance Show Future+instance SchemaType Future+instance Extension Future ExchangeTraded+instance Extension Future UnderlyingAsset+instance Extension Future IdentifiedAsset+instance Extension Future Asset+ +-- | A type defining a short form unique identifier for a future +-- contract. +data FutureId+data FutureIdAttributes+instance Eq FutureId+instance Eq FutureIdAttributes+instance Show FutureId+instance Show FutureIdAttributes+instance SchemaType FutureId+instance Extension FutureId Scheme+ +data FxConversion+instance Eq FxConversion+instance Show FxConversion+instance SchemaType FxConversion+ +data FxRateAsset+instance Eq FxRateAsset+instance Show FxRateAsset+instance SchemaType FxRateAsset+instance Extension FxRateAsset UnderlyingAsset+instance Extension FxRateAsset IdentifiedAsset+instance Extension FxRateAsset Asset+ +-- | A generic type describing an identified asset. +data IdentifiedAsset+instance Eq IdentifiedAsset+instance Show IdentifiedAsset+instance SchemaType IdentifiedAsset+instance Extension IdentifiedAsset Asset+ +-- | A published index whose price depends on exchange traded +-- constituents. +data Index+instance Eq Index+instance Show Index+instance SchemaType Index+instance Extension Index ExchangeTradedCalculatedPrice+instance Extension Index ExchangeTraded+instance Extension Index UnderlyingAsset+instance Extension Index IdentifiedAsset+instance Extension Index Asset+ +-- | A type describing the liens associated with a loan +-- facility. +data Lien+data LienAttributes+instance Eq Lien+instance Eq LienAttributes+instance Show Lien+instance Show LienAttributes+instance SchemaType Lien+instance Extension Lien Scheme+ +-- | A type describing a loan underlying asset. +data Loan+instance Eq Loan+instance Show Loan+instance SchemaType Loan+instance Extension Loan UnderlyingAsset+instance Extension Loan IdentifiedAsset+instance Extension Loan Asset+ +-- | A type describing a mortgage asset. +data Mortgage+instance Eq Mortgage+instance Show Mortgage+instance SchemaType Mortgage+instance Extension Mortgage UnderlyingAsset+instance Extension Mortgage IdentifiedAsset+instance Extension Mortgage Asset+ +-- | A type describing the typology of mortgage obligations. +data MortgageSector+data MortgageSectorAttributes+instance Eq MortgageSector+instance Eq MortgageSectorAttributes+instance Show MortgageSector+instance Show MortgageSectorAttributes+instance SchemaType MortgageSector+instance Extension MortgageSector Scheme+ +data MutualFund+instance Eq MutualFund+instance Show MutualFund+instance SchemaType MutualFund+instance Extension MutualFund UnderlyingAsset+instance Extension MutualFund IdentifiedAsset+instance Extension MutualFund Asset+ +-- | A structure representing a pending dividend or coupon +-- payment. +data PendingPayment+instance Eq PendingPayment+instance Show PendingPayment+instance SchemaType PendingPayment+instance Extension PendingPayment PaymentBase+ +-- | A type describing the strike price. +data Price+instance Eq Price+instance Show Price+instance SchemaType Price+ +-- | The units in which a price is quoted. +data PriceQuoteUnits+data PriceQuoteUnitsAttributes+instance Eq PriceQuoteUnits+instance Eq PriceQuoteUnitsAttributes+instance Show PriceQuoteUnits+instance Show PriceQuoteUnitsAttributes+instance SchemaType PriceQuoteUnits+instance Extension PriceQuoteUnits Scheme+ +data QuantityUnit+data QuantityUnitAttributes+instance Eq QuantityUnit+instance Eq QuantityUnitAttributes+instance Show QuantityUnit+instance Show QuantityUnitAttributes+instance SchemaType QuantityUnit+instance Extension QuantityUnit Scheme+ +-- | A type representing a set of characteristics that describe +-- a quotation. +data QuotationCharacteristics+instance Eq QuotationCharacteristics+instance Show QuotationCharacteristics+instance SchemaType QuotationCharacteristics+ +-- | The type of the time of the quote. +data QuoteTiming+data QuoteTimingAttributes+instance Eq QuoteTiming+instance Eq QuoteTimingAttributes+instance Show QuoteTiming+instance Show QuoteTimingAttributes+instance SchemaType QuoteTiming+instance Extension QuoteTiming Scheme+ +data RateIndex+instance Eq RateIndex+instance Show RateIndex+instance SchemaType RateIndex+instance Extension RateIndex UnderlyingAsset+instance Extension RateIndex IdentifiedAsset+instance Extension RateIndex Asset+ +-- | A scheme identifying the type of currency that was used to +-- report the value of an asset. For example, this could +-- contain values like SettlementCurrency, QuoteCurrency, +-- UnitCurrency, etc. +data ReportingCurrencyType+data ReportingCurrencyTypeAttributes+instance Eq ReportingCurrencyType+instance Eq ReportingCurrencyTypeAttributes+instance Show ReportingCurrencyType+instance Show ReportingCurrencyTypeAttributes+instance SchemaType ReportingCurrencyType+instance Extension ReportingCurrencyType Scheme+ +data SimpleCreditDefaultSwap+instance Eq SimpleCreditDefaultSwap+instance Show SimpleCreditDefaultSwap+instance SchemaType SimpleCreditDefaultSwap+instance Extension SimpleCreditDefaultSwap UnderlyingAsset+instance Extension SimpleCreditDefaultSwap IdentifiedAsset+instance Extension SimpleCreditDefaultSwap Asset+ +data SimpleFra+instance Eq SimpleFra+instance Show SimpleFra+instance SchemaType SimpleFra+instance Extension SimpleFra UnderlyingAsset+instance Extension SimpleFra IdentifiedAsset+instance Extension SimpleFra Asset+ +data SimpleIRSwap+instance Eq SimpleIRSwap+instance Show SimpleIRSwap+instance SchemaType SimpleIRSwap+instance Extension SimpleIRSwap UnderlyingAsset+instance Extension SimpleIRSwap IdentifiedAsset+instance Extension SimpleIRSwap Asset+ +-- | A type describing a single underlyer +data SingleUnderlyer+instance Eq SingleUnderlyer+instance Show SingleUnderlyer+instance SchemaType SingleUnderlyer+ +-- | Defines an identifier for a specific location or region +-- which translates into a combination of rules for +-- calculating the UTC offset. +data TimeZone+data TimeZoneAttributes+instance Eq TimeZone+instance Eq TimeZoneAttributes+instance Show TimeZone+instance Show TimeZoneAttributes+instance SchemaType TimeZone+instance Extension TimeZone Scheme+ +-- | A type describing the whole set of possible underlyers: +-- single underlyers or multiple underlyers, each of these +-- having either security or index components. +data Underlyer+instance Eq Underlyer+instance Show Underlyer+instance SchemaType Underlyer+ +-- | Abstract base class for all underlying assets. +data UnderlyingAsset+instance Eq UnderlyingAsset+instance Show UnderlyingAsset+instance SchemaType UnderlyingAsset+instance Extension UnderlyingAsset IdentifiedAsset+ +data UnderlyingAssetTranche+data UnderlyingAssetTrancheAttributes+instance Eq UnderlyingAssetTranche+instance Eq UnderlyingAssetTrancheAttributes+instance Show UnderlyingAssetTranche+instance Show UnderlyingAssetTrancheAttributes+instance SchemaType UnderlyingAssetTranche+instance Extension UnderlyingAssetTranche Scheme+ +-- | Defines the underlying asset when it is a basket. +elementBasket :: XMLParser Basket+elementToXMLBasket :: Basket -> [Content ()]+ +-- | Identifies the underlying asset when it is a series or a +-- class of bonds. +elementBond :: XMLParser Bond+elementToXMLBond :: Bond -> [Content ()]+ +-- | Identifies a simple underlying asset type that is a cash +-- payment. Used for specifying discounting factors for future +-- cash flows in the pricing and risk model. +elementCash :: XMLParser Cash+elementToXMLCash :: Cash -> [Content ()]+ +-- | Identifies the underlying asset when it is a listed +-- commodity. +elementCommodity :: XMLParser Commodity+elementToXMLCommodity :: Commodity -> [Content ()]+ +-- | Identifies the underlying asset when it is a convertible +-- bond. +elementConvertibleBond :: XMLParser ConvertibleBond+elementToXMLConvertibleBond :: ConvertibleBond -> [Content ()]+ +-- | Defines the underlying asset when it is a curve instrument. +elementCurveInstrument :: XMLParser Asset+ +-- | Identifies a simple underlying asset that is a term +-- deposit. +elementDeposit :: XMLParser Deposit+elementToXMLDeposit :: Deposit -> [Content ()]+ +-- | Identifies the underlying asset when it is a listed equity. +elementEquity :: XMLParser EquityAsset+elementToXMLEquity :: EquityAsset -> [Content ()]+ +-- | Identifies the underlying asset when it is an +-- exchange-traded fund. +elementExchangeTradedFund :: XMLParser ExchangeTradedFund+elementToXMLExchangeTradedFund :: ExchangeTradedFund -> [Content ()]+ +-- | Identifies the underlying asset when it is a listed future +-- contract. +elementFuture :: XMLParser Future+elementToXMLFuture :: Future -> [Content ()]+ +-- | Identifies a simple underlying asset type that is an FX +-- rate. Used for specifying FX rates in the pricing and risk +-- model. +elementFx :: XMLParser FxRateAsset+elementToXMLFx :: FxRateAsset -> [Content ()]+ +-- | Identifies the underlying asset when it is a financial +-- index. +elementIndex :: XMLParser Index+elementToXMLIndex :: Index -> [Content ()]+ +-- | Identifies a simple underlying asset that is a loan. +elementLoan :: XMLParser Loan+elementToXMLLoan :: Loan -> [Content ()]+ +-- | Identifies a mortgage backed security. +elementMortgage :: XMLParser Mortgage+elementToXMLMortgage :: Mortgage -> [Content ()]+ +-- | Identifies the class of unit issued by a fund. +elementMutualFund :: XMLParser MutualFund+elementToXMLMutualFund :: MutualFund -> [Content ()]+ +-- | Identifies a simple underlying asset that is an interest +-- rate index. Used for specifying benchmark assets in the +-- market environment in the pricing and risk model. +elementRateIndex :: XMLParser RateIndex+elementToXMLRateIndex :: RateIndex -> [Content ()]+ +-- | Identifies a simple underlying asset that is a credit +-- default swap. +elementSimpleCreditDefaultSwap :: XMLParser SimpleCreditDefaultSwap+elementToXMLSimpleCreditDefaultSwap :: SimpleCreditDefaultSwap -> [Content ()]+ +-- | Identifies a simple underlying asset that is a forward rate +-- agreement. +elementSimpleFra :: XMLParser SimpleFra+elementToXMLSimpleFra :: SimpleFra -> [Content ()]+ +-- | Identifies a simple underlying asset that is a swap. +elementSimpleIrSwap :: XMLParser SimpleIRSwap+elementToXMLSimpleIrSwap :: SimpleIRSwap -> [Content ()]+ +-- | Define the underlying asset, either a listed security or +-- other instrument. +elementUnderlyingAsset :: XMLParser Asset+ + + + + + + + + + + +
+ Data/FpML/V53/CD.hs view
@@ -0,0 +1,2495 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.CD+ ( module Data.FpML.V53.CD+ , module Data.FpML.V53.Shared.Option+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import Text.XML.HaXml.OneOfN+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import Data.FpML.V53.Shared.Option+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +data AdditionalFixedPayments = AdditionalFixedPayments+ { addFixedPaymen_interestShortfallReimbursement :: Maybe Xsd.Boolean+ -- ^ An additional Fixed Payment Event. Corresponds to the + -- payment by or on behalf of the Issuer of an actual interest + -- amount in respect to the reference obligation that is + -- greater than the expected interest amount. ISDA 2003 Term: + -- Interest Shortfall Reimbursement.+ , addFixedPaymen_principalShortfallReimbursement :: Maybe Xsd.Boolean+ -- ^ An additional Fixed Payment Event. Corresponds to the + -- payment by or on behalf of the Issuer of an actual + -- principal amount in respect to the reference obligation + -- that is greater than the expected principal amount. ISDA + -- 2003 Term: Principal Shortfall Reimbursement.+ , addFixedPaymen_writedownReimbursement :: Maybe Xsd.Boolean+ -- ^ An Additional Fixed Payment. Corresponds to the payment by + -- or on behalf of the issuer of an amount in respect to the + -- reference obligation in reduction of the prior writedowns. + -- ISDA 2003 Term: Writedown Reimbursement.+ }+ deriving (Eq,Show)+instance SchemaType AdditionalFixedPayments where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return AdditionalFixedPayments+ `apply` optional (parseSchemaType "interestShortfallReimbursement")+ `apply` optional (parseSchemaType "principalShortfallReimbursement")+ `apply` optional (parseSchemaType "writedownReimbursement")+ schemaTypeToXML s x@AdditionalFixedPayments{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "interestShortfallReimbursement") $ addFixedPaymen_interestShortfallReimbursement x+ , maybe [] (schemaTypeToXML "principalShortfallReimbursement") $ addFixedPaymen_principalShortfallReimbursement x+ , maybe [] (schemaTypeToXML "writedownReimbursement") $ addFixedPaymen_writedownReimbursement x+ ]+ +data AdditionalTerm = AdditionalTerm Scheme AdditionalTermAttributes deriving (Eq,Show)+data AdditionalTermAttributes = AdditionalTermAttributes+ { addTermAttrib_additionalTermScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType AdditionalTerm where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "additionalTermScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ AdditionalTerm v (AdditionalTermAttributes a0)+ schemaTypeToXML s (AdditionalTerm bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "additionalTermScheme") $ addTermAttrib_additionalTermScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension AdditionalTerm Scheme where+ supertype (AdditionalTerm s _) = s+ +data AdjustedPaymentDates = AdjustedPaymentDates+ { adjustPaymentDates_adjustedPaymentDate :: Maybe Xsd.Date+ -- ^ The adjusted payment date. This date should already be + -- adjusted for any applicable business day convention. This + -- component is not intended for use in trade confirmation but + -- my be specified to allow the fee structure to also serve as + -- a cashflow type component (all dates the the Cashflows type + -- are adjusted payment dates).+ , adjustPaymentDates_paymentAmount :: Maybe Money+ -- ^ The currency amount of the payment.+ }+ deriving (Eq,Show)+instance SchemaType AdjustedPaymentDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return AdjustedPaymentDates+ `apply` optional (parseSchemaType "adjustedPaymentDate")+ `apply` optional (parseSchemaType "paymentAmount")+ schemaTypeToXML s x@AdjustedPaymentDates{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "adjustedPaymentDate") $ adjustPaymentDates_adjustedPaymentDate x+ , maybe [] (schemaTypeToXML "paymentAmount") $ adjustPaymentDates_paymentAmount x+ ]+ +-- | CDS Basket Reference Information+data BasketReferenceInformation = BasketReferenceInformation+ { basketRefInfo_choice0 :: (Maybe (OneOf1 ((Maybe (BasketName)),[BasketId])))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The name of the basket expressed as a free format + -- string. FpML does not define usage rules for this + -- element.+ -- + -- * A CDS basket identifier+ , basketRefInfo_referencePool :: Maybe ReferencePool+ -- ^ This element contains all the reference pool items to + -- define the reference entity and reference obligation(s) in + -- the basket+ , basketRefInfo_choice2 :: (Maybe (OneOf2 ((Maybe (Xsd.PositiveInteger)),(Maybe (Xsd.PositiveInteger))) Tranche))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * N th reference obligation to default triggers + -- payout.+ -- + -- * M th reference obligation to default to allow + -- representation of N th to M th defaults.+ -- + -- (2) This element contains CDS tranche terms.+ }+ deriving (Eq,Show)+instance SchemaType BasketReferenceInformation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return BasketReferenceInformation+ `apply` optional (oneOf' [ ("Maybe BasketName [BasketId]", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "basketName")+ `apply` many (parseSchemaType "basketId")))+ ])+ `apply` optional (parseSchemaType "referencePool")+ `apply` optional (oneOf' [ ("Maybe Xsd.PositiveInteger Maybe Xsd.PositiveInteger", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "nthToDefault")+ `apply` optional (parseSchemaType "mthToDefault")))+ , ("Tranche", fmap TwoOf2 (parseSchemaType "tranche"))+ ])+ schemaTypeToXML s x@BasketReferenceInformation{} =+ toXMLElement s []+ [ maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "basketName") a+ , concatMap (schemaTypeToXML "basketId") b+ ])+ ) $ basketRefInfo_choice0 x+ , maybe [] (schemaTypeToXML "referencePool") $ basketRefInfo_referencePool x+ , maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "nthToDefault") a+ , maybe [] (schemaTypeToXML "mthToDefault") b+ ])+ (schemaTypeToXML "tranche")+ ) $ basketRefInfo_choice2 x+ ]+ +data CalculationAmount = CalculationAmount+ { calcAmount_ID :: Maybe Xsd.ID+ , calcAmount_currency :: Currency+ -- ^ The currency in which an amount is denominated.+ , calcAmount_amount :: Xsd.Decimal+ -- ^ The monetary quantity in currency units.+ , calcAmount_step :: [Step]+ -- ^ A schedule of step date and value pairs. On each step date + -- the associated step value becomes effective. A list of + -- steps may be ordered in the document by ascending step + -- date. An FpML document containing an unordered list of + -- steps is still regarded as a conformant document.+ }+ deriving (Eq,Show)+instance SchemaType CalculationAmount where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CalculationAmount a0)+ `apply` parseSchemaType "currency"+ `apply` parseSchemaType "amount"+ `apply` many (parseSchemaType "step")+ schemaTypeToXML s x@CalculationAmount{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ calcAmount_ID x+ ]+ [ schemaTypeToXML "currency" $ calcAmount_currency x+ , schemaTypeToXML "amount" $ calcAmount_amount x+ , concatMap (schemaTypeToXML "step") $ calcAmount_step x+ ]+instance Extension CalculationAmount Money where+ supertype (CalculationAmount a0 e0 e1 e2) =+ Money a0 e0 e1+instance Extension CalculationAmount MoneyBase where+ supertype = (supertype :: Money -> MoneyBase)+ . (supertype :: CalculationAmount -> Money)+ + +data CashSettlementTerms = CashSettlementTerms+ { cashSettlTerms_ID :: Maybe Xsd.ID+ , cashSettlTerms_settlementCurrency :: Maybe Currency+ -- ^ ISDA 2003 Term: Settlement Currency+ , cashSettlTerms_valuationDate :: Maybe ValuationDate+ -- ^ The number of business days after conditions to settlement + -- have been satisfied when the calculation agent obtains a + -- price quotation on the Reference Obligation for purposes of + -- cash settlement. There may be one or more valuation dates. + -- This is typically specified if the cash settlement amount + -- is not a fixed amount. ISDA 2003 Term: Valuation Date+ , cashSettlTerms_valuationTime :: Maybe BusinessCenterTime+ -- ^ The time of day in the specified business center when the + -- calculation agent seeks quotations for an amount of the + -- reference obligation for purposes of cash settlement. ISDA + -- 2003 Term: Valuation Time+ , cashSettlTerms_quotationMethod :: Maybe QuotationRateTypeEnum+ -- ^ The type of price quotations to be requested from dealers + -- when determining the market value of the reference + -- obligation for purposes of cash settlement. For example, + -- Bid, Offer or Mid-market. ISDA 2003 Term: Quotation Method+ , cashSettlTerms_quotationAmount :: Maybe Money+ -- ^ In the determination of a cash settlement amount, if + -- weighted average quotations are to be obtained, the + -- quotation amount specifies an upper limit to the + -- outstanding principal balance of the reference obligation + -- for which the quote should be obtained. If not specified, + -- the ISDA definitions provide for a fallback amount equal to + -- the floating rate payer calculation amount. ISDA 2003 Term: + -- Quotation Amount+ , cashSettlTerms_minimumQuotationAmount :: Maybe Money+ -- ^ In the determination of a cash settlement amount, if + -- weighted average quotations are to be obtained, the minimum + -- quotation amount specifies a minimum intended threshold + -- amount of outstanding principal balance of the reference + -- obligation for which the quote should be obtained. If not + -- specified, the ISDA definitions provide for a fallback + -- amount of the lower of either USD 1,000,000 (or its + -- equivalent in the relevant obligation currency) or the + -- quotation amount. ISDA 2003 Term: Minimum Quotation Amount+ , cashSettlTerms_dealer :: [Xsd.XsdString]+ -- ^ A dealer from whom quotations are obtained by the + -- calculation agent on the reference obligation for purposes + -- of cash settlement. ISDA 2003 Term: Dealer+ , cashSettlTerms_cashSettlementBusinessDays :: Maybe Xsd.NonNegativeInteger+ -- ^ The number of business days used in the determination of + -- the cash settlement payment date. If a cash settlement + -- amount is specified, the cash settlement payment date will + -- be this number of business days following the calculation + -- of the final price. If a cash settlement amount is not + -- specified, the cash settlement payment date will be this + -- number of business days after all conditions to settlement + -- are satisfied. ISDA 2003 Term: Cash Settlement Date+ , cashSettlTerms_choice8 :: (Maybe (OneOf2 Money RestrictedPercentage))+ -- ^ Choice between:+ -- + -- (1) The amount paid by the seller to the buyer for cash + -- settlement on the cash settlement date. If not + -- otherwise specified, would typically be calculated as + -- 100 (or the Reference Price) minus the price of the + -- Reference Obligation (all expressed as a percentage) + -- times Floating Rate Payer Calculation Amount. ISDA 2003 + -- Term: Cash Settlement Amount.+ -- + -- (2) Used for fixed recovery, specifies the recovery level, + -- determined at contract inception, to be applied on a + -- default. Used to calculate the amount paid by the + -- seller to the buyer for cash settlement on the cash + -- settlement date. Amount calculation is (1 minus the + -- Recovery Factor) multiplied by the Floating Rate Payer + -- Calculation Amount. The currency will be derived from + -- the Floating Rate Payer Calculation Amount.+ , cashSettlTerms_fixedSettlement :: Maybe Xsd.Boolean+ -- ^ Used for Recovery Lock, to indicate whether fixed + -- Settlement is Applicable or Not Applicable. If Buyer fails + -- to deliver an effective Notice of Physical Settlement on or + -- before the Buyer NOPS Cut-off Date, and If Seller fails to + -- deliver an effective Seller NOPS on or before the Seller + -- NOPS Cut-off Date, then either: (a) if Fixed Settlement is + -- specified in the related Confirmation as not applicable, + -- then the Seller NOPS Cut-off Date shall be the Termination + -- Date; or (b) if Fixed Settlement is specified in the + -- related Confirmation as applicable, then: (i) if the Fixed + -- Settlement Amount is a positive number, Seller shall, + -- subject to Section 3.1 (except for the requirement of + -- satisfaction of the Notice of Physical Settlement Condition + -- to Settlement), pay the Fixed Settlement Amount to Buyer on + -- the Fixed Settlement Payment Date; and (ii) if the Fixed + -- Settlement Amount is a negative number, Buyer shall, + -- subject to Section 3.1 (except for the requirement of + -- satisfaction of the Notice of Physical Settlement Condition + -- to Settlement), pay the absolute value of the Fixed + -- Settlement Amount to Seller on the Fixed Settlement Payment + -- Date.+ , cashSettlTerms_accruedInterest :: Maybe Xsd.Boolean+ -- ^ Indicates whether accrued interest is included (true) or + -- not (false). For cash settlement this specifies whether + -- quotations should be obtained inclusive or not of accrued + -- interest. For physical settlement this specifies whether + -- the buyer should deliver the obligation with an outstanding + -- principal balance that includes or excludes accrued + -- interest. ISDA 2003 Term: Include/Exclude Accrued Interest+ , cashSettlTerms_valuationMethod :: Maybe ValuationMethodEnum+ -- ^ The ISDA defined methodology for determining the final + -- price of the reference obligation for purposes of cash + -- settlement. (ISDA 2003 Term: Valuation Method). For + -- example, Market, Highest etc.+ }+ deriving (Eq,Show)+instance SchemaType CashSettlementTerms where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CashSettlementTerms a0)+ `apply` optional (parseSchemaType "settlementCurrency")+ `apply` optional (parseSchemaType "valuationDate")+ `apply` optional (parseSchemaType "valuationTime")+ `apply` optional (parseSchemaType "quotationMethod")+ `apply` optional (parseSchemaType "quotationAmount")+ `apply` optional (parseSchemaType "minimumQuotationAmount")+ `apply` many (parseSchemaType "dealer")+ `apply` optional (parseSchemaType "cashSettlementBusinessDays")+ `apply` optional (oneOf' [ ("Money", fmap OneOf2 (parseSchemaType "cashSettlementAmount"))+ , ("RestrictedPercentage", fmap TwoOf2 (parseSchemaType "recoveryFactor"))+ ])+ `apply` optional (parseSchemaType "fixedSettlement")+ `apply` optional (parseSchemaType "accruedInterest")+ `apply` optional (parseSchemaType "valuationMethod")+ schemaTypeToXML s x@CashSettlementTerms{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ cashSettlTerms_ID x+ ]+ [ maybe [] (schemaTypeToXML "settlementCurrency") $ cashSettlTerms_settlementCurrency x+ , maybe [] (schemaTypeToXML "valuationDate") $ cashSettlTerms_valuationDate x+ , maybe [] (schemaTypeToXML "valuationTime") $ cashSettlTerms_valuationTime x+ , maybe [] (schemaTypeToXML "quotationMethod") $ cashSettlTerms_quotationMethod x+ , maybe [] (schemaTypeToXML "quotationAmount") $ cashSettlTerms_quotationAmount x+ , maybe [] (schemaTypeToXML "minimumQuotationAmount") $ cashSettlTerms_minimumQuotationAmount x+ , concatMap (schemaTypeToXML "dealer") $ cashSettlTerms_dealer x+ , maybe [] (schemaTypeToXML "cashSettlementBusinessDays") $ cashSettlTerms_cashSettlementBusinessDays x+ , maybe [] (foldOneOf2 (schemaTypeToXML "cashSettlementAmount")+ (schemaTypeToXML "recoveryFactor")+ ) $ cashSettlTerms_choice8 x+ , maybe [] (schemaTypeToXML "fixedSettlement") $ cashSettlTerms_fixedSettlement x+ , maybe [] (schemaTypeToXML "accruedInterest") $ cashSettlTerms_accruedInterest x+ , maybe [] (schemaTypeToXML "valuationMethod") $ cashSettlTerms_valuationMethod x+ ]+instance Extension CashSettlementTerms SettlementTerms where+ supertype (CashSettlementTerms a0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11) =+ SettlementTerms a0 e0+ +data CreditDefaultSwap = CreditDefaultSwap+ { creditDefaultSwap_ID :: Maybe Xsd.ID+ , creditDefaultSwap_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , creditDefaultSwap_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , creditDefaultSwap_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , creditDefaultSwap_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , creditDefaultSwap_generalTerms :: GeneralTerms+ -- ^ This element contains all the data that appears in the + -- section entitled "1. General Terms" in the 2003 ISDA Credit + -- Derivatives Confirmation.+ , creditDefaultSwap_feeLeg :: FeeLeg+ -- ^ This element contains all the terms relevant to defining + -- the fixed amounts/payments per the applicable ISDA + -- definitions.+ , creditDefaultSwap_protectionTerms :: [ProtectionTerms]+ -- ^ This element contains all the terms relevant to defining + -- the applicable floating rate payer calculation amount, + -- credit events and associated conditions to settlement, and + -- reference obligations.+ , creditDefaultSwap_choice7 :: [OneOf2 CashSettlementTerms PhysicalSettlementTerms]+ -- ^ Choice between:+ -- + -- (1) This element contains all the ISDA terms relevant to + -- cash settlement for when cash settlement is applicable. + -- ISDA 2003 Term: Cash Settlement+ -- + -- (2) This element contains all the ISDA terms relevant to + -- physical settlement for when physical settlement is + -- applicable. ISDA 2003 Term: Physical Settlement+ }+ deriving (Eq,Show)+instance SchemaType CreditDefaultSwap where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CreditDefaultSwap a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` parseSchemaType "generalTerms"+ `apply` parseSchemaType "feeLeg"+ `apply` many1 (parseSchemaType "protectionTerms")+ `apply` many (oneOf' [ ("CashSettlementTerms", fmap OneOf2 (parseSchemaType "cashSettlementTerms"))+ , ("PhysicalSettlementTerms", fmap TwoOf2 (parseSchemaType "physicalSettlementTerms"))+ ])+ schemaTypeToXML s x@CreditDefaultSwap{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ creditDefaultSwap_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ creditDefaultSwap_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ creditDefaultSwap_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ creditDefaultSwap_productType x+ , concatMap (schemaTypeToXML "productId") $ creditDefaultSwap_productId x+ , schemaTypeToXML "generalTerms" $ creditDefaultSwap_generalTerms x+ , schemaTypeToXML "feeLeg" $ creditDefaultSwap_feeLeg x+ , concatMap (schemaTypeToXML "protectionTerms") $ creditDefaultSwap_protectionTerms x+ , concatMap (foldOneOf2 (schemaTypeToXML "cashSettlementTerms")+ (schemaTypeToXML "physicalSettlementTerms")+ ) $ creditDefaultSwap_choice7 x+ ]+instance Extension CreditDefaultSwap Product where+ supertype v = Product_CreditDefaultSwap v+ +-- | A complex type to support the credit default swap option.+data CreditDefaultSwapOption = CreditDefaultSwapOption+ { creditDefaultSwapOption_ID :: Maybe Xsd.ID+ , creditDefaultSwapOption_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , creditDefaultSwapOption_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , creditDefaultSwapOption_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , creditDefaultSwapOption_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , creditDefaultSwapOption_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , creditDefaultSwapOption_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , creditDefaultSwapOption_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , creditDefaultSwapOption_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , creditDefaultSwapOption_optionType :: OptionTypeEnum+ -- ^ The type of option transaction. From a usage standpoint, + -- put/call is the default option type, while payer/receiver + -- indicator is used for options index credit default swaps, + -- consistently with the industry practice. Straddle is used + -- for the case of straddle strategy, that combine a call and + -- a put with the same strike.+ , creditDefaultSwapOption_premium :: Premium+ -- ^ The option premium payable by the buyer to the seller.+ , creditDefaultSwapOption_exercise :: Exercise+ -- ^ An placeholder for the actual option exercise definitions.+ , creditDefaultSwapOption_exerciseProcedure :: Maybe ExerciseProcedure+ -- ^ A set of parameters defining procedures associated with the + -- exercise.+ , creditDefaultSwapOption_feature :: Maybe OptionFeature+ -- ^ An Option feature such as quanto, asian, barrier, knock.+ , creditDefaultSwapOption_choice13 :: (Maybe (OneOf2 NotionalAmountReference Money))+ -- ^ A choice between an explicit representation of the notional + -- amount, or a reference to a notional amount defined + -- elsewhere in this document.+ -- + -- Choice between:+ -- + -- (1) notionalReference+ -- + -- (2) notionalAmount+ , creditDefaultSwapOption_optionEntitlement :: Maybe PositiveDecimal+ -- ^ The number of units of underlyer per option comprised in + -- the option transaction.+ , creditDefaultSwapOption_entitlementCurrency :: Maybe Currency+ -- ^ TODO+ , creditDefaultSwapOption_numberOfOptions :: Maybe PositiveDecimal+ -- ^ The number of options comprised in the option transaction.+ , creditDefaultSwapOption_settlementType :: Maybe SettlementTypeEnum+ , creditDefaultSwapOption_settlementDate :: Maybe AdjustableOrRelativeDate+ , creditDefaultSwapOption_choice19 :: (Maybe (OneOf2 Money Currency))+ -- ^ Choice between:+ -- + -- (1) Settlement Amount+ -- + -- (2) Settlement Currency for use where the Settlement Amount + -- cannot be known in advance+ , creditDefaultSwapOption_strike :: CreditOptionStrike+ -- ^ Specifies the strike of the option on credit default swap.+ , creditDefaultSwapOption_creditDefaultSwap :: CreditDefaultSwap+ }+ deriving (Eq,Show)+instance SchemaType CreditDefaultSwapOption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CreditDefaultSwapOption a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` optional (parseSchemaType "buyerPartyReference")+ `apply` optional (parseSchemaType "buyerAccountReference")+ `apply` optional (parseSchemaType "sellerPartyReference")+ `apply` optional (parseSchemaType "sellerAccountReference")+ `apply` parseSchemaType "optionType"+ `apply` parseSchemaType "premium"+ `apply` elementExercise+ `apply` optional (parseSchemaType "exerciseProcedure")+ `apply` optional (parseSchemaType "feature")+ `apply` optional (oneOf' [ ("NotionalAmountReference", fmap OneOf2 (parseSchemaType "notionalReference"))+ , ("Money", fmap TwoOf2 (parseSchemaType "notionalAmount"))+ ])+ `apply` optional (parseSchemaType "optionEntitlement")+ `apply` optional (parseSchemaType "entitlementCurrency")+ `apply` optional (parseSchemaType "numberOfOptions")+ `apply` optional (parseSchemaType "settlementType")+ `apply` optional (parseSchemaType "settlementDate")+ `apply` optional (oneOf' [ ("Money", fmap OneOf2 (parseSchemaType "settlementAmount"))+ , ("Currency", fmap TwoOf2 (parseSchemaType "settlementCurrency"))+ ])+ `apply` parseSchemaType "strike"+ `apply` parseSchemaType "creditDefaultSwap"+ schemaTypeToXML s x@CreditDefaultSwapOption{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ creditDefaultSwapOption_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ creditDefaultSwapOption_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ creditDefaultSwapOption_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ creditDefaultSwapOption_productType x+ , concatMap (schemaTypeToXML "productId") $ creditDefaultSwapOption_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ creditDefaultSwapOption_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ creditDefaultSwapOption_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ creditDefaultSwapOption_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ creditDefaultSwapOption_sellerAccountReference x+ , schemaTypeToXML "optionType" $ creditDefaultSwapOption_optionType x+ , schemaTypeToXML "premium" $ creditDefaultSwapOption_premium x+ , elementToXMLExercise $ creditDefaultSwapOption_exercise x+ , maybe [] (schemaTypeToXML "exerciseProcedure") $ creditDefaultSwapOption_exerciseProcedure x+ , maybe [] (schemaTypeToXML "feature") $ creditDefaultSwapOption_feature x+ , maybe [] (foldOneOf2 (schemaTypeToXML "notionalReference")+ (schemaTypeToXML "notionalAmount")+ ) $ creditDefaultSwapOption_choice13 x+ , maybe [] (schemaTypeToXML "optionEntitlement") $ creditDefaultSwapOption_optionEntitlement x+ , maybe [] (schemaTypeToXML "entitlementCurrency") $ creditDefaultSwapOption_entitlementCurrency x+ , maybe [] (schemaTypeToXML "numberOfOptions") $ creditDefaultSwapOption_numberOfOptions x+ , maybe [] (schemaTypeToXML "settlementType") $ creditDefaultSwapOption_settlementType x+ , maybe [] (schemaTypeToXML "settlementDate") $ creditDefaultSwapOption_settlementDate x+ , maybe [] (foldOneOf2 (schemaTypeToXML "settlementAmount")+ (schemaTypeToXML "settlementCurrency")+ ) $ creditDefaultSwapOption_choice19 x+ , schemaTypeToXML "strike" $ creditDefaultSwapOption_strike x+ , schemaTypeToXML "creditDefaultSwap" $ creditDefaultSwapOption_creditDefaultSwap x+ ]+instance Extension CreditDefaultSwapOption OptionBaseExtended where+ supertype v = OptionBaseExtended_CreditDefaultSwapOption v+instance Extension CreditDefaultSwapOption OptionBase where+ supertype = (supertype :: OptionBaseExtended -> OptionBase)+ . (supertype :: CreditDefaultSwapOption -> OptionBaseExtended)+ +instance Extension CreditDefaultSwapOption Option where+ supertype = (supertype :: OptionBase -> Option)+ . (supertype :: OptionBaseExtended -> OptionBase)+ . (supertype :: CreditDefaultSwapOption -> OptionBaseExtended)+ +instance Extension CreditDefaultSwapOption Product where+ supertype = (supertype :: Option -> Product)+ . (supertype :: OptionBase -> Option)+ . (supertype :: OptionBaseExtended -> OptionBase)+ . (supertype :: CreditDefaultSwapOption -> OptionBaseExtended)+ + +-- | A complex type to specify the strike of a credit swaption +-- or a credit default swap option.+data CreditOptionStrike = CreditOptionStrike+ { creditOptionStrike_choice0 :: (Maybe (OneOf3 Xsd.Decimal Xsd.Decimal FixedRateReference))+ -- ^ Choice between:+ -- + -- (1) The strike of a credit default swap option or credit + -- swaption when expressed as a spread per annum.+ -- + -- (2) The strike of a credit default swap option or credit + -- swaption when expressed as in reference to the price of + -- the underlying obligation(s) or index.+ -- + -- (3) The strike of a credit default swap option or credit + -- swaption when expressed in reference to the spread of + -- the underlying swap (typical practice in the case of + -- single name swaps).+ }+ deriving (Eq,Show)+instance SchemaType CreditOptionStrike where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CreditOptionStrike+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf3 (parseSchemaType "spread"))+ , ("Xsd.Decimal", fmap TwoOf3 (parseSchemaType "price"))+ , ("FixedRateReference", fmap ThreeOf3 (parseSchemaType "strikeReference"))+ ])+ schemaTypeToXML s x@CreditOptionStrike{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "spread")+ (schemaTypeToXML "price")+ (schemaTypeToXML "strikeReference")+ ) $ creditOptionStrike_choice0 x+ ]+ +data DeliverableObligations = DeliverableObligations+ { delivOblig_accruedInterest :: Maybe Xsd.Boolean+ -- ^ Indicates whether accrued interest is included (true) or + -- not (false). For cash settlement this specifies whether + -- quotations should be obtained inclusive or not of accrued + -- interest. For physical settlement this specifies whether + -- the buyer should deliver the obligation with an outstanding + -- principal balance that includes or excludes accrued + -- interest. ISDA 2003 Term: Include/Exclude Accrued Interest+ , delivOblig_category :: Maybe ObligationCategoryEnum+ -- ^ Used in both obligations and deliverable obligations to + -- represent a class or type of securities which apply. ISDA + -- 2003 Term: Obligation Category/Deliverable Obligation + -- Category+ , delivOblig_notSubordinated :: Maybe Xsd.Boolean+ -- ^ An obligation and deliverable obligation characteristic. An + -- obligation that ranks at least equal with the most senior + -- Reference Obligation in priority of payment or, if no + -- Reference Obligation is specified in the related + -- Confirmation, the obligations of the Reference Entity that + -- are senior. ISDA 2003 Term: Not Subordinated+ , delivOblig_specifiedCurrency :: Maybe SpecifiedCurrency+ -- ^ An obligation and deliverable obligation characteristic. + -- The currency or currencies in which an obligation or + -- deliverable obligation must be payable. ISDA 2003 Term: + -- Specified Currency+ , delivOblig_notSovereignLender :: Maybe Xsd.Boolean+ -- ^ An obligation and deliverable obligation characteristic. + -- Any obligation that is not primarily (majority) owed to a + -- Sovereign or Supranational Organization. ISDA 2003 Term: + -- Not Sovereign Lender+ , delivOblig_notDomesticCurrency :: Maybe NotDomesticCurrency+ -- ^ An obligation and deliverable obligation characteristic. + -- Any obligation that is payable in any currency other than + -- the domestic currency. Domestic currency is either the + -- currency so specified or, if no currency is specified, the + -- currency of (a) the reference entity, if the reference + -- entity is a sovereign, or (b) the jurisdiction in which the + -- relevant reference entity is organised, if the reference + -- entity is not a sovereign. ISDA 2003 Term: Not Domestic + -- Currency+ , delivOblig_notDomesticLaw :: Maybe Xsd.Boolean+ -- ^ An obligation and deliverable obligation characteristic. If + -- the reference entity is a Sovereign, this means any + -- obligation that is not subject to the laws of the reference + -- entity. If the reference entity is not a sovereign, this + -- means any obligation that is not subject to the laws of the + -- jurisdiction of the reference entity. ISDA 2003 Term: Not + -- Domestic Law+ , delivOblig_listed :: Maybe Xsd.Boolean+ -- ^ An obligation and deliverable obligation characteristic. + -- Indicates whether or not the obligation is quoted, listed + -- or ordinarily purchased and sold on an exchange. ISDA 2003 + -- Term: Listed+ , delivOblig_notContingent :: Maybe Xsd.Boolean+ -- ^ A deliverable obligation characteristic. In essence Not + -- Contingent means the repayment of principal cannot be + -- dependant on a formula/index, i.e. to prevent the risk of + -- being delivered an instrument that may never pay any + -- element of principal, and to ensure that the obligation is + -- interest bearing (on a regular schedule). ISDA 2003 Term: + -- Not Contingent+ , delivOblig_notDomesticIssuance :: Maybe Xsd.Boolean+ -- ^ An obligation and deliverable obligation characteristic. + -- Any obligation other than an obligation that was intended + -- to be offered for sale primarily in the domestic market of + -- the relevant Reference Entity. This specifies that the + -- obligation must be an internationally recognized bond. ISDA + -- 2003 Term: Not Domestic Issuance+ , delivOblig_assignableLoan :: Maybe PCDeliverableObligationCharac+ -- ^ A deliverable obligation characteristic. A loan that is + -- freely assignable to a bank or financial institution + -- without the consent of the Reference Entity or the + -- guarantor, if any, of the loan (or the consent of the + -- applicable borrower if a Reference Entity is guaranteeing + -- the loan) or any agent. ISDA 2003 Term: Assignable Loan+ , delivOblig_consentRequiredLoan :: Maybe PCDeliverableObligationCharac+ -- ^ A deliverable obligation characteristic. A loan that is + -- capable of being assigned with the consent of the Reference + -- Entity or the guarantor, if any, of the loan or any agent. + -- ISDA 2003 Term: Consent Required Loan+ , delivOblig_directLoanParticipation :: Maybe LoanParticipation+ -- ^ A deliverable obligation characteristic. A loan with a + -- participation agreement whereby the buyer is capable of + -- creating, or procuring the creation of, a contractual right + -- in favour of the seller that provides the seller with + -- recourse to the participation seller for a specified share + -- in any payments due under the relevant loan which are + -- received by the participation seller. ISDA 2003 Term: + -- Direct Loan Participation+ , delivOblig_transferable :: Maybe Xsd.Boolean+ -- ^ A deliverable obligation characteristic. An obligation that + -- is transferable to institutional investors without any + -- contractual, statutory or regulatory restrictions. ISDA + -- 2003 Term: Transferable+ , delivOblig_maximumMaturity :: Maybe Period+ -- ^ A deliverable obligation characteristic. An obligation that + -- has a remaining maturity from the Physical Settlement Date + -- of not greater than the period specified. ISDA 2003 Term: + -- Maximum Maturity+ , delivOblig_acceleratedOrMatured :: Maybe Xsd.Boolean+ -- ^ A deliverable obligation characteristic. An obligation at + -- time of default is due to mature and due to be repaid, or + -- as a result of downgrade/bankruptcy is due to be repaid as + -- a result of an acceleration clause. ISDA 2003 Term: + -- Accelerated or Matured+ , delivOblig_notBearer :: Maybe Xsd.Boolean+ -- ^ A deliverable obligation characteristic. Any obligation + -- that is not a bearer instrument. This applies to Bonds only + -- and is meant to avoid tax, fraud and security/delivery + -- provisions that can potentially be associated with Bearer + -- Bonds. ISDA 2003 Term: Not Bearer+ , delivOblig_choice17 :: (Maybe (OneOf3 Xsd.Boolean Xsd.Boolean Xsd.Boolean))+ -- ^ Choice between:+ -- + -- (1) An obligation and deliverable obligation + -- characteristic. Defined in the ISDA published + -- additional provisions for U.S. Municipal as Reference + -- Entity. ISDA 2003 Term: Full Faith and Credit + -- Obligation Liability+ -- + -- (2) An obligation and deliverable obligation + -- characteristic. Defined in the ISDA published + -- additional provisions for U.S. Municipal as Reference + -- Entity. ISDA 2003 Term: General Fund Obligation + -- Liability+ -- + -- (3) An obligation and deliverable obligation + -- characteristic. Defined in the ISDA published + -- additional provisions for U.S. Municipal as Reference + -- Entity. ISDA 2003 Term: Revenue Obligation Liability+ , delivOblig_indirectLoanParticipation :: Maybe LoanParticipation+ -- ^ ISDA 1999 Term: Indirect Loan Participation. NOTE: Only + -- applicable as a deliverable obligation under ISDA Credit + -- 1999.+ , delivOblig_excluded :: Maybe Xsd.XsdString+ -- ^ A free format string to specify any excluded obligations or + -- deliverable obligations, as the case may be, of the + -- reference entity or excluded types of obligations or + -- deliverable obligations. ISDA 2003 Term: Excluded + -- Obligations/Excluded Deliverable Obligations+ , delivOblig_othReferenceEntityObligations :: Maybe Xsd.XsdString+ -- ^ This element is used to specify any other obligations of a + -- reference entity in both obligations and deliverable + -- obligations. The obligations can be specified free-form. + -- ISDA 2003 Term: Other Obligations of a Reference Entity+ }+ deriving (Eq,Show)+instance SchemaType DeliverableObligations where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DeliverableObligations+ `apply` optional (parseSchemaType "accruedInterest")+ `apply` optional (parseSchemaType "category")+ `apply` optional (parseSchemaType "notSubordinated")+ `apply` optional (parseSchemaType "specifiedCurrency")+ `apply` optional (parseSchemaType "notSovereignLender")+ `apply` optional (parseSchemaType "notDomesticCurrency")+ `apply` optional (parseSchemaType "notDomesticLaw")+ `apply` optional (parseSchemaType "listed")+ `apply` optional (parseSchemaType "notContingent")+ `apply` optional (parseSchemaType "notDomesticIssuance")+ `apply` optional (parseSchemaType "assignableLoan")+ `apply` optional (parseSchemaType "consentRequiredLoan")+ `apply` optional (parseSchemaType "directLoanParticipation")+ `apply` optional (parseSchemaType "transferable")+ `apply` optional (parseSchemaType "maximumMaturity")+ `apply` optional (parseSchemaType "acceleratedOrMatured")+ `apply` optional (parseSchemaType "notBearer")+ `apply` optional (oneOf' [ ("Xsd.Boolean", fmap OneOf3 (parseSchemaType "fullFaithAndCreditObLiability"))+ , ("Xsd.Boolean", fmap TwoOf3 (parseSchemaType "generalFundObligationLiability"))+ , ("Xsd.Boolean", fmap ThreeOf3 (parseSchemaType "revenueObligationLiability"))+ ])+ `apply` optional (parseSchemaType "indirectLoanParticipation")+ `apply` optional (parseSchemaType "excluded")+ `apply` optional (parseSchemaType "othReferenceEntityObligations")+ schemaTypeToXML s x@DeliverableObligations{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "accruedInterest") $ delivOblig_accruedInterest x+ , maybe [] (schemaTypeToXML "category") $ delivOblig_category x+ , maybe [] (schemaTypeToXML "notSubordinated") $ delivOblig_notSubordinated x+ , maybe [] (schemaTypeToXML "specifiedCurrency") $ delivOblig_specifiedCurrency x+ , maybe [] (schemaTypeToXML "notSovereignLender") $ delivOblig_notSovereignLender x+ , maybe [] (schemaTypeToXML "notDomesticCurrency") $ delivOblig_notDomesticCurrency x+ , maybe [] (schemaTypeToXML "notDomesticLaw") $ delivOblig_notDomesticLaw x+ , maybe [] (schemaTypeToXML "listed") $ delivOblig_listed x+ , maybe [] (schemaTypeToXML "notContingent") $ delivOblig_notContingent x+ , maybe [] (schemaTypeToXML "notDomesticIssuance") $ delivOblig_notDomesticIssuance x+ , maybe [] (schemaTypeToXML "assignableLoan") $ delivOblig_assignableLoan x+ , maybe [] (schemaTypeToXML "consentRequiredLoan") $ delivOblig_consentRequiredLoan x+ , maybe [] (schemaTypeToXML "directLoanParticipation") $ delivOblig_directLoanParticipation x+ , maybe [] (schemaTypeToXML "transferable") $ delivOblig_transferable x+ , maybe [] (schemaTypeToXML "maximumMaturity") $ delivOblig_maximumMaturity x+ , maybe [] (schemaTypeToXML "acceleratedOrMatured") $ delivOblig_acceleratedOrMatured x+ , maybe [] (schemaTypeToXML "notBearer") $ delivOblig_notBearer x+ , maybe [] (foldOneOf3 (schemaTypeToXML "fullFaithAndCreditObLiability")+ (schemaTypeToXML "generalFundObligationLiability")+ (schemaTypeToXML "revenueObligationLiability")+ ) $ delivOblig_choice17 x+ , maybe [] (schemaTypeToXML "indirectLoanParticipation") $ delivOblig_indirectLoanParticipation x+ , maybe [] (schemaTypeToXML "excluded") $ delivOblig_excluded x+ , maybe [] (schemaTypeToXML "othReferenceEntityObligations") $ delivOblig_othReferenceEntityObligations x+ ]+ +-- | Defines a coding scheme of the entity types defined in the +-- ISDA First to Default documentation.+data EntityType = EntityType Scheme EntityTypeAttributes deriving (Eq,Show)+data EntityTypeAttributes = EntityTypeAttributes+ { entityTypeAttrib_entityTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType EntityType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "entityTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ EntityType v (EntityTypeAttributes a0)+ schemaTypeToXML s (EntityType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "entityTypeScheme") $ entityTypeAttrib_entityTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension EntityType Scheme where+ supertype (EntityType s _) = s+ +data FeeLeg = FeeLeg+ { feeLeg_ID :: Maybe Xsd.ID+ , feeLeg_initialPayment :: Maybe InitialPayment+ -- ^ Specifies a single fixed payment that is payable by the + -- payer to the receiver on the initial payment date. The + -- fixed payment to be paid is specified in terms of a known + -- currency amount. This element should be used for CDS Index + -- trades and can be used for CDS trades where it is necessary + -- to represent a payment from Seller to Buyer. For CDS trades + -- where a payment is to be made from Buyer to Seller the + -- feeLeg/singlePayment structure must be used.+ , feeLeg_singlePayment :: [SinglePayment]+ -- ^ Specifies a single fixed amount that is payable by the + -- buyer to the seller on the fixed rate payer payment date. + -- The fixed amount to be paid is specified in terms of a + -- known currency amount.+ , feeLeg_periodicPayment :: Maybe PeriodicPayment+ -- ^ Specifies a periodic schedule of fixed amounts that are + -- payable by the buyer to the seller on the fixed rate payer + -- payment dates. The fixed amount to be paid on each payment + -- date can be specified in terms of a known currency amount + -- or as an amount calculated on a formula basis by reference + -- to a per annum fixed rate. The applicable business day + -- convention and business day for adjusting any fixed rate + -- payer payment date if it would otherwise fall on a day that + -- is not a business day are those specified in the + -- dateAdjustments element within the generalTerms component. + -- ISDA 2003 Term:+ , feeLeg_marketFixedRate :: Maybe Xsd.Decimal+ -- ^ An optional element that only has meaning in a credit index + -- trade. This element contains the credit spread ("fair + -- value") at which the trade was executed. Unlike the + -- fixedRate of an index, the marketFixedRate varies over the + -- life of the index depending on market conditions. The + -- marketFixedRate is the price of the index as quoted by + -- trading desks.+ , feeLeg_paymentDelay :: Maybe Xsd.Boolean+ -- ^ Applicable to CDS on MBS to specify whether payment delays + -- are applicable to the fixed Amount. RMBS typically have a + -- payment delay of 5 days between the coupon date of the + -- reference obligation and the payment date of the synthetic + -- swap. CMBS do not, on the other hand, with both payment + -- dates being on the 25th of each month.+ , feeLeg_initialPoints :: Maybe Xsd.Decimal+ -- ^ An optional element that contains the up-front points + -- expressed as a percentage of the notional. An initialPoints + -- value of 5% would be represented as 0.05. The initialPoints + -- element is an alternative to marketFixedRate in quoting the + -- traded level of a trade. When initialPoints is used, the + -- traded level is the sum of fixedRate and initialPoints. The + -- initialPoints is one of the items that are factored into + -- the initialPayment calculation and is payable by the Buyer + -- to the Seller. Note that initialPoints and marketFixedRate + -- may both be present in the same document when both implied + -- values are desired.+ , feeLeg_quotationStyle :: Maybe QuotationStyleEnum+ -- ^ The type of quotation that was used between the trading + -- desks. The purpose of this element is to indicate the + -- actual quotation style that was used to quote this trade + -- which may not be apparent when both marketFixedRate and + -- initialPoints are included in the document. When + -- quotationStyle is ‘PointsUpFront’, the initialPoints + -- element should be populated. When quotationStyle is + -- ‘TradedSpread’, the marketFixedRate element should be + -- populated.+ }+ deriving (Eq,Show)+instance SchemaType FeeLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FeeLeg a0)+ `apply` optional (parseSchemaType "initialPayment")+ `apply` many (parseSchemaType "singlePayment")+ `apply` optional (parseSchemaType "periodicPayment")+ `apply` optional (parseSchemaType "marketFixedRate")+ `apply` optional (parseSchemaType "paymentDelay")+ `apply` optional (parseSchemaType "initialPoints")+ `apply` optional (parseSchemaType "quotationStyle")+ schemaTypeToXML s x@FeeLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ feeLeg_ID x+ ]+ [ maybe [] (schemaTypeToXML "initialPayment") $ feeLeg_initialPayment x+ , concatMap (schemaTypeToXML "singlePayment") $ feeLeg_singlePayment x+ , maybe [] (schemaTypeToXML "periodicPayment") $ feeLeg_periodicPayment x+ , maybe [] (schemaTypeToXML "marketFixedRate") $ feeLeg_marketFixedRate x+ , maybe [] (schemaTypeToXML "paymentDelay") $ feeLeg_paymentDelay x+ , maybe [] (schemaTypeToXML "initialPoints") $ feeLeg_initialPoints x+ , maybe [] (schemaTypeToXML "quotationStyle") $ feeLeg_quotationStyle x+ ]+instance Extension FeeLeg Leg where+ supertype v = Leg_FeeLeg v+ +data FixedAmountCalculation = FixedAmountCalculation+ { fixedAmountCalc_calculationAmount :: Maybe CalculationAmount+ -- ^ The notional amount used in the calculation of fixed + -- amounts where an amount is calculated on a formula basis, + -- i.e. fixed amount = fixed rate payer calculation amount x + -- fixed rate x fixed rate day count fraction. ISDA 2003 Term: + -- Fixed Rate Payer Calculation Amount.+ , fixedAmountCalc_fixedRate :: FixedRate+ -- ^ The calculation period fixed rate. A per annum rate, + -- expressed as a decimal. A fixed rate of 5% would be + -- represented as 0.05.+ , fixedAmountCalc_dayCountFraction :: Maybe DayCountFraction+ -- ^ The day count fraction. ISDA 2003 Term: Fixed Rate Day + -- Count Fraction.+ }+ deriving (Eq,Show)+instance SchemaType FixedAmountCalculation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FixedAmountCalculation+ `apply` optional (parseSchemaType "calculationAmount")+ `apply` parseSchemaType "fixedRate"+ `apply` optional (parseSchemaType "dayCountFraction")+ schemaTypeToXML s x@FixedAmountCalculation{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "calculationAmount") $ fixedAmountCalc_calculationAmount x+ , schemaTypeToXML "fixedRate" $ fixedAmountCalc_fixedRate x+ , maybe [] (schemaTypeToXML "dayCountFraction") $ fixedAmountCalc_dayCountFraction x+ ]+ +-- | The calculation period fixed rate. A per annum rate, +-- expressed as a decimal. A fixed rate of 5% would be +-- represented as 0.05.+data FixedRate = FixedRate Xsd.Decimal FixedRateAttributes deriving (Eq,Show)+data FixedRateAttributes = FixedRateAttributes+ { fixedRateAttrib_ID :: Maybe Xsd.ID+ }+ deriving (Eq,Show)+instance SchemaType FixedRate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "id" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ FixedRate v (FixedRateAttributes a0)+ schemaTypeToXML s (FixedRate bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "id") $ fixedRateAttrib_ID at+ ]+ $ schemaTypeToXML s bt+instance Extension FixedRate Xsd.Decimal where+ supertype (FixedRate s _) = s+ +data FixedRateReference = FixedRateReference+ { fixedRateRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType FixedRateReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (FixedRateReference a0)+ schemaTypeToXML s x@FixedRateReference{} =+ toXMLElement s [ toXMLAttribute "href" $ fixedRateRef_href x+ ]+ []+instance Extension FixedRateReference Reference where+ supertype v = Reference_FixedRateReference v+ +data FloatingAmountEvents = FloatingAmountEvents+ { floatAmountEvents_failureToPayPrincipal :: Maybe Xsd.Boolean+ -- ^ A floating rate payment event. Corresponds to the failure + -- by the Reference Entity to pay an expected principal amount + -- or the payment of an actual principal amount that is less + -- than the expected principal amount. ISDA 2003 Term: Failure + -- to Pay Principal.+ , floatAmountEvents_interestShortfall :: Maybe InterestShortFall+ -- ^ A floating rate payment event. With respect to any + -- Reference Obligation Payment Date, either (a) the + -- non-payment of an Expected Interest Amount or (b) the + -- payment of an Actual Interest Amount that is less than the + -- Expected Interest Amount. ISDA 2003 Term: Interest + -- Shortfall.+ , floatAmountEvents_writedown :: Maybe Xsd.Boolean+ -- ^ A floating rate payment event. Results from the fact that + -- the underlyer writes down its outstanding principal amount. + -- ISDA 2003 Term: Writedown.+ , floatAmountEvents_impliedWritedown :: Maybe Xsd.Boolean+ -- ^ A floating rate payment event. Results from the fact that + -- losses occur to the underlying instruments that do not + -- result in reductions of the outstanding principal of the + -- reference obligation.+ , floatAmountEvents_floatingAmountProvisions :: Maybe FloatingAmountProvisions+ -- ^ Specifies the floating amount provisions associated with + -- the floatingAmountEvents.+ , floatAmountEvents_additionalFixedPayments :: Maybe AdditionalFixedPayments+ -- ^ Specifies the events that will give rise to the payment a + -- additional fixed payments.+ }+ deriving (Eq,Show)+instance SchemaType FloatingAmountEvents where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FloatingAmountEvents+ `apply` optional (parseSchemaType "failureToPayPrincipal")+ `apply` optional (parseSchemaType "interestShortfall")+ `apply` optional (parseSchemaType "writedown")+ `apply` optional (parseSchemaType "impliedWritedown")+ `apply` optional (parseSchemaType "floatingAmountProvisions")+ `apply` optional (parseSchemaType "additionalFixedPayments")+ schemaTypeToXML s x@FloatingAmountEvents{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "failureToPayPrincipal") $ floatAmountEvents_failureToPayPrincipal x+ , maybe [] (schemaTypeToXML "interestShortfall") $ floatAmountEvents_interestShortfall x+ , maybe [] (schemaTypeToXML "writedown") $ floatAmountEvents_writedown x+ , maybe [] (schemaTypeToXML "impliedWritedown") $ floatAmountEvents_impliedWritedown x+ , maybe [] (schemaTypeToXML "floatingAmountProvisions") $ floatAmountEvents_floatingAmountProvisions x+ , maybe [] (schemaTypeToXML "additionalFixedPayments") $ floatAmountEvents_additionalFixedPayments x+ ]+ +data FloatingAmountProvisions = FloatingAmountProvisions+ { floatAmountProvis_wACCapInterestProvision :: Maybe Xsd.Boolean+ -- ^ As specified by the ISDA Supplement for use with trades on + -- mortgage-backed securities, "WAC Cap" means a weighted + -- average coupon or weighted average rate cap provision + -- (however defined in the Underlying Instruments) of the + -- Underlying Instruments that limits, increases or decreases + -- the interest rate or interest entitlement, as set out in + -- the Underlying Instruments on the Effective Date without + -- regard to any subsequent amendment The presence of the + -- element with value set to 'true' signifies that the + -- provision is applicable. From a usage standpoint, this + -- provision is typically applicable in the case of CMBS and + -- not applicable in case of RMBS trades.+ , floatAmountProvis_stepUpProvision :: Maybe Xsd.Boolean+ -- ^ As specified by the ISDA Standard Terms Supplement for use + -- with trades on mortgage-backed securities. The presence of + -- the element with value set to 'true' signifies that the + -- provision is applicable. If applicable, the applicable + -- step-up terms are specified as part of that ISDA Standard + -- Terms Supplement. From a usage standpoint, this provision + -- is typically applicable in the case of RMBS and not + -- applicable in case of CMBS trades.+ }+ deriving (Eq,Show)+instance SchemaType FloatingAmountProvisions where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FloatingAmountProvisions+ `apply` optional (parseSchemaType "WACCapInterestProvision")+ `apply` optional (parseSchemaType "stepUpProvision")+ schemaTypeToXML s x@FloatingAmountProvisions{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "WACCapInterestProvision") $ floatAmountProvis_wACCapInterestProvision x+ , maybe [] (schemaTypeToXML "stepUpProvision") $ floatAmountProvis_stepUpProvision x+ ]+ +data GeneralTerms = GeneralTerms+ { generalTerms_effectiveDate :: AdjustableDate2+ -- ^ The first day of the term of the trade. This day may be + -- subject to adjustment in accordance with a business day + -- convention. ISDA 2003 Term: Effective Date.+ , generalTerms_scheduledTerminationDate :: AdjustableDate2+ -- ^ The scheduled date on which the credit protection will + -- lapse. This day may be subject to adjustment in accordance + -- with a business day convention. ISDA 2003 Term: Scheduled + -- Termination Date.+ , generalTerms_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , generalTerms_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , generalTerms_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , generalTerms_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , generalTerms_dateAdjustments :: Maybe BusinessDayAdjustments+ -- ^ ISDA 2003 Terms: Business Day and Business Day Convention.+ , generalTerms_choice7 :: OneOf3 ReferenceInformation IndexReferenceInformation BasketReferenceInformation+ -- ^ Choice between:+ -- + -- (1) This element contains all the terms relevant to + -- defining the reference entity and reference + -- obligation(s).+ -- + -- (2) This element contains all the terms relevant to + -- defining the Credit DefaultSwap Index.+ -- + -- (3) This element contains all the terms relevant to + -- defining the Credit Default Swap Basket.+ , generalTerms_additionalTerm :: [AdditionalTerm]+ -- ^ This element is used for representing information contained + -- in the Additional Terms field of the 2003 Master Credit + -- Derivatives confirm.+ , generalTerms_substitution :: Maybe Xsd.Boolean+ -- ^ Value of this element set to 'true' indicates that + -- substitution is applicable.+ , generalTerms_modifiedEquityDelivery :: Maybe Xsd.Boolean+ -- ^ Value of this element set to 'true' indicates that modified + -- equity delivery is applicable.+ }+ deriving (Eq,Show)+instance SchemaType GeneralTerms where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return GeneralTerms+ `apply` parseSchemaType "effectiveDate"+ `apply` parseSchemaType "scheduledTerminationDate"+ `apply` optional (parseSchemaType "buyerPartyReference")+ `apply` optional (parseSchemaType "buyerAccountReference")+ `apply` optional (parseSchemaType "sellerPartyReference")+ `apply` optional (parseSchemaType "sellerAccountReference")+ `apply` optional (parseSchemaType "dateAdjustments")+ `apply` oneOf' [ ("ReferenceInformation", fmap OneOf3 (parseSchemaType "referenceInformation"))+ , ("IndexReferenceInformation", fmap TwoOf3 (parseSchemaType "indexReferenceInformation"))+ , ("BasketReferenceInformation", fmap ThreeOf3 (parseSchemaType "basketReferenceInformation"))+ ]+ `apply` many (parseSchemaType "additionalTerm")+ `apply` optional (parseSchemaType "substitution")+ `apply` optional (parseSchemaType "modifiedEquityDelivery")+ schemaTypeToXML s x@GeneralTerms{} =+ toXMLElement s []+ [ schemaTypeToXML "effectiveDate" $ generalTerms_effectiveDate x+ , schemaTypeToXML "scheduledTerminationDate" $ generalTerms_scheduledTerminationDate x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ generalTerms_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ generalTerms_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ generalTerms_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ generalTerms_sellerAccountReference x+ , maybe [] (schemaTypeToXML "dateAdjustments") $ generalTerms_dateAdjustments x+ , foldOneOf3 (schemaTypeToXML "referenceInformation")+ (schemaTypeToXML "indexReferenceInformation")+ (schemaTypeToXML "basketReferenceInformation")+ $ generalTerms_choice7 x+ , concatMap (schemaTypeToXML "additionalTerm") $ generalTerms_additionalTerm x+ , maybe [] (schemaTypeToXML "substitution") $ generalTerms_substitution x+ , maybe [] (schemaTypeToXML "modifiedEquityDelivery") $ generalTerms_modifiedEquityDelivery x+ ]+ +data IndexAnnexSource = IndexAnnexSource Scheme IndexAnnexSourceAttributes deriving (Eq,Show)+data IndexAnnexSourceAttributes = IndexAnnexSourceAttributes+ { indexAnnexSourceAttrib_indexAnnexSourceScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType IndexAnnexSource where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "indexAnnexSourceScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ IndexAnnexSource v (IndexAnnexSourceAttributes a0)+ schemaTypeToXML s (IndexAnnexSource bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "indexAnnexSourceScheme") $ indexAnnexSourceAttrib_indexAnnexSourceScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension IndexAnnexSource Scheme where+ supertype (IndexAnnexSource s _) = s+ +data IndexId = IndexId Scheme IndexIdAttributes deriving (Eq,Show)+data IndexIdAttributes = IndexIdAttributes+ { indexIdAttrib_indexIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType IndexId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "indexIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ IndexId v (IndexIdAttributes a0)+ schemaTypeToXML s (IndexId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "indexIdScheme") $ indexIdAttrib_indexIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension IndexId Scheme where+ supertype (IndexId s _) = s+ +data IndexName = IndexName Scheme IndexNameAttributes deriving (Eq,Show)+data IndexNameAttributes = IndexNameAttributes+ { indexNameAttrib_indexNameScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType IndexName where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "indexNameScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ IndexName v (IndexNameAttributes a0)+ schemaTypeToXML s (IndexName bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "indexNameScheme") $ indexNameAttrib_indexNameScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension IndexName Scheme where+ supertype (IndexName s _) = s+ +-- | A type defining a Credit Default Swap Index.+data IndexReferenceInformation = IndexReferenceInformation+ { indexRefInfo_ID :: Maybe Xsd.ID+ , indexRefInfo_choice0 :: OneOf2 (IndexName,[IndexId]) [IndexId]+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The name of the index expressed as a free format + -- string. FpML does not define usage rules for this + -- element.+ -- + -- * A CDS index identifier (e.g. RED pair code).+ -- + -- (2) A CDS index identifier (e.g. RED pair code).+ , indexRefInfo_indexSeries :: Maybe Xsd.PositiveInteger+ -- ^ A CDS index series identifier, e.g. 1, 2, 3 etc.+ , indexRefInfo_indexAnnexVersion :: Maybe Xsd.PositiveInteger+ -- ^ A CDS index series version identifier, e.g. 1, 2, 3 etc.+ , indexRefInfo_indexAnnexDate :: Maybe Xsd.Date+ -- ^ A CDS index series annex date.+ , indexRefInfo_indexAnnexSource :: Maybe IndexAnnexSource+ -- ^ A CDS index series annex source.+ , indexRefInfo_excludedReferenceEntity :: [LegalEntity]+ -- ^ Excluded reference entity.+ , indexRefInfo_tranche :: Maybe Tranche+ -- ^ This element contains CDS tranche terms.+ , indexRefInfo_settledEntityMatrix :: Maybe SettledEntityMatrix+ -- ^ Used to specify the Relevant Settled Entity Matrix when + -- there are settled entities at the time of the trade.+ }+ deriving (Eq,Show)+instance SchemaType IndexReferenceInformation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (IndexReferenceInformation a0)+ `apply` oneOf' [ ("IndexName [IndexId]", fmap OneOf2 (return (,) `apply` parseSchemaType "indexName"+ `apply` many (parseSchemaType "indexId")))+ , ("[IndexId]", fmap TwoOf2 (many1 (parseSchemaType "indexId")))+ ]+ `apply` optional (parseSchemaType "indexSeries")+ `apply` optional (parseSchemaType "indexAnnexVersion")+ `apply` optional (parseSchemaType "indexAnnexDate")+ `apply` optional (parseSchemaType "indexAnnexSource")+ `apply` many (parseSchemaType "excludedReferenceEntity")+ `apply` optional (parseSchemaType "tranche")+ `apply` optional (parseSchemaType "settledEntityMatrix")+ schemaTypeToXML s x@IndexReferenceInformation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ indexRefInfo_ID x+ ]+ [ foldOneOf2 (\ (a,b) -> concat [ schemaTypeToXML "indexName" a+ , concatMap (schemaTypeToXML "indexId") b+ ])+ (concatMap (schemaTypeToXML "indexId"))+ $ indexRefInfo_choice0 x+ , maybe [] (schemaTypeToXML "indexSeries") $ indexRefInfo_indexSeries x+ , maybe [] (schemaTypeToXML "indexAnnexVersion") $ indexRefInfo_indexAnnexVersion x+ , maybe [] (schemaTypeToXML "indexAnnexDate") $ indexRefInfo_indexAnnexDate x+ , maybe [] (schemaTypeToXML "indexAnnexSource") $ indexRefInfo_indexAnnexSource x+ , concatMap (schemaTypeToXML "excludedReferenceEntity") $ indexRefInfo_excludedReferenceEntity x+ , maybe [] (schemaTypeToXML "tranche") $ indexRefInfo_tranche x+ , maybe [] (schemaTypeToXML "settledEntityMatrix") $ indexRefInfo_settledEntityMatrix x+ ]+ +data InitialPayment = InitialPayment+ { initialPayment_ID :: Maybe Xsd.ID+ , initialPayment_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , initialPayment_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , initialPayment_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , initialPayment_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , initialPayment_adjustablePaymentDate :: Maybe Xsd.Date+ -- ^ A fixed payment date that shall be subject to adjustment in + -- accordance with the applicable business day convention if + -- it would otherwise fall on a day that is not a business + -- day. The applicable business day convention and business + -- day are those specified in the dateAdjustments element + -- within the generalTerms component.+ , initialPayment_adjustedPaymentDate :: Maybe Xsd.Date+ -- ^ The adjusted payment date. This date should already be + -- adjusted for any applicable business day convention. This + -- component is not intended for use in trade confirmation but + -- may be specified to allow the fee structure to also serve + -- as a cashflow type component.+ , initialPayment_paymentAmount :: Money+ -- ^ A fixed payment amount.+ }+ deriving (Eq,Show)+instance SchemaType InitialPayment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (InitialPayment a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "adjustablePaymentDate")+ `apply` optional (parseSchemaType "adjustedPaymentDate")+ `apply` parseSchemaType "paymentAmount"+ schemaTypeToXML s x@InitialPayment{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ initialPayment_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ initialPayment_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ initialPayment_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ initialPayment_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ initialPayment_receiverAccountReference x+ , maybe [] (schemaTypeToXML "adjustablePaymentDate") $ initialPayment_adjustablePaymentDate x+ , maybe [] (schemaTypeToXML "adjustedPaymentDate") $ initialPayment_adjustedPaymentDate x+ , schemaTypeToXML "paymentAmount" $ initialPayment_paymentAmount x+ ]+instance Extension InitialPayment PaymentBase where+ supertype v = PaymentBase_InitialPayment v+ +data InterestShortFall = InterestShortFall+ { interShortFall_interestShortfallCap :: Maybe InterestShortfallCapEnum+ -- ^ Specifies the nature of the interest Shortfall cap (i.e. + -- Fixed Cap or Variable Cap) in the case where it is + -- applicable. ISDA 2003 Term: Interest Shortfall Cap.+ , interShortFall_compounding :: Maybe Xsd.Boolean+ , interShortFall_rateSource :: Maybe FloatingRateIndex+ -- ^ The rate source in the case of a variable cap.+ }+ deriving (Eq,Show)+instance SchemaType InterestShortFall where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return InterestShortFall+ `apply` optional (parseSchemaType "interestShortfallCap")+ `apply` optional (parseSchemaType "compounding")+ `apply` optional (parseSchemaType "rateSource")+ schemaTypeToXML s x@InterestShortFall{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "interestShortfallCap") $ interShortFall_interestShortfallCap x+ , maybe [] (schemaTypeToXML "compounding") $ interShortFall_compounding x+ , maybe [] (schemaTypeToXML "rateSource") $ interShortFall_rateSource x+ ]+ +data LoanParticipation = LoanParticipation+ { loanPartic_applicable :: Maybe Xsd.Boolean+ -- ^ Indicates whether the provision is applicable.+ , loanPartic_partialCashSettlement :: Maybe Xsd.Boolean+ -- ^ Specifies whether either 'Partial Cash Settlement of + -- Assignable Loans', 'Partial Cash Settlement of Consent + -- Required Loans' or 'Partial Cash Settlement of + -- Participations' is applicable. If this element is specified + -- and Assignable Loan is a Deliverable Obligation + -- Chracteristic, any Assignable Loan that is deliverable, but + -- where a non-receipt of Consent by the Physical Settlement + -- Date has occurred, the Loan can be cash settled rather than + -- physically delivered. If this element is specified and + -- Consent Required Loan is a Deliverable Obligation + -- Characterisitc, any Consent Required Loan that is + -- deliverable, but where a non-receipt of Consent by the + -- Physical Settlement Date has occurred, the Loan can be cash + -- settled rather than physically delivered. If this element + -- is specified and Direct Loan Participation is a Deliverable + -- Obligation Characterisitic, any Participation that is + -- deliverable, but where this participation has not been + -- effected (has not come into effect) by the Physical + -- Settlement Date, the participation can be cash settled + -- rather than physically delivered.+ , loanPartic_qualifyingParticipationSeller :: Maybe Xsd.XsdString+ -- ^ If Direct Loan Participation is specified as a deliverable + -- obligation characteristic, this specifies any requirements + -- for the Qualifying Participation Seller. The requirements + -- may be listed free-form. ISDA 2003 Term: Qualifying + -- Participation Seller+ }+ deriving (Eq,Show)+instance SchemaType LoanParticipation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return LoanParticipation+ `apply` optional (parseSchemaType "applicable")+ `apply` optional (parseSchemaType "partialCashSettlement")+ `apply` optional (parseSchemaType "qualifyingParticipationSeller")+ schemaTypeToXML s x@LoanParticipation{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "applicable") $ loanPartic_applicable x+ , maybe [] (schemaTypeToXML "partialCashSettlement") $ loanPartic_partialCashSettlement x+ , maybe [] (schemaTypeToXML "qualifyingParticipationSeller") $ loanPartic_qualifyingParticipationSeller x+ ]+instance Extension LoanParticipation PCDeliverableObligationCharac where+ supertype (LoanParticipation e0 e1 e2) =+ PCDeliverableObligationCharac e0 e1+ +data MatrixSource = MatrixSource Scheme MatrixSourceAttributes deriving (Eq,Show)+data MatrixSourceAttributes = MatrixSourceAttributes+ { matrixSourceAttrib_settledEntityMatrixSourceScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MatrixSource where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "settledEntityMatrixSourceScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MatrixSource v (MatrixSourceAttributes a0)+ schemaTypeToXML s (MatrixSource bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "settledEntityMatrixSourceScheme") $ matrixSourceAttrib_settledEntityMatrixSourceScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MatrixSource Scheme where+ supertype (MatrixSource s _) = s+ +data MultipleValuationDates = MultipleValuationDates+ { multiValDates_businessDays :: Maybe Xsd.NonNegativeInteger+ -- ^ A number of business days. Its precise meaning is dependant + -- on the context in which this element is used. ISDA 2003 + -- Term: Business Day+ , multiValDates_businessDaysThereafter :: Maybe Xsd.PositiveInteger+ -- ^ The number of business days between successive valuation + -- dates when multiple valuation dates are applicable for cash + -- settlement. ISDA 2003 Term: Business Days thereafter+ , multiValDates_numberValuationDates :: Maybe Xsd.PositiveInteger+ -- ^ Where multiple valuation dates are specified as being + -- applicable for cash settlement, this element specifies (a) + -- the number of applicable valuation dates, and (b) the + -- number of business days after satisfaction of all + -- conditions to settlement when the first such valuation date + -- occurs, and (c) the number of business days thereafter of + -- each successive valuation date. ISDA 2003 Term: Multiple + -- Valuation Dates+ }+ deriving (Eq,Show)+instance SchemaType MultipleValuationDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return MultipleValuationDates+ `apply` optional (parseSchemaType "businessDays")+ `apply` optional (parseSchemaType "businessDaysThereafter")+ `apply` optional (parseSchemaType "numberValuationDates")+ schemaTypeToXML s x@MultipleValuationDates{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "businessDays") $ multiValDates_businessDays x+ , maybe [] (schemaTypeToXML "businessDaysThereafter") $ multiValDates_businessDaysThereafter x+ , maybe [] (schemaTypeToXML "numberValuationDates") $ multiValDates_numberValuationDates x+ ]+instance Extension MultipleValuationDates SingleValuationDate where+ supertype (MultipleValuationDates e0 e1 e2) =+ SingleValuationDate e0+ +data NotDomesticCurrency = NotDomesticCurrency+ { notDomestCurren_applicable :: Maybe Xsd.Boolean+ -- ^ Indicates whether the not domestic currency provision is + -- applicable.+ , notDomestCurren_currency :: Maybe Currency+ -- ^ An explicit specification of the domestic currency.+ }+ deriving (Eq,Show)+instance SchemaType NotDomesticCurrency where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return NotDomesticCurrency+ `apply` optional (parseSchemaType "applicable")+ `apply` optional (parseSchemaType "currency")+ schemaTypeToXML s x@NotDomesticCurrency{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "applicable") $ notDomestCurren_applicable x+ , maybe [] (schemaTypeToXML "currency") $ notDomestCurren_currency x+ ]+ +data Obligations = Obligations+ { obligations_category :: Maybe ObligationCategoryEnum+ -- ^ Used in both obligations and deliverable obligations to + -- represent a class or type of securities which apply. ISDA + -- 2003 Term: Obligation Category/Deliverable Obligation + -- Category+ , obligations_notSubordinated :: Maybe Xsd.Boolean+ -- ^ An obligation and deliverable obligation characteristic. An + -- obligation that ranks at least equal with the most senior + -- Reference Obligation in priority of payment or, if no + -- Reference Obligation is specified in the related + -- Confirmation, the obligations of the Reference Entity that + -- are senior. ISDA 2003 Term: Not Subordinated+ , obligations_specifiedCurrency :: Maybe SpecifiedCurrency+ -- ^ An obligation and deliverable obligation characteristic. + -- The currency or currencies in which an obligation or + -- deliverable obligation must be payable. ISDA 2003 Term: + -- Specified Currency+ , obligations_notSovereignLender :: Maybe Xsd.Boolean+ -- ^ An obligation and deliverable obligation characteristic. + -- Any obligation that is not primarily (majority) owed to a + -- Sovereign or Supranational Organization. ISDA 2003 Term: + -- Not Sovereign Lender+ , obligations_notDomesticCurrency :: Maybe NotDomesticCurrency+ -- ^ An obligation and deliverable obligation characteristic. + -- Any obligation that is payable in any currency other than + -- the domestic currency. Domestic currency is either the + -- currency so specified or, if no currency is specified, the + -- currency of (a) the reference entity, if the reference + -- entity is a sovereign, or (b) the jurisdiction in which the + -- relevant reference entity is organised, if the reference + -- entity is not a sovereign. ISDA 2003 Term: Not Domestic + -- Currency+ , obligations_notDomesticLaw :: Maybe Xsd.Boolean+ -- ^ An obligation and deliverable obligation characteristic. If + -- the reference entity is a Sovereign, this means any + -- obligation that is not subject to the laws of the reference + -- entity. If the reference entity is not a sovereign, this + -- means any obligation that is not subject to the laws of the + -- jurisdiction of the reference entity. ISDA 2003 Term: Not + -- Domestic Law+ , obligations_listed :: Maybe Xsd.Boolean+ -- ^ An obligation and deliverable obligation characteristic. + -- Indicates whether or not the obligation is quoted, listed + -- or ordinarily purchased and sold on an exchange. ISDA 2003 + -- Term: Listed+ , obligations_notDomesticIssuance :: Maybe Xsd.Boolean+ -- ^ An obligation and deliverable obligation characteristic. + -- Any obligation other than an obligation that was intended + -- to be offered for sale primarily in the domestic market of + -- the relevant Reference Entity. This specifies that the + -- obligation must be an internationally recognized bond. ISDA + -- 2003 Term: Not Domestic Issuance+ , obligations_choice8 :: (Maybe (OneOf3 Xsd.Boolean Xsd.Boolean Xsd.Boolean))+ -- ^ Choice between:+ -- + -- (1) An obligation and deliverable obligation + -- characteristic. Defined in the ISDA published + -- additional provisions for U.S. Municipal as Reference + -- Entity. ISDA 2003 Term: Full Faith and Credit + -- Obligation Liability+ -- + -- (2) An obligation and deliverable obligation + -- characteristic. Defined in the ISDA published + -- additional provisions for U.S. Municipal as Reference + -- Entity. ISDA 2003 Term: General Fund Obligation + -- Liability+ -- + -- (3) An obligation and deliverable obligation + -- characteristic. Defined in the ISDA published + -- additional provisions for U.S. Municipal as Reference + -- Entity. ISDA 2003 Term: Revenue Obligation Liability+ , obligations_notContingent :: Maybe Xsd.Boolean+ -- ^ NOTE: Only allowed as an obligation charcteristic under + -- ISDA Credit 1999. In essence Not Contingent means the + -- repayment of principal cannot be dependant on a + -- formula/index, i.e. to prevent the risk of being delivered + -- an instrument that may never pay any element of principal, + -- and to ensure that the obligation is interest bearing (on a + -- regular schedule). ISDA 2003 Term: Not Contingent+ , obligations_excluded :: Maybe Xsd.XsdString+ -- ^ A free format string to specify any excluded obligations or + -- deliverable obligations, as the case may be, of the + -- reference entity or excluded types of obligations or + -- deliverable obligations. ISDA 2003 Term: Excluded + -- Obligations/Excluded Deliverable Obligations+ , obligations_othReferenceEntityObligations :: Maybe Xsd.XsdString+ -- ^ This element is used to specify any other obligations of a + -- reference entity in both obligations and deliverable + -- obligations. The obligations can be specified free-form. + -- ISDA 2003 Term: Other Obligations of a Reference Entity+ , obligations_designatedPriority :: Maybe Lien+ -- ^ Applies to Loan CDS, to indicate what lien level is + -- appropriate for a deliverable obligation. Applies to + -- European Loan CDS, to indicate the Ranking of the + -- obligation. Example: a 2nd lien Loan CDS would imply that + -- the deliverable obligations are 1st or 2nd lien loans.+ , obligations_cashSettlementOnly :: Maybe Xsd.Boolean+ -- ^ An obligation and deliverable obligation characteristic. + -- Defined in the ISDA published Standard Terms Supplement for + -- use with CDS Transactions on Leveraged Loans. ISDA 2003 + -- Term: Cash Settlement Only.+ , obligations_deliveryOfCommitments :: Maybe Xsd.Boolean+ -- ^ An obligation and deliverable obligation characteristic. + -- Defined in the ISDA published Standard Terms Supplement for + -- use with CDS Transactions on Leveraged Loans. ISDA 2003 + -- Term: Delivery of Commitments.+ , obligations_continuity :: Maybe Xsd.Boolean+ -- ^ An obligation and deliverable obligation characteristic. + -- Defined in the ISDA published Standard Terms Supplement for + -- use with CDS Transactions on Leveraged Loans. ISDA 2003 + -- Term: Continuity.+ }+ deriving (Eq,Show)+instance SchemaType Obligations where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Obligations+ `apply` optional (parseSchemaType "category")+ `apply` optional (parseSchemaType "notSubordinated")+ `apply` optional (parseSchemaType "specifiedCurrency")+ `apply` optional (parseSchemaType "notSovereignLender")+ `apply` optional (parseSchemaType "notDomesticCurrency")+ `apply` optional (parseSchemaType "notDomesticLaw")+ `apply` optional (parseSchemaType "listed")+ `apply` optional (parseSchemaType "notDomesticIssuance")+ `apply` optional (oneOf' [ ("Xsd.Boolean", fmap OneOf3 (parseSchemaType "fullFaithAndCreditObLiability"))+ , ("Xsd.Boolean", fmap TwoOf3 (parseSchemaType "generalFundObligationLiability"))+ , ("Xsd.Boolean", fmap ThreeOf3 (parseSchemaType "revenueObligationLiability"))+ ])+ `apply` optional (parseSchemaType "notContingent")+ `apply` optional (parseSchemaType "excluded")+ `apply` optional (parseSchemaType "othReferenceEntityObligations")+ `apply` optional (parseSchemaType "designatedPriority")+ `apply` optional (parseSchemaType "cashSettlementOnly")+ `apply` optional (parseSchemaType "deliveryOfCommitments")+ `apply` optional (parseSchemaType "continuity")+ schemaTypeToXML s x@Obligations{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "category") $ obligations_category x+ , maybe [] (schemaTypeToXML "notSubordinated") $ obligations_notSubordinated x+ , maybe [] (schemaTypeToXML "specifiedCurrency") $ obligations_specifiedCurrency x+ , maybe [] (schemaTypeToXML "notSovereignLender") $ obligations_notSovereignLender x+ , maybe [] (schemaTypeToXML "notDomesticCurrency") $ obligations_notDomesticCurrency x+ , maybe [] (schemaTypeToXML "notDomesticLaw") $ obligations_notDomesticLaw x+ , maybe [] (schemaTypeToXML "listed") $ obligations_listed x+ , maybe [] (schemaTypeToXML "notDomesticIssuance") $ obligations_notDomesticIssuance x+ , maybe [] (foldOneOf3 (schemaTypeToXML "fullFaithAndCreditObLiability")+ (schemaTypeToXML "generalFundObligationLiability")+ (schemaTypeToXML "revenueObligationLiability")+ ) $ obligations_choice8 x+ , maybe [] (schemaTypeToXML "notContingent") $ obligations_notContingent x+ , maybe [] (schemaTypeToXML "excluded") $ obligations_excluded x+ , maybe [] (schemaTypeToXML "othReferenceEntityObligations") $ obligations_othReferenceEntityObligations x+ , maybe [] (schemaTypeToXML "designatedPriority") $ obligations_designatedPriority x+ , maybe [] (schemaTypeToXML "cashSettlementOnly") $ obligations_cashSettlementOnly x+ , maybe [] (schemaTypeToXML "deliveryOfCommitments") $ obligations_deliveryOfCommitments x+ , maybe [] (schemaTypeToXML "continuity") $ obligations_continuity x+ ]+ +data PCDeliverableObligationCharac = PCDeliverableObligationCharac+ { pCDelivObligCharac_applicable :: Maybe Xsd.Boolean+ -- ^ Indicates whether the provision is applicable.+ , pCDelivObligCharac_partialCashSettlement :: Maybe Xsd.Boolean+ -- ^ Specifies whether either 'Partial Cash Settlement of + -- Assignable Loans', 'Partial Cash Settlement of Consent + -- Required Loans' or 'Partial Cash Settlement of + -- Participations' is applicable. If this element is specified + -- and Assignable Loan is a Deliverable Obligation + -- Chracteristic, any Assignable Loan that is deliverable, but + -- where a non-receipt of Consent by the Physical Settlement + -- Date has occurred, the Loan can be cash settled rather than + -- physically delivered. If this element is specified and + -- Consent Required Loan is a Deliverable Obligation + -- Characterisitc, any Consent Required Loan that is + -- deliverable, but where a non-receipt of Consent by the + -- Physical Settlement Date has occurred, the Loan can be cash + -- settled rather than physically delivered. If this element + -- is specified and Direct Loan Participation is a Deliverable + -- Obligation Characterisitic, any Participation that is + -- deliverable, but where this participation has not been + -- effected (has not come into effect) by the Physical + -- Settlement Date, the participation can be cash settled + -- rather than physically delivered.+ }+ deriving (Eq,Show)+instance SchemaType PCDeliverableObligationCharac where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PCDeliverableObligationCharac+ `apply` optional (parseSchemaType "applicable")+ `apply` optional (parseSchemaType "partialCashSettlement")+ schemaTypeToXML s x@PCDeliverableObligationCharac{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "applicable") $ pCDelivObligCharac_applicable x+ , maybe [] (schemaTypeToXML "partialCashSettlement") $ pCDelivObligCharac_partialCashSettlement x+ ]+ +data PeriodicPayment = PeriodicPayment+ { periodPayment_ID :: Maybe Xsd.ID+ , periodPayment_paymentFrequency :: Maybe Period+ -- ^ The time interval between regular fixed rate payer payment + -- dates.+ , periodPayment_firstPeriodStartDate :: Maybe Xsd.Date+ -- ^ The start date of the initial calculation period if such + -- date is not equal to the trade’s effective date. It must + -- only be specified if it is not equal to the effective date. + -- The applicable business day convention and business day are + -- those specified in the dateAdjustments element within the + -- generalTerms component (or in a transaction supplement FpML + -- representation defined within the referenced general terms + -- confirmation agreement).+ , periodPayment_firstPaymentDate :: Maybe Xsd.Date+ -- ^ The first unadjusted fixed rate payer payment date. The + -- applicable business day convention and business day are + -- those specified in the dateAdjustments element within the + -- generalTerms component (or in a transaction supplement FpML + -- representation defined within the referenced general terms + -- confirmation agreement). ISDA 2003 Term: Fixed Rate Payer + -- Payment Date+ , periodPayment_lastRegularPaymentDate :: Maybe Xsd.Date+ -- ^ The last regular unadjusted fixed rate payer payment date. + -- The applicable business day convention and business day are + -- those specified in the dateAdjustments element within the + -- generalTerms component (or in a transaction supplement FpML + -- representation defined within the referenced general terms + -- confirmation agreement). This element should only be + -- included if there is a final payment stub, i.e. where the + -- last regular unadjusted fixed rate payer payment date is + -- not equal to the scheduled termination date. ISDA 2003 + -- Term: Fixed Rate Payer Payment Date+ , periodPayment_rollConvention :: Maybe RollConventionEnum+ -- ^ Used in conjunction with the effectiveDate, + -- scheduledTerminationDate, firstPaymentDate, + -- lastRegularPaymentDate and paymentFrequency to determine + -- the regular fixed rate payer payment dates.+ , periodPayment_choice5 :: OneOf2 Money FixedAmountCalculation+ -- ^ Choice between:+ -- + -- (1) A fixed payment amount. ISDA 2003 Term: Fixed Amount+ -- + -- (2) This element contains all the terms relevant to + -- calculating a fixed amount where the fixed amount is + -- calculated by reference to a per annum fixed rate. + -- There is no corresponding ISDA 2003 Term. The + -- equivalent is Sec 5.1 "Calculation of Fixed Amount" but + -- this in itself is not a defined Term.+ , periodPayment_adjustedPaymentDates :: [AdjustedPaymentDates]+ -- ^ An optional cashflow-like structure allowing the equivalent + -- representation of the periodic fixed payments in terms of a + -- series of adjusted payment dates and amounts. This is + -- intended to support application integration within an + -- organisation and is not intended for use in inter-firm + -- communication or confirmations. ISDA 2003 Term: Fixed Rate + -- Payer Payment Date+ }+ deriving (Eq,Show)+instance SchemaType PeriodicPayment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PeriodicPayment a0)+ `apply` optional (parseSchemaType "paymentFrequency")+ `apply` optional (parseSchemaType "firstPeriodStartDate")+ `apply` optional (parseSchemaType "firstPaymentDate")+ `apply` optional (parseSchemaType "lastRegularPaymentDate")+ `apply` optional (parseSchemaType "rollConvention")+ `apply` oneOf' [ ("Money", fmap OneOf2 (parseSchemaType "fixedAmount"))+ , ("FixedAmountCalculation", fmap TwoOf2 (parseSchemaType "fixedAmountCalculation"))+ ]+ `apply` many (parseSchemaType "adjustedPaymentDates")+ schemaTypeToXML s x@PeriodicPayment{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ periodPayment_ID x+ ]+ [ maybe [] (schemaTypeToXML "paymentFrequency") $ periodPayment_paymentFrequency x+ , maybe [] (schemaTypeToXML "firstPeriodStartDate") $ periodPayment_firstPeriodStartDate x+ , maybe [] (schemaTypeToXML "firstPaymentDate") $ periodPayment_firstPaymentDate x+ , maybe [] (schemaTypeToXML "lastRegularPaymentDate") $ periodPayment_lastRegularPaymentDate x+ , maybe [] (schemaTypeToXML "rollConvention") $ periodPayment_rollConvention x+ , foldOneOf2 (schemaTypeToXML "fixedAmount")+ (schemaTypeToXML "fixedAmountCalculation")+ $ periodPayment_choice5 x+ , concatMap (schemaTypeToXML "adjustedPaymentDates") $ periodPayment_adjustedPaymentDates x+ ]+instance Extension PeriodicPayment PaymentBase where+ supertype v = PaymentBase_PeriodicPayment v+ +data PhysicalSettlementPeriod = PhysicalSettlementPeriod+ { physicSettlPeriod_choice0 :: (Maybe (OneOf3 Xsd.Boolean Xsd.NonNegativeInteger Xsd.NonNegativeInteger))+ -- ^ Choice between:+ -- + -- (1) An explicit indication that a number of business days + -- are not specified and therefore ISDA fallback + -- provisions should apply.+ -- + -- (2) A number of business days. Its precise meaning is + -- dependant on the context in which this element is used. + -- ISDA 2003 Term: Business Day+ -- + -- (3) A maximum number of business days. Its precise meaning + -- is dependant on the context in which this element is + -- used. Intended to be used to limit a particular ISDA + -- fallback provision.+ }+ deriving (Eq,Show)+instance SchemaType PhysicalSettlementPeriod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PhysicalSettlementPeriod+ `apply` optional (oneOf' [ ("Xsd.Boolean", fmap OneOf3 (parseSchemaType "businessDaysNotSpecified"))+ , ("Xsd.NonNegativeInteger", fmap TwoOf3 (parseSchemaType "businessDays"))+ , ("Xsd.NonNegativeInteger", fmap ThreeOf3 (parseSchemaType "maximumBusinessDays"))+ ])+ schemaTypeToXML s x@PhysicalSettlementPeriod{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "businessDaysNotSpecified")+ (schemaTypeToXML "businessDays")+ (schemaTypeToXML "maximumBusinessDays")+ ) $ physicSettlPeriod_choice0 x+ ]+ +data PhysicalSettlementTerms = PhysicalSettlementTerms+ { physicSettlTerms_ID :: Maybe Xsd.ID+ , physicSettlTerms_settlementCurrency :: Maybe Currency+ -- ^ ISDA 2003 Term: Settlement Currency+ , physicSettlTerms_physicalSettlementPeriod :: Maybe PhysicalSettlementPeriod+ -- ^ The number of business days used in the determination of + -- the physical settlement date. The physical settlement date + -- is this number of business days after all applicable + -- conditions to settlement are satisfied. If a number of + -- business days is not specified fallback provisions apply + -- for determining the number of business days. If Section + -- 8.5/8.6 of the 1999/2003 ISDA Definitions are to apply the + -- businessDaysNotSpecified element should be included. If a + -- specified number of business days are to apply these should + -- be specified in the businessDays element. If Section + -- 8.5/8.6 of the 1999/2003 ISDA Definitions are to apply but + -- capped at a maximum number of business days then the + -- maximum number should be specified in the + -- maximumBusinessDays element. ISDA 2003 Term: Physical + -- Settlement Period+ , physicSettlTerms_deliverableObligations :: Maybe DeliverableObligations+ -- ^ This element contains all the ISDA terms relevant to + -- defining the deliverable obligations.+ , physicSettlTerms_escrow :: Maybe Xsd.Boolean+ -- ^ If this element is specified and set to 'true', indicates + -- that physical settlement must take place through the use of + -- an escrow agent. (For Canadian counterparties this is + -- always "Not Applicable". ISDA 2003 Term: Escrow.+ , physicSettlTerms_sixtyBusinessDaySettlementCap :: Maybe Xsd.Boolean+ -- ^ If this element is specified and set to 'true', for a + -- transaction documented under the 2003 ISDA Credit + -- Derivatives Definitions, has the effect of incorporating + -- the language set forth below into the confirmation. The + -- section references are to the 2003 ISDA Credit Derivatives + -- Definitions. Notwithstanding Section 1.7 or any provisions + -- of Sections 9.9 or 9.10 to the contrary, but without + -- prejudice to Section 9.3 and (where applicable) Sections + -- 9.4, 9.5 and 9.6, if the Termination Date has not occurred + -- on or prior to the date that is 60 Business Days following + -- the Physical Settlement Date, such 60th Business Day shall + -- be deemed to be the Termination Date with respect to this + -- Transaction except in relation to any portion of the + -- Transaction (an "Affected Portion") in respect of which: + -- (1) a valid notice of Buy-in Price has been delivered that + -- is effective fewer than three Business Days prior to such + -- 60th Business Day, in which case the Termination Date for + -- that Affected Portion shall be the third Business Day + -- following the date on which such notice is effective; or + -- (2) Buyer has purchased but not Delivered Deliverable + -- Obligations validly specified by Seller pursuant to Section + -- 9.10(b), in which case the Termination Date for that + -- Affected Portion shall be the tenth Business Day following + -- the date on which Seller validly specified such Deliverable + -- Obligations to Buyer.+ }+ deriving (Eq,Show)+instance SchemaType PhysicalSettlementTerms where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PhysicalSettlementTerms a0)+ `apply` optional (parseSchemaType "settlementCurrency")+ `apply` optional (parseSchemaType "physicalSettlementPeriod")+ `apply` optional (parseSchemaType "deliverableObligations")+ `apply` optional (parseSchemaType "escrow")+ `apply` optional (parseSchemaType "sixtyBusinessDaySettlementCap")+ schemaTypeToXML s x@PhysicalSettlementTerms{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ physicSettlTerms_ID x+ ]+ [ maybe [] (schemaTypeToXML "settlementCurrency") $ physicSettlTerms_settlementCurrency x+ , maybe [] (schemaTypeToXML "physicalSettlementPeriod") $ physicSettlTerms_physicalSettlementPeriod x+ , maybe [] (schemaTypeToXML "deliverableObligations") $ physicSettlTerms_deliverableObligations x+ , maybe [] (schemaTypeToXML "escrow") $ physicSettlTerms_escrow x+ , maybe [] (schemaTypeToXML "sixtyBusinessDaySettlementCap") $ physicSettlTerms_sixtyBusinessDaySettlementCap x+ ]+instance Extension PhysicalSettlementTerms SettlementTerms where+ supertype (PhysicalSettlementTerms a0 e0 e1 e2 e3 e4) =+ SettlementTerms a0 e0+ +data ProtectionTerms = ProtectionTerms+ { protecTerms_ID :: Maybe Xsd.ID+ , protecTerms_calculationAmount :: Money+ -- ^ The notional amount of protection coverage. ISDA 2003 Term: + -- Floating Rate Payer Calculation Amount+ , protecTerms_creditEvents :: Maybe CreditEvents+ -- ^ This element contains all the ISDA terms relating to credit + -- events.+ , protecTerms_obligations :: Maybe Obligations+ -- ^ The underlying obligations of the reference entity on which + -- you are buying or selling protection. The credit events + -- Failure to Pay, Obligation Acceleration, Obligation + -- Default, Restructuring, Repudiation/Moratorium are defined + -- with respect to these obligations. ISDA 2003 Term:+ , protecTerms_floatingAmountEvents :: Maybe FloatingAmountEvents+ -- ^ This element contains the ISDA terms relating to the + -- floating rate payment events and the implied additional + -- fixed payments, applicable to the credit derivatives + -- transactions on mortgage-backed securities with + -- pay-as-you-go or physical settlement.+ }+ deriving (Eq,Show)+instance SchemaType ProtectionTerms where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ProtectionTerms a0)+ `apply` parseSchemaType "calculationAmount"+ `apply` optional (parseSchemaType "creditEvents")+ `apply` optional (parseSchemaType "obligations")+ `apply` optional (parseSchemaType "floatingAmountEvents")+ schemaTypeToXML s x@ProtectionTerms{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ protecTerms_ID x+ ]+ [ schemaTypeToXML "calculationAmount" $ protecTerms_calculationAmount x+ , maybe [] (schemaTypeToXML "creditEvents") $ protecTerms_creditEvents x+ , maybe [] (schemaTypeToXML "obligations") $ protecTerms_obligations x+ , maybe [] (schemaTypeToXML "floatingAmountEvents") $ protecTerms_floatingAmountEvents x+ ]+ +-- | Reference to protectionTerms component.+data ProtectionTermsReference = ProtectionTermsReference+ { protecTermsRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType ProtectionTermsReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (ProtectionTermsReference a0)+ schemaTypeToXML s x@ProtectionTermsReference{} =+ toXMLElement s [ toXMLAttribute "href" $ protecTermsRef_href x+ ]+ []+instance Extension ProtectionTermsReference Reference where+ supertype v = Reference_ProtectionTermsReference v+ +data ReferenceInformation = ReferenceInformation+ { refInfo_referenceEntity :: LegalEntity+ -- ^ The corporate or sovereign entity on which you are buying + -- or selling protection and any successor that assumes all or + -- substantially all of its contractual and other obligations. + -- It is vital to use the correct legal name of the entity and + -- to be careful not to choose a subsidiary if you really want + -- to trade protection on a parent company. Please note, + -- Reference Entities cannot be senior or subordinated. It is + -- the obligations of the Reference Entities that can be + -- senior or subordinated. ISDA 2003 Term: Reference Entity+ , refInfo_choice1 :: (Maybe (OneOf3 [ReferenceObligation] Xsd.Boolean Xsd.Boolean))+ -- ^ Choice between:+ -- + -- (1) The Reference Obligation is a financial instrument that + -- is either issued or guaranteed by the reference entity. + -- It serves to clarify the precise reference entity + -- protection is being offered upon, and its legal + -- position with regard to other related firms + -- (parents/subsidiaries). Furthermore the Reference + -- Obligation is ALWAYS deliverable and establishes the + -- Pari Passu ranking (as the deliverable bonds must rank + -- equal to the reference obligation). ISDA 2003 Term: + -- Reference Obligation+ -- + -- (2) Used to indicate that there is no Reference Obligation + -- associated with this Credit Default Swap and that there + -- will never be one.+ -- + -- (3) Used to indicate that the Reference obligation + -- associated with the Credit Default Swap is currently + -- not known. This is not valid for Legal Confirmation + -- purposes, but is valid for earlier stages in the trade + -- life cycle (e.g. Broker Confirmation).+ , refInfo_allGuarantees :: Maybe Xsd.Boolean+ -- ^ Indicates whether an obligation of the Reference Entity, + -- guaranteed by the Reference Entity on behalf of a + -- non-Affiliate, is to be considered an Obligation for the + -- purpose of the transaction. It will be considered an + -- obligation if allGuarantees is applicable (true) and not if + -- allGuarantees is inapplicable (false). ISDA 2003 Term: All + -- Guarantees+ , refInfo_referencePrice :: Maybe Xsd.Decimal+ -- ^ Used to determine (a) for physically settled trades, the + -- Physical Settlement Amount, which equals the Floating Rate + -- Payer Calculation Amount times the Reference Price and (b) + -- for cash settled trades, the Cash Settlement Amount, which + -- equals the greater of (i) the difference between the + -- Reference Price and the Final Price and (ii) zero. ISDA + -- 2003 Term: Reference Price+ , refInfo_referencePolicy :: Maybe Xsd.Boolean+ -- ^ Applicable to the transactions on mortgage-backed security, + -- which can make use of a reference policy. Presence of the + -- element with value set to 'true' indicates that the + -- reference policy is applicable; absence implies that it is + -- not.+ , refInfo_securedList :: Maybe Xsd.Boolean+ -- ^ With respect to any day, the list of Syndicated Secured + -- Obligations of the Designated Priority of the Reference + -- Entity published by Markit Group Limited or any successor + -- thereto appointed by the Specified Dealers (the "Secured + -- List Publisher") on or most recently before such day, which + -- list is currently available at [http://www.markit.com]. + -- ISDA 2003 Term: Relevant Secured List.+ }+ deriving (Eq,Show)+instance SchemaType ReferenceInformation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReferenceInformation+ `apply` parseSchemaType "referenceEntity"+ `apply` optional (oneOf' [ ("[ReferenceObligation]", fmap OneOf3 (many1 (parseSchemaType "referenceObligation")))+ , ("Xsd.Boolean", fmap TwoOf3 (parseSchemaType "noReferenceObligation"))+ , ("Xsd.Boolean", fmap ThreeOf3 (parseSchemaType "unknownReferenceObligation"))+ ])+ `apply` optional (parseSchemaType "allGuarantees")+ `apply` optional (parseSchemaType "referencePrice")+ `apply` optional (parseSchemaType "referencePolicy")+ `apply` optional (parseSchemaType "securedList")+ schemaTypeToXML s x@ReferenceInformation{} =+ toXMLElement s []+ [ schemaTypeToXML "referenceEntity" $ refInfo_referenceEntity x+ , maybe [] (foldOneOf3 (concatMap (schemaTypeToXML "referenceObligation"))+ (schemaTypeToXML "noReferenceObligation")+ (schemaTypeToXML "unknownReferenceObligation")+ ) $ refInfo_choice1 x+ , maybe [] (schemaTypeToXML "allGuarantees") $ refInfo_allGuarantees x+ , maybe [] (schemaTypeToXML "referencePrice") $ refInfo_referencePrice x+ , maybe [] (schemaTypeToXML "referencePolicy") $ refInfo_referencePolicy x+ , maybe [] (schemaTypeToXML "securedList") $ refInfo_securedList x+ ]+ +data ReferenceObligation = ReferenceObligation+ { refOblig_choice0 :: (Maybe (OneOf4 Bond ConvertibleBond Mortgage Loan))+ -- ^ Choice between:+ -- + -- (1) Identifies the underlying asset when it is a series or + -- a class of bonds.+ -- + -- (2) Identifies the underlying asset when it is a + -- convertible bond.+ -- + -- (3) Identifies a mortgage backed security.+ -- + -- (4) Identifies a simple underlying asset that is a loan.+ , refOblig_choice1 :: (Maybe (OneOf2 LegalEntity LegalEntityReference))+ -- ^ Choice between:+ -- + -- (1) The entity primarily responsible for repaying debt to a + -- creditor as a result of borrowing or issuing bonds. + -- ISDA 2003 Term: Primary Obligor+ -- + -- (2) A pointer style reference to a reference entity defined + -- elsewhere in the document. Used when the reference + -- entity is the primary obligor.+ , refOblig_choice2 :: [OneOf2 LegalEntity LegalEntityReference]+ -- ^ Choice between:+ -- + -- (1) The party that guarantees by way of a contractual + -- arrangement to pay the debts of an obligor if the + -- obligor is unable to make the required payments itself. + -- ISDA 2003 Term: Guarantor+ -- + -- (2) A pointer style reference to a reference entity defined + -- elsewhere in the document. Used when the reference + -- entity is the guarantor.+ }+ deriving (Eq,Show)+instance SchemaType ReferenceObligation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReferenceObligation+ `apply` optional (oneOf' [ ("Bond", fmap OneOf4 (elementBond))+ , ("ConvertibleBond", fmap TwoOf4 (elementConvertibleBond))+ , ("Mortgage", fmap ThreeOf4 (elementMortgage))+ , ("Loan", fmap FourOf4 (elementLoan))+ ])+ `apply` optional (oneOf' [ ("LegalEntity", fmap OneOf2 (parseSchemaType "primaryObligor"))+ , ("LegalEntityReference", fmap TwoOf2 (parseSchemaType "primaryObligorReference"))+ ])+ `apply` many (oneOf' [ ("LegalEntity", fmap OneOf2 (parseSchemaType "guarantor"))+ , ("LegalEntityReference", fmap TwoOf2 (parseSchemaType "guarantorReference"))+ ])+ schemaTypeToXML s x@ReferenceObligation{} =+ toXMLElement s []+ [ maybe [] (foldOneOf4 (elementToXMLBond)+ (elementToXMLConvertibleBond)+ (elementToXMLMortgage)+ (elementToXMLLoan)+ ) $ refOblig_choice0 x+ , maybe [] (foldOneOf2 (schemaTypeToXML "primaryObligor")+ (schemaTypeToXML "primaryObligorReference")+ ) $ refOblig_choice1 x+ , concatMap (foldOneOf2 (schemaTypeToXML "guarantor")+ (schemaTypeToXML "guarantorReference")+ ) $ refOblig_choice2 x+ ]+ +data ReferencePair = ReferencePair+ { refPair_referenceEntity :: Maybe LegalEntity+ -- ^ The corporate or sovereign entity on which you are buying + -- or selling protection and any successor that assumes all or + -- substantially all of its contractual and other obligations. + -- It is vital to use the correct legal name of the entity and + -- to be careful not to choose a subsidiary if you really want + -- to trade protection on a parent company. Please note, + -- Reference Entities cannot be senior or subordinated. It is + -- the obligations of the Reference Entities that can be + -- senior or subordinated. ISDA 2003 Term: Reference Entity+ , refPair_choice1 :: (Maybe (OneOf2 ReferenceObligation Xsd.Boolean))+ -- ^ Choice between:+ -- + -- (1) The Reference Obligation is a financial instrument that + -- is either issued or guaranteed by the reference entity. + -- It serves to clarify the precise reference entity + -- protection is being offered upon, and its legal + -- position with regard to other related firms + -- (parents/subsidiaries). Furthermore the Reference + -- Obligation is ALWAYS deliverable and establishes the + -- Pari Passu ranking (as the deliverable bonds must rank + -- equal to the reference obligation). ISDA 2003 Term: + -- Reference Obligation+ -- + -- (2) Used to indicate that there is no Reference Obligation + -- associated with this Credit Default Swap and that there + -- will never be one.+ , refPair_entityType :: Maybe EntityType+ -- ^ Defines the reference entity types corresponding to a list + -- of types in the ISDA First to Default documentation.+ }+ deriving (Eq,Show)+instance SchemaType ReferencePair where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReferencePair+ `apply` optional (parseSchemaType "referenceEntity")+ `apply` optional (oneOf' [ ("ReferenceObligation", fmap OneOf2 (parseSchemaType "referenceObligation"))+ , ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "noReferenceObligation"))+ ])+ `apply` optional (parseSchemaType "entityType")+ schemaTypeToXML s x@ReferencePair{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "referenceEntity") $ refPair_referenceEntity x+ , maybe [] (foldOneOf2 (schemaTypeToXML "referenceObligation")+ (schemaTypeToXML "noReferenceObligation")+ ) $ refPair_choice1 x+ , maybe [] (schemaTypeToXML "entityType") $ refPair_entityType x+ ]+ +-- | This type contains all the reference pool items to define +-- the reference entity and reference obligation(s) in the +-- basket.+data ReferencePool = ReferencePool+ { referencePool_item :: [ReferencePoolItem]+ }+ deriving (Eq,Show)+instance SchemaType ReferencePool where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReferencePool+ `apply` many (parseSchemaType "referencePoolItem")+ schemaTypeToXML s x@ReferencePool{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "referencePoolItem") $ referencePool_item x+ ]+ +-- | This type contains all the constituent weight and reference +-- information.+data ReferencePoolItem = ReferencePoolItem+ { refPoolItem_constituentWeight :: Maybe ConstituentWeight+ -- ^ Describes the weight of each of the constituents within the + -- basket. If not provided, it is assumed to be equal + -- weighted.+ , refPoolItem_referencePair :: Maybe ReferencePair+ , refPoolItem_protectionTermsReference :: Maybe ProtectionTermsReference+ -- ^ Reference to the documentation terms applicable to this + -- item.+ , refPoolItem_settlementTermsReference :: Maybe SettlementTermsReference+ -- ^ Reference to the settlement terms applicable to this item.+ }+ deriving (Eq,Show)+instance SchemaType ReferencePoolItem where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReferencePoolItem+ `apply` optional (parseSchemaType "constituentWeight")+ `apply` optional (parseSchemaType "referencePair")+ `apply` optional (parseSchemaType "protectionTermsReference")+ `apply` optional (parseSchemaType "settlementTermsReference")+ schemaTypeToXML s x@ReferencePoolItem{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "constituentWeight") $ refPoolItem_constituentWeight x+ , maybe [] (schemaTypeToXML "referencePair") $ refPoolItem_referencePair x+ , maybe [] (schemaTypeToXML "protectionTermsReference") $ refPoolItem_protectionTermsReference x+ , maybe [] (schemaTypeToXML "settlementTermsReference") $ refPoolItem_settlementTermsReference x+ ]+ +data SettledEntityMatrix = SettledEntityMatrix+ { settledEntityMatrix_matrixSource :: Maybe MatrixSource+ -- ^ Relevant settled entity matrix source.+ , settledEntityMatrix_publicationDate :: Maybe Xsd.Date+ -- ^ Specifies the publication date of the applicable version of + -- the matrix. When this element is omitted, the Standard + -- Terms Supplement defines rules for which version of the + -- matrix is applicable.+ }+ deriving (Eq,Show)+instance SchemaType SettledEntityMatrix where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SettledEntityMatrix+ `apply` optional (parseSchemaType "matrixSource")+ `apply` optional (parseSchemaType "publicationDate")+ schemaTypeToXML s x@SettledEntityMatrix{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "matrixSource") $ settledEntityMatrix_matrixSource x+ , maybe [] (schemaTypeToXML "publicationDate") $ settledEntityMatrix_publicationDate x+ ]+ +data SettlementTerms = SettlementTerms+ { settlTerms_ID :: Maybe Xsd.ID+ , settlTerms_settlementCurrency :: Maybe Currency+ -- ^ ISDA 2003 Term: Settlement Currency+ }+ deriving (Eq,Show)+instance SchemaType SettlementTerms where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (SettlementTerms a0)+ `apply` optional (parseSchemaType "settlementCurrency")+ schemaTypeToXML s x@SettlementTerms{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ settlTerms_ID x+ ]+ [ maybe [] (schemaTypeToXML "settlementCurrency") $ settlTerms_settlementCurrency x+ ]+ +-- | Reference to a settlement terms derived construct +-- (cashSettlementTerms or physicalSettlementTerms).+data SettlementTermsReference = SettlementTermsReference+ { settlTermsRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType SettlementTermsReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (SettlementTermsReference a0)+ schemaTypeToXML s x@SettlementTermsReference{} =+ toXMLElement s [ toXMLAttribute "href" $ settlTermsRef_href x+ ]+ []+instance Extension SettlementTermsReference Reference where+ supertype v = Reference_SettlementTermsReference v+ +data SinglePayment = SinglePayment+ { singlePayment_ID :: Maybe Xsd.ID+ , singlePayment_adjustablePaymentDate :: Maybe Xsd.Date+ -- ^ A fixed amount payment date that shall be subject to + -- adjustment in accordance with the applicable business day + -- convention if it would otherwise fall on a day that is not + -- a business day. The applicable business day convention and + -- business day are those specified in the dateAdjustments + -- element within the generalTerms component. ISDA 2003 Term: + -- Fixed Rate Payer Payment Date+ , singlePayment_adjustedPaymentDate :: Maybe Xsd.Date+ -- ^ The adjusted payment date. This date should already be + -- adjusted for any applicable business day convention. This + -- component is not intended for use in trade confirmation but + -- may be specified to allow the fee structure to also serve + -- as a cashflow type component.+ , singlePayment_fixedAmount :: Money+ -- ^ A fixed payment amount. ISDA 2003 Term: Fixed Amount+ }+ deriving (Eq,Show)+instance SchemaType SinglePayment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (SinglePayment a0)+ `apply` optional (parseSchemaType "adjustablePaymentDate")+ `apply` optional (parseSchemaType "adjustedPaymentDate")+ `apply` parseSchemaType "fixedAmount"+ schemaTypeToXML s x@SinglePayment{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ singlePayment_ID x+ ]+ [ maybe [] (schemaTypeToXML "adjustablePaymentDate") $ singlePayment_adjustablePaymentDate x+ , maybe [] (schemaTypeToXML "adjustedPaymentDate") $ singlePayment_adjustedPaymentDate x+ , schemaTypeToXML "fixedAmount" $ singlePayment_fixedAmount x+ ]+instance Extension SinglePayment PaymentBase where+ supertype v = PaymentBase_SinglePayment v+ +data SingleValuationDate = SingleValuationDate+ { singleValDate_businessDays :: Maybe Xsd.NonNegativeInteger+ -- ^ A number of business days. Its precise meaning is dependant + -- on the context in which this element is used. ISDA 2003 + -- Term: Business Day+ }+ deriving (Eq,Show)+instance SchemaType SingleValuationDate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SingleValuationDate+ `apply` optional (parseSchemaType "businessDays")+ schemaTypeToXML s x@SingleValuationDate{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "businessDays") $ singleValDate_businessDays x+ ]+ +data SpecifiedCurrency = SpecifiedCurrency+ { specifCurren_applicable :: Maybe Xsd.Boolean+ -- ^ Indicates whether the specified currency provision is + -- applicable.+ , specifCurren_currency :: [Currency]+ -- ^ The currency in which an amount is denominated.+ }+ deriving (Eq,Show)+instance SchemaType SpecifiedCurrency where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SpecifiedCurrency+ `apply` optional (parseSchemaType "applicable")+ `apply` many (parseSchemaType "currency")+ schemaTypeToXML s x@SpecifiedCurrency{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "applicable") $ specifCurren_applicable x+ , concatMap (schemaTypeToXML "currency") $ specifCurren_currency x+ ]+ +-- | This type represents a CDS Tranche.+data Tranche = Tranche+ { tranche_attachmentPoint :: Maybe Xsd.Decimal+ -- ^ Lower bound percentage of the loss that the Tranche can + -- endure, expressed as a decimal. An attachment point of 5% + -- would be represented as 0.05. The difference between + -- Attachment and Exhaustion points is call the width of the + -- Tranche. A schema facet to constraint the value between 0 + -- to 1 will be introduced in FpML 4.3.+ , tranche_exhaustionPoint :: Maybe Xsd.Decimal+ -- ^ Upper bound percentage of the loss that the Tranche can + -- endure, expressed as a decimal. An exhaustion point of 5% + -- would be represented as 0.05. The difference between + -- Attachment and Exhaustion points is call the width of the + -- Tranche. A schema facet to constraint the value between 0 + -- to 1 will be introduced in FpML 4.3.+ , tranche_incurredRecoveryApplicable :: Maybe Xsd.Boolean+ -- ^ Outstanding Swap Notional Amount is defined at any time on + -- any day, as the greater of: (a) Zero; If Incurred Recovery + -- Amount Applicable: (b) The Original Swap Notional Amount + -- minus the sum of all Incurred Loss Amounts and all Incurred + -- Recovery Amounts (if any) determined under this + -- Confirmation at or prior to such time.Incurred Recovery + -- Amount not populated: (b) The Original Swap Notional Amount + -- minus the sum of all Incurred Loss Amounts determined under + -- this Confirmation at or prior to such time.+ }+ deriving (Eq,Show)+instance SchemaType Tranche where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Tranche+ `apply` optional (parseSchemaType "attachmentPoint")+ `apply` optional (parseSchemaType "exhaustionPoint")+ `apply` optional (parseSchemaType "incurredRecoveryApplicable")+ schemaTypeToXML s x@Tranche{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "attachmentPoint") $ tranche_attachmentPoint x+ , maybe [] (schemaTypeToXML "exhaustionPoint") $ tranche_exhaustionPoint x+ , maybe [] (schemaTypeToXML "incurredRecoveryApplicable") $ tranche_incurredRecoveryApplicable x+ ]+ +data ValuationDate = ValuationDate+ { valDate_choice0 :: (Maybe (OneOf2 SingleValuationDate MultipleValuationDates))+ -- ^ Choice between:+ -- + -- (1) Where single valuation date is specified as being + -- applicable for cash settlement, this element specifies + -- the number of business days after satisfaction of all + -- conditions to settlement when such valuation date + -- occurs. ISDA 2003 Term: Single Valuation Date+ -- + -- (2) Where multiple valuation dates are specified as being + -- applicable for cash settlement, this element specifies + -- (a) the number of applicable valuation dates, and (b) + -- the number of business days after satisfaction of all + -- conditions to settlement when the first such valuation + -- date occurs, and (c) the number of business days + -- thereafter of each successive valuation date. ISDA 2003 + -- Term: Multiple Valuation Dates+ }+ deriving (Eq,Show)+instance SchemaType ValuationDate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ValuationDate+ `apply` optional (oneOf' [ ("SingleValuationDate", fmap OneOf2 (parseSchemaType "singleValuationDate"))+ , ("MultipleValuationDates", fmap TwoOf2 (parseSchemaType "multipleValuationDates"))+ ])+ schemaTypeToXML s x@ValuationDate{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "singleValuationDate")+ (schemaTypeToXML "multipleValuationDates")+ ) $ valDate_choice0 x+ ]+ +-- | A limited version of the CDS type used as an underlyer to +-- CDS options in Transparency view, to avoid requiring +-- product type etc.+data LimitedCreditDefaultSwap = LimitedCreditDefaultSwap+ { limitedCreditDefaultSwap_generalTerms :: GeneralTerms+ -- ^ This element contains all the data that appears in the + -- section entitled "1. General Terms" in the 2003 ISDA Credit + -- Derivatives Confirmation.+ , limitedCreditDefaultSwap_feeLeg :: FeeLeg+ -- ^ This element contains all the terms relevant to defining + -- the fixed amounts/payments per the applicable ISDA + -- definitions.+ , limitedCreditDefaultSwap_protectionTerms :: [ProtectionTerms]+ -- ^ This element contains all the terms relevant to defining + -- the applicable floating rate payer calculation amount, + -- credit events and associated conditions to settlement, and + -- reference obligations.+ }+ deriving (Eq,Show)+instance SchemaType LimitedCreditDefaultSwap where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return LimitedCreditDefaultSwap+ `apply` parseSchemaType "generalTerms"+ `apply` parseSchemaType "feeLeg"+ `apply` many1 (parseSchemaType "protectionTerms")+ schemaTypeToXML s x@LimitedCreditDefaultSwap{} =+ toXMLElement s []+ [ schemaTypeToXML "generalTerms" $ limitedCreditDefaultSwap_generalTerms x+ , schemaTypeToXML "feeLeg" $ limitedCreditDefaultSwap_feeLeg x+ , concatMap (schemaTypeToXML "protectionTerms") $ limitedCreditDefaultSwap_protectionTerms x+ ]+ +-- | In a credit default swap one party (the protection seller) +-- agrees to compensate another party (the protection buyer) +-- if a specified company or Sovereign (the reference entity) +-- experiences a credit event, indicating it is or may be +-- unable to service its debts. The protection seller is +-- typically paid a fee and/or premium, expressed as an +-- annualized percent of the notional in basis points, +-- regularly over the life of the transaction or otherwise as +-- agreed by the parties.+elementCreditDefaultSwap :: XMLParser CreditDefaultSwap+elementCreditDefaultSwap = parseSchemaType "creditDefaultSwap"+elementToXMLCreditDefaultSwap :: CreditDefaultSwap -> [Content ()]+elementToXMLCreditDefaultSwap = schemaTypeToXML "creditDefaultSwap"+ +-- | An option on a credit default swap.+elementCreditDefaultSwapOption :: XMLParser CreditDefaultSwapOption+elementCreditDefaultSwapOption = parseSchemaType "creditDefaultSwapOption"+elementToXMLCreditDefaultSwapOption :: CreditDefaultSwapOption -> [Content ()]+elementToXMLCreditDefaultSwapOption = schemaTypeToXML "creditDefaultSwapOption"+
+ Data/FpML/V53/CD.hs-boot view
@@ -0,0 +1,341 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.CD+ ( module Data.FpML.V53.CD+ , module Data.FpML.V53.Shared.Option+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Shared.Option+ +data AdditionalFixedPayments+instance Eq AdditionalFixedPayments+instance Show AdditionalFixedPayments+instance SchemaType AdditionalFixedPayments+ +data AdditionalTerm+data AdditionalTermAttributes+instance Eq AdditionalTerm+instance Eq AdditionalTermAttributes+instance Show AdditionalTerm+instance Show AdditionalTermAttributes+instance SchemaType AdditionalTerm+instance Extension AdditionalTerm Scheme+ +data AdjustedPaymentDates+instance Eq AdjustedPaymentDates+instance Show AdjustedPaymentDates+instance SchemaType AdjustedPaymentDates+ +-- | CDS Basket Reference Information +data BasketReferenceInformation+instance Eq BasketReferenceInformation+instance Show BasketReferenceInformation+instance SchemaType BasketReferenceInformation+ +data CalculationAmount+instance Eq CalculationAmount+instance Show CalculationAmount+instance SchemaType CalculationAmount+instance Extension CalculationAmount Money+instance Extension CalculationAmount MoneyBase+ +data CashSettlementTerms+instance Eq CashSettlementTerms+instance Show CashSettlementTerms+instance SchemaType CashSettlementTerms+instance Extension CashSettlementTerms SettlementTerms+ +data CreditDefaultSwap+instance Eq CreditDefaultSwap+instance Show CreditDefaultSwap+instance SchemaType CreditDefaultSwap+instance Extension CreditDefaultSwap Product+ +-- | A complex type to support the credit default swap option. +data CreditDefaultSwapOption+instance Eq CreditDefaultSwapOption+instance Show CreditDefaultSwapOption+instance SchemaType CreditDefaultSwapOption+instance Extension CreditDefaultSwapOption OptionBaseExtended+instance Extension CreditDefaultSwapOption OptionBase+instance Extension CreditDefaultSwapOption Option+instance Extension CreditDefaultSwapOption Product+ +-- | A complex type to specify the strike of a credit swaption +-- or a credit default swap option. +data CreditOptionStrike+instance Eq CreditOptionStrike+instance Show CreditOptionStrike+instance SchemaType CreditOptionStrike+ +data DeliverableObligations+instance Eq DeliverableObligations+instance Show DeliverableObligations+instance SchemaType DeliverableObligations+ +-- | Defines a coding scheme of the entity types defined in the +-- ISDA First to Default documentation. +data EntityType+data EntityTypeAttributes+instance Eq EntityType+instance Eq EntityTypeAttributes+instance Show EntityType+instance Show EntityTypeAttributes+instance SchemaType EntityType+instance Extension EntityType Scheme+ +data FeeLeg+instance Eq FeeLeg+instance Show FeeLeg+instance SchemaType FeeLeg+instance Extension FeeLeg Leg+ +data FixedAmountCalculation+instance Eq FixedAmountCalculation+instance Show FixedAmountCalculation+instance SchemaType FixedAmountCalculation+ +-- | The calculation period fixed rate. A per annum rate, +-- expressed as a decimal. A fixed rate of 5% would be +-- represented as 0.05. +data FixedRate+data FixedRateAttributes+instance Eq FixedRate+instance Eq FixedRateAttributes+instance Show FixedRate+instance Show FixedRateAttributes+instance SchemaType FixedRate+instance Extension FixedRate Xsd.Decimal+ +data FixedRateReference+instance Eq FixedRateReference+instance Show FixedRateReference+instance SchemaType FixedRateReference+instance Extension FixedRateReference Reference+ +data FloatingAmountEvents+instance Eq FloatingAmountEvents+instance Show FloatingAmountEvents+instance SchemaType FloatingAmountEvents+ +data FloatingAmountProvisions+instance Eq FloatingAmountProvisions+instance Show FloatingAmountProvisions+instance SchemaType FloatingAmountProvisions+ +data GeneralTerms+instance Eq GeneralTerms+instance Show GeneralTerms+instance SchemaType GeneralTerms+ +data IndexAnnexSource+data IndexAnnexSourceAttributes+instance Eq IndexAnnexSource+instance Eq IndexAnnexSourceAttributes+instance Show IndexAnnexSource+instance Show IndexAnnexSourceAttributes+instance SchemaType IndexAnnexSource+instance Extension IndexAnnexSource Scheme+ +data IndexId+data IndexIdAttributes+instance Eq IndexId+instance Eq IndexIdAttributes+instance Show IndexId+instance Show IndexIdAttributes+instance SchemaType IndexId+instance Extension IndexId Scheme+ +data IndexName+data IndexNameAttributes+instance Eq IndexName+instance Eq IndexNameAttributes+instance Show IndexName+instance Show IndexNameAttributes+instance SchemaType IndexName+instance Extension IndexName Scheme+ +-- | A type defining a Credit Default Swap Index. +data IndexReferenceInformation+instance Eq IndexReferenceInformation+instance Show IndexReferenceInformation+instance SchemaType IndexReferenceInformation+ +data InitialPayment+instance Eq InitialPayment+instance Show InitialPayment+instance SchemaType InitialPayment+instance Extension InitialPayment PaymentBase+ +data InterestShortFall+instance Eq InterestShortFall+instance Show InterestShortFall+instance SchemaType InterestShortFall+ +data LoanParticipation+instance Eq LoanParticipation+instance Show LoanParticipation+instance SchemaType LoanParticipation+instance Extension LoanParticipation PCDeliverableObligationCharac+ +data MatrixSource+data MatrixSourceAttributes+instance Eq MatrixSource+instance Eq MatrixSourceAttributes+instance Show MatrixSource+instance Show MatrixSourceAttributes+instance SchemaType MatrixSource+instance Extension MatrixSource Scheme+ +data MultipleValuationDates+instance Eq MultipleValuationDates+instance Show MultipleValuationDates+instance SchemaType MultipleValuationDates+instance Extension MultipleValuationDates SingleValuationDate+ +data NotDomesticCurrency+instance Eq NotDomesticCurrency+instance Show NotDomesticCurrency+instance SchemaType NotDomesticCurrency+ +data Obligations+instance Eq Obligations+instance Show Obligations+instance SchemaType Obligations+ +data PCDeliverableObligationCharac+instance Eq PCDeliverableObligationCharac+instance Show PCDeliverableObligationCharac+instance SchemaType PCDeliverableObligationCharac+ +data PeriodicPayment+instance Eq PeriodicPayment+instance Show PeriodicPayment+instance SchemaType PeriodicPayment+instance Extension PeriodicPayment PaymentBase+ +data PhysicalSettlementPeriod+instance Eq PhysicalSettlementPeriod+instance Show PhysicalSettlementPeriod+instance SchemaType PhysicalSettlementPeriod+ +data PhysicalSettlementTerms+instance Eq PhysicalSettlementTerms+instance Show PhysicalSettlementTerms+instance SchemaType PhysicalSettlementTerms+instance Extension PhysicalSettlementTerms SettlementTerms+ +data ProtectionTerms+instance Eq ProtectionTerms+instance Show ProtectionTerms+instance SchemaType ProtectionTerms+ +-- | Reference to protectionTerms component. +data ProtectionTermsReference+instance Eq ProtectionTermsReference+instance Show ProtectionTermsReference+instance SchemaType ProtectionTermsReference+instance Extension ProtectionTermsReference Reference+ +data ReferenceInformation+instance Eq ReferenceInformation+instance Show ReferenceInformation+instance SchemaType ReferenceInformation+ +data ReferenceObligation+instance Eq ReferenceObligation+instance Show ReferenceObligation+instance SchemaType ReferenceObligation+ +data ReferencePair+instance Eq ReferencePair+instance Show ReferencePair+instance SchemaType ReferencePair+ +-- | This type contains all the reference pool items to define +-- the reference entity and reference obligation(s) in the +-- basket. +data ReferencePool+instance Eq ReferencePool+instance Show ReferencePool+instance SchemaType ReferencePool+ +-- | This type contains all the constituent weight and reference +-- information. +data ReferencePoolItem+instance Eq ReferencePoolItem+instance Show ReferencePoolItem+instance SchemaType ReferencePoolItem+ +data SettledEntityMatrix+instance Eq SettledEntityMatrix+instance Show SettledEntityMatrix+instance SchemaType SettledEntityMatrix+ +data SettlementTerms+instance Eq SettlementTerms+instance Show SettlementTerms+instance SchemaType SettlementTerms+ +-- | Reference to a settlement terms derived construct +-- (cashSettlementTerms or physicalSettlementTerms). +data SettlementTermsReference+instance Eq SettlementTermsReference+instance Show SettlementTermsReference+instance SchemaType SettlementTermsReference+instance Extension SettlementTermsReference Reference+ +data SinglePayment+instance Eq SinglePayment+instance Show SinglePayment+instance SchemaType SinglePayment+instance Extension SinglePayment PaymentBase+ +data SingleValuationDate+instance Eq SingleValuationDate+instance Show SingleValuationDate+instance SchemaType SingleValuationDate+ +data SpecifiedCurrency+instance Eq SpecifiedCurrency+instance Show SpecifiedCurrency+instance SchemaType SpecifiedCurrency+ +-- | This type represents a CDS Tranche. +data Tranche+instance Eq Tranche+instance Show Tranche+instance SchemaType Tranche+ +data ValuationDate+instance Eq ValuationDate+instance Show ValuationDate+instance SchemaType ValuationDate+ +-- | A limited version of the CDS type used as an underlyer to +-- CDS options in Transparency view, to avoid requiring +-- product type etc. +data LimitedCreditDefaultSwap+instance Eq LimitedCreditDefaultSwap+instance Show LimitedCreditDefaultSwap+instance SchemaType LimitedCreditDefaultSwap+ +-- | In a credit default swap one party (the protection seller) +-- agrees to compensate another party (the protection buyer) +-- if a specified company or Sovereign (the reference entity) +-- experiences a credit event, indicating it is or may be +-- unable to service its debts. The protection seller is +-- typically paid a fee and/or premium, expressed as an +-- annualized percent of the notional in basis points, +-- regularly over the life of the transaction or otherwise as +-- agreed by the parties. +elementCreditDefaultSwap :: XMLParser CreditDefaultSwap+elementToXMLCreditDefaultSwap :: CreditDefaultSwap -> [Content ()]+ +-- | An option on a credit default swap. +elementCreditDefaultSwapOption :: XMLParser CreditDefaultSwapOption+elementToXMLCreditDefaultSwapOption :: CreditDefaultSwapOption -> [Content ()]+
+ Data/FpML/V53/Com.hs view
@@ -0,0 +1,5007 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Com+ ( module Data.FpML.V53.Com+ , module Data.FpML.V53.Shared.Option+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import Text.XML.HaXml.OneOfN+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import Data.FpML.V53.Shared.Option+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | The acceptable tolerance in the delivered quantity of a +-- physical commodity product in terms of a number of units of +-- that product.+data AbsoluteTolerance = AbsoluteTolerance+ { absToler_positive :: Maybe Xsd.Decimal+ -- ^ The maxmium amount by which the quantity delivered can + -- exceed the agreed quantity.+ , absToler_negative :: Maybe Xsd.Decimal+ -- ^ The maximum amount by which the quantity delivered can be + -- less than the agreed quantity.+ , absToler_unit :: Maybe QuantityUnit+ -- ^ The unit in which the tolerance is specified.+ , absToler_optionOwnerPartyReference :: Maybe PartyReference+ -- ^ Indicates whether the tolerance is at the seller's or + -- buyer's option.+ }+ deriving (Eq,Show)+instance SchemaType AbsoluteTolerance where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return AbsoluteTolerance+ `apply` optional (parseSchemaType "positive")+ `apply` optional (parseSchemaType "negative")+ `apply` optional (parseSchemaType "unit")+ `apply` optional (parseSchemaType "optionOwnerPartyReference")+ schemaTypeToXML s x@AbsoluteTolerance{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "positive") $ absToler_positive x+ , maybe [] (schemaTypeToXML "negative") $ absToler_negative x+ , maybe [] (schemaTypeToXML "unit") $ absToler_unit x+ , maybe [] (schemaTypeToXML "optionOwnerPartyReference") $ absToler_optionOwnerPartyReference x+ ]+ +-- | A scheme defining where bullion is to be delivered for a +-- Bullion Transaction.+data BullionDeliveryLocation = BullionDeliveryLocation Scheme BullionDeliveryLocationAttributes deriving (Eq,Show)+data BullionDeliveryLocationAttributes = BullionDeliveryLocationAttributes+ { bullionDelivLocatAttrib_bullionDeliveryLocationScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType BullionDeliveryLocation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "bullionDeliveryLocationScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ BullionDeliveryLocation v (BullionDeliveryLocationAttributes a0)+ schemaTypeToXML s (BullionDeliveryLocation bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "bullionDeliveryLocationScheme") $ bullionDelivLocatAttrib_bullionDeliveryLocationScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension BullionDeliveryLocation Scheme where+ supertype (BullionDeliveryLocation s _) = s+ +-- | Physically settled leg of a physically settled Bullion +-- Transaction.+data BullionPhysicalLeg = BullionPhysicalLeg+ { bullionPhysicLeg_ID :: Maybe Xsd.ID+ , bullionPhysicLeg_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , bullionPhysicLeg_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , bullionPhysicLeg_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , bullionPhysicLeg_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , bullionPhysicLeg_bullionType :: Maybe BullionTypeEnum+ -- ^ The type of Bullion underlying a Bullion Transaction.+ , bullionPhysicLeg_deliveryLocation :: Maybe BullionDeliveryLocation+ -- ^ The physical delivery location for the transaction.+ , bullionPhysicLeg_choice6 :: (Maybe (OneOf2 CommodityNotionalQuantity CommodityPhysicalQuantitySchedule))+ -- ^ Choice between:+ -- + -- (1) The Quantity per Delivery Period.+ -- + -- (2) Allows the documentation of a shaped quantity trade + -- where the quantity changes over the life of the + -- transaction.+ , bullionPhysicLeg_totalPhysicalQuantity :: UnitQuantity+ -- ^ The Total Quantity of the commodity to be delivered.+ , bullionPhysicLeg_settlementDate :: Maybe AdjustableOrRelativeDate+ -- ^ Date on which the bullion will settle.+ }+ deriving (Eq,Show)+instance SchemaType BullionPhysicalLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (BullionPhysicalLeg a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "bullionType")+ `apply` optional (parseSchemaType "deliveryLocation")+ `apply` optional (oneOf' [ ("CommodityNotionalQuantity", fmap OneOf2 (parseSchemaType "physicalQuantity"))+ , ("CommodityPhysicalQuantitySchedule", fmap TwoOf2 (parseSchemaType "physicalQuantitySchedule"))+ ])+ `apply` parseSchemaType "totalPhysicalQuantity"+ `apply` optional (parseSchemaType "settlementDate")+ schemaTypeToXML s x@BullionPhysicalLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ bullionPhysicLeg_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ bullionPhysicLeg_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ bullionPhysicLeg_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ bullionPhysicLeg_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ bullionPhysicLeg_receiverAccountReference x+ , maybe [] (schemaTypeToXML "bullionType") $ bullionPhysicLeg_bullionType x+ , maybe [] (schemaTypeToXML "deliveryLocation") $ bullionPhysicLeg_deliveryLocation x+ , maybe [] (foldOneOf2 (schemaTypeToXML "physicalQuantity")+ (schemaTypeToXML "physicalQuantitySchedule")+ ) $ bullionPhysicLeg_choice6 x+ , schemaTypeToXML "totalPhysicalQuantity" $ bullionPhysicLeg_totalPhysicalQuantity x+ , maybe [] (schemaTypeToXML "settlementDate") $ bullionPhysicLeg_settlementDate x+ ]+instance Extension BullionPhysicalLeg PhysicalForwardLeg where+ supertype v = PhysicalForwardLeg_BullionPhysicalLeg v+instance Extension BullionPhysicalLeg CommodityForwardLeg where+ supertype = (supertype :: PhysicalForwardLeg -> CommodityForwardLeg)+ . (supertype :: BullionPhysicalLeg -> PhysicalForwardLeg)+ +instance Extension BullionPhysicalLeg Leg where+ supertype = (supertype :: CommodityForwardLeg -> Leg)+ . (supertype :: PhysicalForwardLeg -> CommodityForwardLeg)+ . (supertype :: BullionPhysicalLeg -> PhysicalForwardLeg)+ + +-- | A pointer style reference to single-day-duration +-- calculation periods defined elsewhere - note that this +-- schedule consists of a parameterised schedule in a +-- calculationPeriodsSchedule container.+data CalculationPeriodsDatesReference = CalculationPeriodsDatesReference+ { calcPeriodsDatesRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType CalculationPeriodsDatesReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (CalculationPeriodsDatesReference a0)+ schemaTypeToXML s x@CalculationPeriodsDatesReference{} =+ toXMLElement s [ toXMLAttribute "href" $ calcPeriodsDatesRef_href x+ ]+ []+instance Extension CalculationPeriodsDatesReference Reference where+ supertype v = Reference_CalculationPeriodsDatesReference v+ +-- | A pointer style reference to a calculation periods schedule +-- defined elsewhere - note that this schedule consists of a +-- series of actual dates in a calculationPeriods container.+data CalculationPeriodsReference = CalculationPeriodsReference+ { calcPeriodsRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType CalculationPeriodsReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (CalculationPeriodsReference a0)+ schemaTypeToXML s x@CalculationPeriodsReference{} =+ toXMLElement s [ toXMLAttribute "href" $ calcPeriodsRef_href x+ ]+ []+instance Extension CalculationPeriodsReference Reference where+ supertype v = Reference_CalculationPeriodsReference v+ +-- | A pointer style reference to a calculation periods schedule +-- defined elsewhere - note that this schedule consists of a +-- parameterised schedule in a calculationPeriodsSchedule +-- container.+data CalculationPeriodsScheduleReference = CalculationPeriodsScheduleReference+ { cpsr_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType CalculationPeriodsScheduleReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (CalculationPeriodsScheduleReference a0)+ schemaTypeToXML s x@CalculationPeriodsScheduleReference{} =+ toXMLElement s [ toXMLAttribute "href" $ cpsr_href x+ ]+ []+instance Extension CalculationPeriodsScheduleReference Reference where+ supertype v = Reference_CalculationPeriodsScheduleReference v+ +-- | The different options for specifying the attributes of a +-- coal quality measure as a decimal value.+data CoalAttributeDecimal = CoalAttributeDecimal+ { coalAttribDecimal_choice0 :: (Maybe (OneOf1 ((Maybe (Xsd.Decimal)),(Maybe (Xsd.Decimal)))))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The actual content of the quality characteristics + -- of the Coal Product Shipment expected by the Buyer.+ -- + -- * The actual limits of the quality characteristics of + -- the Coal Product above or below which the Buyer may + -- reject a Shipment.+ }+ deriving (Eq,Show)+instance SchemaType CoalAttributeDecimal where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CoalAttributeDecimal+ `apply` optional (oneOf' [ ("Maybe Xsd.Decimal Maybe Xsd.Decimal", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "standardContent")+ `apply` optional (parseSchemaType "rejectionLimit")))+ ])+ schemaTypeToXML s x@CoalAttributeDecimal{} =+ toXMLElement s []+ [ maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "standardContent") a+ , maybe [] (schemaTypeToXML "rejectionLimit") b+ ])+ ) $ coalAttribDecimal_choice0 x+ ]+ +-- | The different options for specifying the attributes of a +-- coal quality measure as a percentage of the measured value.+data CoalAttributePercentage = CoalAttributePercentage+ { coalAttribPercen_choice0 :: (Maybe (OneOf1 ((Maybe (RestrictedPercentage)),(Maybe (RestrictedPercentage)))))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The actual content of the quality characteristics + -- of the Coal Product Shipment expected by the Buyer.+ -- + -- * The actual limits of the quality characteristics of + -- the Coal Product above or below which the Buyer may + -- reject a Shipment.+ }+ deriving (Eq,Show)+instance SchemaType CoalAttributePercentage where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CoalAttributePercentage+ `apply` optional (oneOf' [ ("Maybe RestrictedPercentage Maybe RestrictedPercentage", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "standardContent")+ `apply` optional (parseSchemaType "rejectionLimit")))+ ])+ schemaTypeToXML s x@CoalAttributePercentage{} =+ toXMLElement s []+ [ maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "standardContent") a+ , maybe [] (schemaTypeToXML "rejectionLimit") b+ ])+ ) $ coalAttribPercen_choice0 x+ ]+ +-- | The physical delivery conditions for coal.+data CoalDelivery = CoalDelivery+ { coalDelivery_choice0 :: OneOf2 CoalDeliveryPoint Xsd.Boolean+ -- ^ Choice between:+ -- + -- (1) The point at which the Coal Product will be delivered + -- and received.+ -- + -- (2) The point at which the Coal Product as a reference to + -- the Source of the Coal Product. This should be a + -- reference to the source element within product.+ , coalDelivery_quantityVariationAdjustment :: Maybe Xsd.Boolean+ -- ^ If true, indicates that QVA is applicable. If false, + -- indicates that QVA is inapplicable.+ , coalDelivery_transportationEquipment :: Maybe CoalTransportationEquipment+ -- ^ The transportation equipment with which the Coal Product + -- will be delivered and received.+ , coalDelivery_risk :: Maybe CommodityDeliveryRisk+ -- ^ Specifies how the risk associated with the delivery is + -- assigned.+ }+ deriving (Eq,Show)+instance SchemaType CoalDelivery where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CoalDelivery+ `apply` oneOf' [ ("CoalDeliveryPoint", fmap OneOf2 (parseSchemaType "deliveryPoint"))+ , ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "deliveryAtSource"))+ ]+ `apply` optional (parseSchemaType "quantityVariationAdjustment")+ `apply` optional (parseSchemaType "transportationEquipment")+ `apply` optional (parseSchemaType "risk")+ schemaTypeToXML s x@CoalDelivery{} =+ toXMLElement s []+ [ foldOneOf2 (schemaTypeToXML "deliveryPoint")+ (schemaTypeToXML "deliveryAtSource")+ $ coalDelivery_choice0 x+ , maybe [] (schemaTypeToXML "quantityVariationAdjustment") $ coalDelivery_quantityVariationAdjustment x+ , maybe [] (schemaTypeToXML "transportationEquipment") $ coalDelivery_transportationEquipment x+ , maybe [] (schemaTypeToXML "risk") $ coalDelivery_risk x+ ]+ +-- | A scheme identifying the types of the Delivery Point for a +-- physically settled coal trade.+data CoalDeliveryPoint = CoalDeliveryPoint Scheme CoalDeliveryPointAttributes deriving (Eq,Show)+data CoalDeliveryPointAttributes = CoalDeliveryPointAttributes+ { coalDelivPointAttrib_deliveryPointScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CoalDeliveryPoint where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "deliveryPointScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CoalDeliveryPoint v (CoalDeliveryPointAttributes a0)+ schemaTypeToXML s (CoalDeliveryPoint bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "deliveryPointScheme") $ coalDelivPointAttrib_deliveryPointScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CoalDeliveryPoint Scheme where+ supertype (CoalDeliveryPoint s _) = s+ +-- | Physically settled leg of a physically settled coal +-- transaction.+data CoalPhysicalLeg = CoalPhysicalLeg+ { coalPhysicLeg_ID :: Maybe Xsd.ID+ , coalPhysicLeg_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , coalPhysicLeg_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , coalPhysicLeg_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , coalPhysicLeg_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , coalPhysicLeg_deliveryPeriods :: Maybe CommodityDeliveryPeriods+ -- ^ The period during which delivery/deliveries of Coal + -- Products may be scheduled. Equivalent to Nomination + -- Period(s) for US Coal.+ , coalPhysicLeg_coal :: CoalProduct+ -- ^ The specification of the Coal Product to be delivered.+ , coalPhysicLeg_deliveryConditions :: CoalDelivery+ -- ^ The physical delivery conditions for the transaction.+ , coalPhysicLeg_deliveryQuantity :: CommodityPhysicalQuantity+ -- ^ The different options for specifying the quantity.+ }+ deriving (Eq,Show)+instance SchemaType CoalPhysicalLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CoalPhysicalLeg a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "deliveryPeriods")+ `apply` parseSchemaType "coal"+ `apply` parseSchemaType "deliveryConditions"+ `apply` parseSchemaType "deliveryQuantity"+ schemaTypeToXML s x@CoalPhysicalLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ coalPhysicLeg_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ coalPhysicLeg_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ coalPhysicLeg_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ coalPhysicLeg_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ coalPhysicLeg_receiverAccountReference x+ , maybe [] (schemaTypeToXML "deliveryPeriods") $ coalPhysicLeg_deliveryPeriods x+ , schemaTypeToXML "coal" $ coalPhysicLeg_coal x+ , schemaTypeToXML "deliveryConditions" $ coalPhysicLeg_deliveryConditions x+ , schemaTypeToXML "deliveryQuantity" $ coalPhysicLeg_deliveryQuantity x+ ]+instance Extension CoalPhysicalLeg PhysicalSwapLeg where+ supertype v = PhysicalSwapLeg_CoalPhysicalLeg v+instance Extension CoalPhysicalLeg CommoditySwapLeg where+ supertype = (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)+ . (supertype :: CoalPhysicalLeg -> PhysicalSwapLeg)+ +instance Extension CoalPhysicalLeg Leg where+ supertype = (supertype :: CommoditySwapLeg -> Leg)+ . (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)+ . (supertype :: CoalPhysicalLeg -> PhysicalSwapLeg)+ + +-- | A type defining the characteristics of the coal being +-- traded in a physically settled gas transaction.+data CoalProduct = CoalProduct+ { coalProduct_choice0 :: OneOf2 CoalProductType CoalProductSpecifications+ -- ^ Choice between:+ -- + -- (1) The type of coal product to be delivered by reference + -- to a pre-defined specification.+ -- + -- (2) The type of coal product to be delivered specified in + -- full.+ , coalProduct_source :: [CoalProductSource]+ -- ^ The mining region, mine(s), mining complex(es), loadout(s) + -- or river dock(s) or other point(s) of origin that Seller + -- and Buyer agree are acceptable origins for the Coal + -- Product. For International Coal transactions, this is the + -- Origin of the Coal Product.+ , coalProduct_btuQualityAdjustment :: Maybe CoalQualityAdjustments+ -- ^ The Quality Adjustment formula to be used where the Actual + -- Shipment BTU/Lb value differs from the Standard BTU/Lb + -- value.+ , coalProduct_so2QualityAdjustment :: Maybe CoalQualityAdjustments+ -- ^ The Quality Adjustment formula to be used where the Actual + -- Shipment SO2/MMBTU value differs from the Standard + -- SO2/MMBTU value.+ }+ deriving (Eq,Show)+instance SchemaType CoalProduct where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CoalProduct+ `apply` oneOf' [ ("CoalProductType", fmap OneOf2 (parseSchemaType "type"))+ , ("CoalProductSpecifications", fmap TwoOf2 (parseSchemaType "coalProductSpecifications"))+ ]+ `apply` many (parseSchemaType "source")+ `apply` optional (parseSchemaType "btuQualityAdjustment")+ `apply` optional (parseSchemaType "so2QualityAdjustment")+ schemaTypeToXML s x@CoalProduct{} =+ toXMLElement s []+ [ foldOneOf2 (schemaTypeToXML "type")+ (schemaTypeToXML "coalProductSpecifications")+ $ coalProduct_choice0 x+ , concatMap (schemaTypeToXML "source") $ coalProduct_source x+ , maybe [] (schemaTypeToXML "btuQualityAdjustment") $ coalProduct_btuQualityAdjustment x+ , maybe [] (schemaTypeToXML "so2QualityAdjustment") $ coalProduct_so2QualityAdjustment x+ ]+ +-- | A scheme identifying the sources of coal for a physically +-- settled coal trade.+data CoalProductSource = CoalProductSource Scheme CoalProductSourceAttributes deriving (Eq,Show)+data CoalProductSourceAttributes = CoalProductSourceAttributes+ { coalProductSourceAttrib_commodityCoalProductSourceScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CoalProductSource where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "commodityCoalProductSourceScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CoalProductSource v (CoalProductSourceAttributes a0)+ schemaTypeToXML s (CoalProductSource bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "commodityCoalProductSourceScheme") $ coalProductSourceAttrib_commodityCoalProductSourceScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CoalProductSource Scheme where+ supertype (CoalProductSource s _) = s+ +-- | The different options for specifying the quality attributes +-- of the coal to be delivered.+data CoalProductSpecifications = CoalProductSpecifications+ { coalProductSpecif_choice0 :: (Maybe (OneOf2 CoalStandardQuality CoalStandardQualitySchedule))+ -- ^ Choice between:+ -- + -- (1) standardQuality+ -- + -- (2) standardQualitySchedule+ }+ deriving (Eq,Show)+instance SchemaType CoalProductSpecifications where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CoalProductSpecifications+ `apply` optional (oneOf' [ ("CoalStandardQuality", fmap OneOf2 (parseSchemaType "standardQuality"))+ , ("CoalStandardQualitySchedule", fmap TwoOf2 (parseSchemaType "standardQualitySchedule"))+ ])+ schemaTypeToXML s x@CoalProductSpecifications{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "standardQuality")+ (schemaTypeToXML "standardQualitySchedule")+ ) $ coalProductSpecif_choice0 x+ ]+ +-- | A scheme identifying the types of coal for a physically +-- settled coal trade.+data CoalProductType = CoalProductType Scheme CoalProductTypeAttributes deriving (Eq,Show)+data CoalProductTypeAttributes = CoalProductTypeAttributes+ { coalProductTypeAttrib_commodityCoalProductTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CoalProductType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "commodityCoalProductTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CoalProductType v (CoalProductTypeAttributes a0)+ schemaTypeToXML s (CoalProductType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "commodityCoalProductTypeScheme") $ coalProductTypeAttrib_commodityCoalProductTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CoalProductType Scheme where+ supertype (CoalProductType s _) = s+ +-- | A scheme identifying the quality adjustment formulae for a +-- physically settled coal trade.+data CoalQualityAdjustments = CoalQualityAdjustments Scheme CoalQualityAdjustmentsAttributes deriving (Eq,Show)+data CoalQualityAdjustmentsAttributes = CoalQualityAdjustmentsAttributes+ { coalQualityAdjustAttrib_commodityCoalQualityAdjustmentsScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CoalQualityAdjustments where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "commodityCoalQualityAdjustmentsScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CoalQualityAdjustments v (CoalQualityAdjustmentsAttributes a0)+ schemaTypeToXML s (CoalQualityAdjustments bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "commodityCoalQualityAdjustmentsScheme") $ coalQualityAdjustAttrib_commodityCoalQualityAdjustmentsScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CoalQualityAdjustments Scheme where+ supertype (CoalQualityAdjustments s _) = s+ +-- | The quality attributes of the coal to be delivered.+data CoalStandardQuality = CoalStandardQuality+ { coalStdQuality_moisture :: Maybe CoalAttributePercentage+ -- ^ The moisture content of the coal product.+ , coalStdQuality_ash :: Maybe CoalAttributePercentage+ -- ^ The ash content of the coal product.+ , coalStdQuality_sulfur :: Maybe CoalAttributePercentage+ -- ^ The sulfur/sulphur content of the coal product.+ , coalStdQuality_sO2 :: Maybe CoalAttributePercentage+ -- ^ The sulfur/sulphur dioxide content of the coal product.+ , coalStdQuality_volatile :: Maybe CoalAttributePercentage+ -- ^ The volatile content of the coal product.+ , coalStdQuality_bTUperLB :: Maybe CoalAttributeDecimal+ -- ^ The number of British Thermal Units per Pound of the coal + -- product.+ , coalStdQuality_topSize :: Maybe CoalAttributeDecimal+ -- ^ The smallest sieve opening that will result in less than 5% + -- of a sample of the coal product remaining.+ , coalStdQuality_finesPassingScreen :: Maybe CoalAttributeDecimal+ , coalStdQuality_grindability :: Maybe CoalAttributeDecimal+ -- ^ The Hardgrove Grindability Index value of the coal to be + -- delivered.+ , coalStdQuality_ashFusionTemperature :: Maybe CoalAttributeDecimal+ -- ^ The temperature at which the ash form of the coal product + -- fuses completely in accordance with the ASTM International + -- D1857 Standard Test Methodology.+ , coalStdQuality_initialDeformation :: Maybe CoalAttributeDecimal+ -- ^ The temperature at which an ash cone shows evidence of + -- deformation.+ , coalStdQuality_softeningHeightWidth :: Maybe CoalAttributeDecimal+ -- ^ The temperature at which the height of an ash cone equals + -- its width. (Softening temperature).+ , coalStdQuality_softeningHeightHalfWidth :: Maybe CoalAttributeDecimal+ -- ^ The temperature at which the height of an ash cone equals + -- half its width. (Hemisphere temperature).+ , coalStdQuality_fluid :: Maybe CoalAttributeDecimal+ -- ^ The temperature at which the ash cone flattens.+ }+ deriving (Eq,Show)+instance SchemaType CoalStandardQuality where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CoalStandardQuality+ `apply` optional (parseSchemaType "moisture")+ `apply` optional (parseSchemaType "ash")+ `apply` optional (parseSchemaType "sulfur")+ `apply` optional (parseSchemaType "SO2")+ `apply` optional (parseSchemaType "volatile")+ `apply` optional (parseSchemaType "BTUperLB")+ `apply` optional (parseSchemaType "topSize")+ `apply` optional (parseSchemaType "finesPassingScreen")+ `apply` optional (parseSchemaType "grindability")+ `apply` optional (parseSchemaType "ashFusionTemperature")+ `apply` optional (parseSchemaType "initialDeformation")+ `apply` optional (parseSchemaType "softeningHeightWidth")+ `apply` optional (parseSchemaType "softeningHeightHalfWidth")+ `apply` optional (parseSchemaType "fluid")+ schemaTypeToXML s x@CoalStandardQuality{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "moisture") $ coalStdQuality_moisture x+ , maybe [] (schemaTypeToXML "ash") $ coalStdQuality_ash x+ , maybe [] (schemaTypeToXML "sulfur") $ coalStdQuality_sulfur x+ , maybe [] (schemaTypeToXML "SO2") $ coalStdQuality_sO2 x+ , maybe [] (schemaTypeToXML "volatile") $ coalStdQuality_volatile x+ , maybe [] (schemaTypeToXML "BTUperLB") $ coalStdQuality_bTUperLB x+ , maybe [] (schemaTypeToXML "topSize") $ coalStdQuality_topSize x+ , maybe [] (schemaTypeToXML "finesPassingScreen") $ coalStdQuality_finesPassingScreen x+ , maybe [] (schemaTypeToXML "grindability") $ coalStdQuality_grindability x+ , maybe [] (schemaTypeToXML "ashFusionTemperature") $ coalStdQuality_ashFusionTemperature x+ , maybe [] (schemaTypeToXML "initialDeformation") $ coalStdQuality_initialDeformation x+ , maybe [] (schemaTypeToXML "softeningHeightWidth") $ coalStdQuality_softeningHeightWidth x+ , maybe [] (schemaTypeToXML "softeningHeightHalfWidth") $ coalStdQuality_softeningHeightHalfWidth x+ , maybe [] (schemaTypeToXML "fluid") $ coalStdQuality_fluid x+ ]+ +-- | The quality attributes of the coal to be delivered, +-- specified on a periodic basis.+data CoalStandardQualitySchedule = CoalStandardQualitySchedule+ { coalStdQualitySched_standardQualityStep :: [CoalStandardQuality]+ , coalStdQualitySched_choice1 :: (Maybe (OneOf2 CalculationPeriodsReference CalculationPeriodsScheduleReference))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to the Delivery Periods + -- defined elsewhere.+ -- + -- (2) A pointer style reference to the Calculation Periods + -- Schedule defined elsewhere.+ }+ deriving (Eq,Show)+instance SchemaType CoalStandardQualitySchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CoalStandardQualitySchedule+ `apply` many (parseSchemaType "StandardQualityStep")+ `apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf2 (parseSchemaType "deliveryPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf2 (parseSchemaType "deliveryPeriodsScheduleReference"))+ ])+ schemaTypeToXML s x@CoalStandardQualitySchedule{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "StandardQualityStep") $ coalStdQualitySched_standardQualityStep x+ , maybe [] (foldOneOf2 (schemaTypeToXML "deliveryPeriodsReference")+ (schemaTypeToXML "deliveryPeriodsScheduleReference")+ ) $ coalStdQualitySched_choice1 x+ ]+ +-- | A scheme identifying the methods by which coal may be +-- transported.+data CoalTransportationEquipment = CoalTransportationEquipment Scheme CoalTransportationEquipmentAttributes deriving (Eq,Show)+data CoalTransportationEquipmentAttributes = CoalTransportationEquipmentAttributes+ { ctea_commodityCoalTransportationEquipmentScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CoalTransportationEquipment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "commodityCoalTransportationEquipmentScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CoalTransportationEquipment v (CoalTransportationEquipmentAttributes a0)+ schemaTypeToXML s (CoalTransportationEquipment bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "commodityCoalTransportationEquipmentScheme") $ ctea_commodityCoalTransportationEquipmentScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CoalTransportationEquipment Scheme where+ supertype (CoalTransportationEquipment s _) = s+ +-- | A type for defining exercise procedures associated with an +-- American style exercise of a commodity option.+data CommodityAmericanExercise = CommodityAmericanExercise+ { commodAmericExerc_ID :: Maybe Xsd.ID+ , commodAmericExerc_exercisePeriod :: [CommodityExercisePeriods]+ -- ^ Describes the American exercise periods.+ , commodAmericExerc_exerciseFrequency :: Maybe Frequency+ -- ^ The exercise frequency for the strip.+ , commodAmericExerc_choice2 :: (Maybe (OneOf2 BusinessCenterTime DeterminationMethod))+ -- ^ Choice between latest exercise time expressed as literal + -- time, or using a determination method.+ -- + -- Choice between:+ -- + -- (1) For a Bermuda or American style option, the latest time + -- on an exercise business day (excluding the expiration + -- date) within the exercise period that notice can be + -- given by the buyer to the seller or seller's agent. + -- Notice of exercise given after this time will be deemed + -- to have been given on the next exercise business day.+ -- + -- (2) Latest exercise time determination method.+ , commodAmericExerc_expirationTime :: Maybe BusinessCenterTime+ -- ^ The specific time of day on which the option expires.+ , commodAmericExerc_multipleExercise :: Maybe CommodityMultipleExercise+ -- ^ The presence of this element indicates that the option may + -- be partially exercised. It is not applicable to European or + -- Asian options.+ }+ deriving (Eq,Show)+instance SchemaType CommodityAmericanExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityAmericanExercise a0)+ `apply` many (parseSchemaType "exercisePeriod")+ `apply` optional (parseSchemaType "exerciseFrequency")+ `apply` optional (oneOf' [ ("BusinessCenterTime", fmap OneOf2 (parseSchemaType "latestExerciseTime"))+ , ("DeterminationMethod", fmap TwoOf2 (parseSchemaType "latestExerciseTimeDetermination"))+ ])+ `apply` optional (parseSchemaType "expirationTime")+ `apply` optional (parseSchemaType "multipleExercise")+ schemaTypeToXML s x@CommodityAmericanExercise{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodAmericExerc_ID x+ ]+ [ concatMap (schemaTypeToXML "exercisePeriod") $ commodAmericExerc_exercisePeriod x+ , maybe [] (schemaTypeToXML "exerciseFrequency") $ commodAmericExerc_exerciseFrequency x+ , maybe [] (foldOneOf2 (schemaTypeToXML "latestExerciseTime")+ (schemaTypeToXML "latestExerciseTimeDetermination")+ ) $ commodAmericExerc_choice2 x+ , maybe [] (schemaTypeToXML "expirationTime") $ commodAmericExerc_expirationTime x+ , maybe [] (schemaTypeToXML "multipleExercise") $ commodAmericExerc_multipleExercise x+ ]+instance Extension CommodityAmericanExercise Exercise where+ supertype v = Exercise_CommodityAmericanExercise v+ +-- | A parametric representation of the Calculation Periods for +-- on Asian option or a leg of a swap. In case the calculation +-- frequency is of value T (term), the period is defined by +-- the commoditySwap\effectiveDate and the +-- commoditySwap\terminationDate.+data CommodityCalculationPeriodsSchedule = CommodityCalculationPeriodsSchedule+ { ccps_ID :: Maybe Xsd.ID+ , ccps_periodMultiplier :: Maybe Xsd.PositiveInteger+ -- ^ A time period multiplier, e.g. 1, 2 or 3 etc. If the period + -- value is T (Term) then periodMultiplier must contain the + -- value 1.+ , ccps_period :: Maybe PeriodExtendedEnum+ -- ^ A time period, e.g. a day, week, month, year or term of the + -- stream.+ , ccps_balanceOfFirstPeriod :: Maybe Xsd.Boolean+ -- ^ If true, indicates that that the first Calculation Period + -- should run from the Effective Date to the end of the + -- calendar period in which the Effective Date falls, e.g. Jan + -- 15 - Jan 31 if the calculation periods are one month long + -- and Effective Date is Jan 15. If false, the first + -- Calculation Period should run from the Effective Date for + -- one whole period, e.g. Jan 15 to Feb 14 if the calculation + -- periods are one month long and Effective Date is Jan 15.+ }+ deriving (Eq,Show)+instance SchemaType CommodityCalculationPeriodsSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityCalculationPeriodsSchedule a0)+ `apply` optional (parseSchemaType "periodMultiplier")+ `apply` optional (parseSchemaType "period")+ `apply` optional (parseSchemaType "balanceOfFirstPeriod")+ schemaTypeToXML s x@CommodityCalculationPeriodsSchedule{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ ccps_ID x+ ]+ [ maybe [] (schemaTypeToXML "periodMultiplier") $ ccps_periodMultiplier x+ , maybe [] (schemaTypeToXML "period") $ ccps_period x+ , maybe [] (schemaTypeToXML "balanceOfFirstPeriod") $ ccps_balanceOfFirstPeriod x+ ]+instance Extension CommodityCalculationPeriodsSchedule Frequency where+ supertype (CommodityCalculationPeriodsSchedule a0 e0 e1 e2) =+ Frequency a0 e0 e1+ +-- | The different options for specifying the Delivery Periods +-- of a physical leg.+data CommodityDeliveryPeriods = CommodityDeliveryPeriods+ { commodDelivPeriods_ID :: Maybe Xsd.ID+ , commodDelivPeriods_choice0 :: OneOf3 AdjustableDates CommodityCalculationPeriodsSchedule ((Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference)))+ -- ^ Choice between:+ -- + -- (1) The Delivery Periods for this leg of the swap. This + -- type is only intended to be used if the Delivery + -- Periods differ from the Calculation Periods on the + -- fixed or floating leg. If DeliveryPeriods mirror + -- another leg, then the calculationPeriodsReference + -- element should be used to point to the Calculation + -- Periods on that leg - or the + -- calculationPeriodsScheduleReference can be used to + -- point to the Calculation Periods Schedule for that leg.+ -- + -- (2) The Delivery Periods for this leg of the swap. This + -- type is only intended to be used if the Delivery + -- Periods differ from the Calculation Periods on the + -- fixed or floating leg. If DeliveryPeriods mirror + -- another leg, then the calculationPeriodsReference + -- element should be used to point to the Calculation + -- Periods on that leg - or the + -- calculationPeriodsScheduleReference can be used to + -- point to the Calculation Periods Schedule for that leg.+ -- + -- (3) unknown+ }+ deriving (Eq,Show)+instance SchemaType CommodityDeliveryPeriods where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityDeliveryPeriods a0)+ `apply` oneOf' [ ("AdjustableDates", fmap OneOf3 (parseSchemaType "periods"))+ , ("CommodityCalculationPeriodsSchedule", fmap TwoOf3 (parseSchemaType "periodsSchedule"))+ , ("(Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))", fmap ThreeOf3 (optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))+ , ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))+ ])))+ ]+ schemaTypeToXML s x@CommodityDeliveryPeriods{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodDelivPeriods_ID x+ ]+ [ foldOneOf3 (schemaTypeToXML "periods")+ (schemaTypeToXML "periodsSchedule")+ (maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")+ (schemaTypeToXML "calculationPeriodsScheduleReference")+ (schemaTypeToXML "calculationPeriodsDatesReference")+ ))+ $ commodDelivPeriods_choice0 x+ ]+ +-- | A scheme identifying the types of the Delivery Point for a +-- physically settled commodity trade.+data CommodityDeliveryPoint = CommodityDeliveryPoint Scheme CommodityDeliveryPointAttributes deriving (Eq,Show)+data CommodityDeliveryPointAttributes = CommodityDeliveryPointAttributes+ { commodDelivPointAttrib_deliveryPointScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CommodityDeliveryPoint where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "deliveryPointScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CommodityDeliveryPoint v (CommodityDeliveryPointAttributes a0)+ schemaTypeToXML s (CommodityDeliveryPoint bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "deliveryPointScheme") $ commodDelivPointAttrib_deliveryPointScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CommodityDeliveryPoint Scheme where+ supertype (CommodityDeliveryPoint s _) = s+ +-- | A scheme identifying how the parties to the trade aportion +-- responsibility for the delivery of the commodity product +-- (for example Free On Board, Cost, Insurance, Freight)+data CommodityDeliveryRisk = CommodityDeliveryRisk Scheme CommodityDeliveryRiskAttributes deriving (Eq,Show)+data CommodityDeliveryRiskAttributes = CommodityDeliveryRiskAttributes+ { commodDelivRiskAttrib_deliveryRiskScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CommodityDeliveryRisk where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "deliveryRiskScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CommodityDeliveryRisk v (CommodityDeliveryRiskAttributes a0)+ schemaTypeToXML s (CommodityDeliveryRisk bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "deliveryRiskScheme") $ commodDelivRiskAttrib_deliveryRiskScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CommodityDeliveryRisk Scheme where+ supertype (CommodityDeliveryRisk s _) = s+ +-- | A type for defining exercise procedures associated with a +-- European style exercise of a commodity option.+data CommodityEuropeanExercise = CommodityEuropeanExercise+ { commodEuropExerc_ID :: Maybe Xsd.ID+ , commodEuropExerc_expirationDate :: [AdjustableOrRelativeDate]+ -- ^ The last day within an exercise period for an American + -- style option. For a European style option it is the only + -- day within the exercise period. For an averaging option + -- this is equivalent to the Termination Date.+ , commodEuropExerc_exerciseFrequency :: Maybe Frequency+ -- ^ The exercise frequency for the strip.+ , commodEuropExerc_expirationTime :: Maybe BusinessCenterTime+ -- ^ The specific time of day on which the option expires.+ }+ deriving (Eq,Show)+instance SchemaType CommodityEuropeanExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityEuropeanExercise a0)+ `apply` many (parseSchemaType "expirationDate")+ `apply` optional (parseSchemaType "exerciseFrequency")+ `apply` optional (parseSchemaType "expirationTime")+ schemaTypeToXML s x@CommodityEuropeanExercise{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodEuropExerc_ID x+ ]+ [ concatMap (schemaTypeToXML "expirationDate") $ commodEuropExerc_expirationDate x+ , maybe [] (schemaTypeToXML "exerciseFrequency") $ commodEuropExerc_exerciseFrequency x+ , maybe [] (schemaTypeToXML "expirationTime") $ commodEuropExerc_expirationTime x+ ]+instance Extension CommodityEuropeanExercise Exercise where+ supertype v = Exercise_CommodityEuropeanExercise v+ +-- | The parameters for defining how the commodity option can be +-- exercised, how it is priced and how it is settled.+data CommodityExercise = CommodityExercise+ { commodExerc_choice0 :: (Maybe (OneOf2 CommodityAmericanExercise CommodityEuropeanExercise))+ -- ^ Choice between:+ -- + -- (1) The parameters for defining the exercise period for an + -- American style option together with the rules governing + -- the quantity of the commodity that can be exercised on + -- any given exercise date.+ -- + -- (2) The parameters for defining the expiration date and + -- time for a European or Asian style option. For an Asian + -- style option the expiration date is equivalent to the + -- termination date.+ , commodExerc_automaticExercise :: Maybe Xsd.Boolean+ -- ^ Specifies whether or not Automatic Exercise applies to a + -- Commodity Option Transaction.+ , commodExerc_writtenConfirmation :: Maybe Xsd.Boolean+ -- ^ Specifies whether or not Written Confirmation applies to a + -- Commodity Option Transaction.+ , commodExerc_settlementCurrency :: Maybe IdentifiedCurrency+ -- ^ The currency into which the Commodity Option Transaction + -- will settle. If this is not the same as the currency in + -- which the Commodity Reference Price is quoted, then an FX + -- determination method should also be specified.+ , commodExerc_fx :: Maybe CommodityFx+ -- ^ FX observations to be used to convert the observed + -- Commodity Reference Price to the Settlement Currency.+ , commodExerc_conversionFactor :: Maybe Xsd.Decimal+ -- ^ If the Notional Quantity is specified in a unit that does + -- not match the unit in which the Commodity Reference Price + -- is quoted, the scaling or conversion factor used to convert + -- the Commodity Reference Price unit into the Notional + -- Quantity unit should be stated here. If there is no + -- conversion, this element is not intended to be used.+ , commodExerc_choice6 :: OneOf2 CommodityRelativePaymentDates ((Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean)))+ -- ^ Choice between:+ -- + -- (1) The Payment Dates of the trade relative to the + -- Calculation Periods.+ -- + -- (2) unknown+ }+ deriving (Eq,Show)+instance SchemaType CommodityExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CommodityExercise+ `apply` optional (oneOf' [ ("CommodityAmericanExercise", fmap OneOf2 (parseSchemaType "americanExercise"))+ , ("CommodityEuropeanExercise", fmap TwoOf2 (parseSchemaType "europeanExercise"))+ ])+ `apply` optional (parseSchemaType "automaticExercise")+ `apply` optional (parseSchemaType "writtenConfirmation")+ `apply` optional (parseSchemaType "settlementCurrency")+ `apply` optional (parseSchemaType "fx")+ `apply` optional (parseSchemaType "conversionFactor")+ `apply` oneOf' [ ("CommodityRelativePaymentDates", fmap OneOf2 (parseSchemaType "relativePaymentDates"))+ , ("(Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean))", fmap TwoOf2 (optional (oneOf' [ ("AdjustableDatesOrRelativeDateOffset", fmap OneOf2 (parseSchemaType "paymentDates"))+ , ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "masterAgreementPaymentDates"))+ ])))+ ]+ schemaTypeToXML s x@CommodityExercise{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "americanExercise")+ (schemaTypeToXML "europeanExercise")+ ) $ commodExerc_choice0 x+ , maybe [] (schemaTypeToXML "automaticExercise") $ commodExerc_automaticExercise x+ , maybe [] (schemaTypeToXML "writtenConfirmation") $ commodExerc_writtenConfirmation x+ , maybe [] (schemaTypeToXML "settlementCurrency") $ commodExerc_settlementCurrency x+ , maybe [] (schemaTypeToXML "fx") $ commodExerc_fx x+ , maybe [] (schemaTypeToXML "conversionFactor") $ commodExerc_conversionFactor x+ , foldOneOf2 (schemaTypeToXML "relativePaymentDates")+ (maybe [] (foldOneOf2 (schemaTypeToXML "paymentDates")+ (schemaTypeToXML "masterAgreementPaymentDates")+ ))+ $ commodExerc_choice6 x+ ]+ +data CommodityExercisePeriods = CommodityExercisePeriods+ { commodExercPeriods_commencementDate :: Maybe AdjustableOrRelativeDate+ -- ^ The first day of the exercise period for an American style + -- option.+ , commodExercPeriods_expirationDate :: Maybe AdjustableOrRelativeDate+ -- ^ The last day within an exercise period for an American + -- style option. For a European style option it is the only + -- day within the exercise period.+ }+ deriving (Eq,Show)+instance SchemaType CommodityExercisePeriods where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CommodityExercisePeriods+ `apply` optional (parseSchemaType "commencementDate")+ `apply` optional (parseSchemaType "expirationDate")+ schemaTypeToXML s x@CommodityExercisePeriods{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "commencementDate") $ commodExercPeriods_commencementDate x+ , maybe [] (schemaTypeToXML "expirationDate") $ commodExercPeriods_expirationDate x+ ]+ +-- | A scheme identifying the physical event relative to which +-- option expiration occurs.+data CommodityExpireRelativeToEvent = CommodityExpireRelativeToEvent Scheme CommodityExpireRelativeToEventAttributes deriving (Eq,Show)+data CommodityExpireRelativeToEventAttributes = CommodityExpireRelativeToEventAttributes+ { certea_commodityExpireRelativeToEventScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CommodityExpireRelativeToEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "commodityExpireRelativeToEventScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CommodityExpireRelativeToEvent v (CommodityExpireRelativeToEventAttributes a0)+ schemaTypeToXML s (CommodityExpireRelativeToEvent bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "commodityExpireRelativeToEventScheme") $ certea_commodityExpireRelativeToEventScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CommodityExpireRelativeToEvent Scheme where+ supertype (CommodityExpireRelativeToEvent s _) = s+ +-- | Commodity Forward+data CommodityForward = CommodityForward+ { commodForward_ID :: Maybe Xsd.ID+ , commodForward_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , commodForward_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , commodForward_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , commodForward_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , commodForward_valueDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the value date of the Commodity Forward + -- Transaction. This is the day on which both the cash and the + -- physical commodity settle.+ , commodForward_fixedLeg :: Maybe NonPeriodicFixedPriceLeg+ -- ^ The fixed leg of a Commodity Forward Transaction+ , commodityForward_leg :: Maybe CommodityForwardLeg+ -- ^ Defines the substitutable commodity forward leg+ , commodForward_commonPricing :: Maybe Xsd.Boolean+ -- ^ Common pricing may be relevant for a Transaction that + -- references more than one Commodity Reference Price. If + -- Common Pricing is not specified as applicable, it will be + -- deemed not to apply.+ , commodForward_marketDisruption :: Maybe CommodityMarketDisruption+ -- ^ Market disruption events as defined in the ISDA 1993 + -- Commodity Definitions or in ISDA 2005 Commodity + -- Definitions, as applicable.+ , commodForward_settlementDisruption :: Maybe CommodityBullionSettlementDisruptionEnum+ -- ^ The consequences of Bullion Settlement Disruption Events.+ , commodForward_rounding :: Maybe Rounding+ -- ^ Rounding direction and precision for amounts.+ }+ deriving (Eq,Show)+instance SchemaType CommodityForward where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityForward a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` optional (parseSchemaType "valueDate")+ `apply` optional (parseSchemaType "fixedLeg")+ `apply` optional (elementCommodityForwardLeg)+ `apply` optional (parseSchemaType "commonPricing")+ `apply` optional (parseSchemaType "marketDisruption")+ `apply` optional (parseSchemaType "settlementDisruption")+ `apply` optional (parseSchemaType "rounding")+ schemaTypeToXML s x@CommodityForward{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodForward_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ commodForward_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ commodForward_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ commodForward_productType x+ , concatMap (schemaTypeToXML "productId") $ commodForward_productId x+ , maybe [] (schemaTypeToXML "valueDate") $ commodForward_valueDate x+ , maybe [] (schemaTypeToXML "fixedLeg") $ commodForward_fixedLeg x+ , maybe [] (elementToXMLCommodityForwardLeg) $ commodityForward_leg x+ , maybe [] (schemaTypeToXML "commonPricing") $ commodForward_commonPricing x+ , maybe [] (schemaTypeToXML "marketDisruption") $ commodForward_marketDisruption x+ , maybe [] (schemaTypeToXML "settlementDisruption") $ commodForward_settlementDisruption x+ , maybe [] (schemaTypeToXML "rounding") $ commodForward_rounding x+ ]+instance Extension CommodityForward Product where+ supertype v = Product_CommodityForward v+ +-- | The Fixed Price for a given Calculation Period during the +-- life of the trade. There must be a Fixed Price step +-- specified for each Calculation Period, regardless of +-- whether the Fixed Price changes or remains the same between +-- periods.+data CommodityFixedPriceSchedule = CommodityFixedPriceSchedule+ { commodFixedPriceSched_choice0 :: (Maybe (OneOf4 [FixedPrice] [Xsd.Decimal] [NonNegativeMoney] [CommoditySettlementPeriodsPriceSchedule]))+ -- ^ Choice between:+ -- + -- (1) The Fixed Price for a given Calculation Period during + -- the life of the trade. There must be a Fixed Price step + -- specified for each Calculation Period, regardless of + -- whether the Fixed Price changes or remains the same + -- between periods.+ -- + -- (2) For a Wet Voyager Charter Freight Swap, the number of + -- Worldscale Points for purposes of the calculation of a + -- Fixed Amount for a given Calculation Period during the + -- life of the trade. There must be Worldscale Rate Step + -- specified for each Calculation Period, regardless of + -- whether the Worldscale Rate Step changes or remains the + -- same between periods.+ -- + -- (3) For a DRY Voyage Charter or Time Charter Freight Swap, + -- the price per relevant unit for pruposes of the + -- calculation of a Fixed Amount for a given Calculation + -- Period during the life of the trade. There must be + -- Worldscale Rate Step specified for each Calculation + -- Period, regardless of whether the Worldscale Rate Step + -- changes or remains the same between periods.+ -- + -- (4) For an electricity transaction, the fixed price + -- schedule for one or more groups of Settlement Periods + -- on which fixed payments are based. if the schedule + -- differs for different groups of Settlement Periods, + -- this element should be repeated.+ , commodFixedPriceSched_choice1 :: (Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to the Calculation Periods + -- defined on another leg.+ -- + -- (2) A pointer style reference to the Calculation Periods + -- Schedule defined on another leg.+ -- + -- (3) A pointer style reference to single-day-duration + -- Calculation Periods defined on another leg.+ }+ deriving (Eq,Show)+instance SchemaType CommodityFixedPriceSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CommodityFixedPriceSchedule+ `apply` optional (oneOf' [ ("[FixedPrice]", fmap OneOf4 (many1 (parseSchemaType "fixedPriceStep")))+ , ("[Xsd.Decimal]", fmap TwoOf4 (many1 (parseSchemaType "worldscaleRateStep")))+ , ("[NonNegativeMoney]", fmap ThreeOf4 (many1 (parseSchemaType "contractRateStep")))+ , ("[CommoditySettlementPeriodsPriceSchedule]", fmap FourOf4 (many1 (parseSchemaType "settlementPeriodsPriceSchedule")))+ ])+ `apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))+ , ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))+ ])+ schemaTypeToXML s x@CommodityFixedPriceSchedule{} =+ toXMLElement s []+ [ maybe [] (foldOneOf4 (concatMap (schemaTypeToXML "fixedPriceStep"))+ (concatMap (schemaTypeToXML "worldscaleRateStep"))+ (concatMap (schemaTypeToXML "contractRateStep"))+ (concatMap (schemaTypeToXML "settlementPeriodsPriceSchedule"))+ ) $ commodFixedPriceSched_choice0 x+ , maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")+ (schemaTypeToXML "calculationPeriodsScheduleReference")+ (schemaTypeToXML "calculationPeriodsDatesReference")+ ) $ commodFixedPriceSched_choice1 x+ ]+ +-- | Abstract base class for all commodity forward legs+data CommodityForwardLeg+ = CommodityForwardLeg_PhysicalForwardLeg PhysicalForwardLeg+ + deriving (Eq,Show)+instance SchemaType CommodityForwardLeg where+ parseSchemaType s = do+ (fmap CommodityForwardLeg_PhysicalForwardLeg $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of CommodityForwardLeg,\n\+\ namely one of:\n\+\PhysicalForwardLeg"+ schemaTypeToXML _s (CommodityForwardLeg_PhysicalForwardLeg x) = schemaTypeToXML "physicalForwardLeg" x+instance Extension CommodityForwardLeg Leg where+ supertype v = Leg_CommodityForwardLeg v+ +-- | Frequency Type for use in Pricing Date specifications.+data CommodityFrequencyType = CommodityFrequencyType Scheme CommodityFrequencyTypeAttributes deriving (Eq,Show)+data CommodityFrequencyTypeAttributes = CommodityFrequencyTypeAttributes+ { commodFrequTypeAttrib_commodityFrequencyTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CommodityFrequencyType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "commodityFrequencyTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CommodityFrequencyType v (CommodityFrequencyTypeAttributes a0)+ schemaTypeToXML s (CommodityFrequencyType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "commodityFrequencyTypeScheme") $ commodFrequTypeAttrib_commodityFrequencyTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CommodityFrequencyType Scheme where+ supertype (CommodityFrequencyType s _) = s+ +-- | A type defining the FX observations to be used to convert +-- the observed Commodity Reference Price to the Settlement +-- Currency. The rate source must be specified. Additionally, +-- a time for the spot price to be observed on that source may +-- be specified, or else an averaging schedule for trades +-- priced using an average FX rate.+data CommodityFx = CommodityFx+ { commodityFx_primaryRateSource :: Maybe InformationSource+ -- ^ The primary source for where the rate observation will + -- occur. Will typically be either a page or a reference bank + -- published rate.+ , commodityFx_secondaryRateSource :: Maybe InformationSource+ -- ^ An alternative, or secondary, source for where the rate + -- observation will occur. Will typically be either a page or + -- a reference bank published rate.+ , commodityFx_fxType :: Maybe CommodityFxType+ -- ^ A type to identify how the FX rate will be applied. This is + -- intended to differentiate between the various methods for + -- applying FX to the floating price such as a daily + -- calculation, or averaging the FX and applying the average + -- at the end of each CalculationPeriod.+ , commodityFx_averagingMethod :: Maybe AveragingMethodEnum+ -- ^ The parties may specify a Method of Averaging when + -- averaging of the FX rate is applicable.+ , commodityFx_choice4 :: OneOf2 [AdjustableDates] ((Maybe (CommodityDayTypeEnum)),((Maybe (OneOf2 ((Maybe (CommodityFrequencyType)),(Maybe (Xsd.PositiveInteger))) ([DayOfWeekEnum],(Maybe (Xsd.Integer)))))),((Maybe (OneOf2 Lag LagReference))),((Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))))+ -- ^ Choice between:+ -- + -- (1) A list of the fx observation dates for a given + -- Calculation Period.+ -- + -- (2) Sequence of:+ -- + -- * The type of day on which pricing occurs.+ -- + -- * unknown+ -- + -- * unknown+ -- + -- * unknown+ , commodityFx_fixingTime :: Maybe BusinessCenterTime+ -- ^ The time at which the spot currency exchange rate will be + -- observed. It is specified as a time in a specific business + -- center, e.g. 11:00am London time.+ }+ deriving (Eq,Show)+instance SchemaType CommodityFx where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CommodityFx+ `apply` optional (parseSchemaType "primaryRateSource")+ `apply` optional (parseSchemaType "secondaryRateSource")+ `apply` optional (parseSchemaType "fxType")+ `apply` optional (parseSchemaType "averagingMethod")+ `apply` oneOf' [ ("[AdjustableDates]", fmap OneOf2 (many1 (parseSchemaType "fxObservationDates")))+ , ("Maybe CommodityDayTypeEnum (Maybe (OneOf2 ((Maybe (CommodityFrequencyType)),(Maybe (Xsd.PositiveInteger))) ([DayOfWeekEnum],(Maybe (Xsd.Integer))))) (Maybe (OneOf2 Lag LagReference)) (Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))", fmap TwoOf2 (return (,,,) `apply` optional (parseSchemaType "dayType")+ `apply` optional (oneOf' [ ("Maybe CommodityFrequencyType Maybe Xsd.PositiveInteger", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "dayDistribution")+ `apply` optional (parseSchemaType "dayCount")))+ , ("[DayOfWeekEnum] Maybe Xsd.Integer", fmap TwoOf2 (return (,) `apply` between (Occurs (Just 0) (Just 7))+ (parseSchemaType "dayOfWeek")+ `apply` optional (parseSchemaType "dayNumber")))+ ])+ `apply` optional (oneOf' [ ("Lag", fmap OneOf2 (parseSchemaType "lag"))+ , ("LagReference", fmap TwoOf2 (parseSchemaType "lagReference"))+ ])+ `apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))+ , ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))+ ])))+ ]+ `apply` optional (parseSchemaType "fixingTime")+ schemaTypeToXML s x@CommodityFx{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "primaryRateSource") $ commodityFx_primaryRateSource x+ , maybe [] (schemaTypeToXML "secondaryRateSource") $ commodityFx_secondaryRateSource x+ , maybe [] (schemaTypeToXML "fxType") $ commodityFx_fxType x+ , maybe [] (schemaTypeToXML "averagingMethod") $ commodityFx_averagingMethod x+ , foldOneOf2 (concatMap (schemaTypeToXML "fxObservationDates"))+ (\ (a,b,c,d) -> concat [ maybe [] (schemaTypeToXML "dayType") a+ , maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "dayDistribution") a+ , maybe [] (schemaTypeToXML "dayCount") b+ ])+ (\ (a,b) -> concat [ concatMap (schemaTypeToXML "dayOfWeek") a+ , maybe [] (schemaTypeToXML "dayNumber") b+ ])+ ) b+ , maybe [] (foldOneOf2 (schemaTypeToXML "lag")+ (schemaTypeToXML "lagReference")+ ) c+ , maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")+ (schemaTypeToXML "calculationPeriodsScheduleReference")+ (schemaTypeToXML "calculationPeriodsDatesReference")+ ) d+ ])+ $ commodityFx_choice4 x+ , maybe [] (schemaTypeToXML "fixingTime") $ commodityFx_fixingTime x+ ]+ +-- | Identifes how the FX rate will be applied. This is intended +-- to differentiate between the various methods for applying +-- FX to the floating price such as a daily calculation, or +-- averaging the FX and applying the average at the end of +-- each CalculationPeriod.+data CommodityFxType = CommodityFxType Scheme CommodityFxTypeAttributes deriving (Eq,Show)+data CommodityFxTypeAttributes = CommodityFxTypeAttributes+ { commodFxTypeAttrib_commodityFxTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CommodityFxType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "commodityFxTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CommodityFxType v (CommodityFxTypeAttributes a0)+ schemaTypeToXML s (CommodityFxType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "commodityFxTypeScheme") $ commodFxTypeAttrib_commodityFxTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CommodityFxType Scheme where+ supertype (CommodityFxType s _) = s+ +-- | A type defining a hub or other reference for a physically +-- settled commodity trade.+data CommodityHub = CommodityHub+ { commodityHub_partyReference :: PartyReference+ -- ^ Reference to a party.+ , commodityHub_accountReference :: Maybe AccountReference+ -- ^ Reference to an account.+ , commodityHub_hubCode :: Maybe CommodityHubCode+ }+ deriving (Eq,Show)+instance SchemaType CommodityHub where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CommodityHub+ `apply` parseSchemaType "partyReference"+ `apply` optional (parseSchemaType "accountReference")+ `apply` optional (parseSchemaType "hubCode")+ schemaTypeToXML s x@CommodityHub{} =+ toXMLElement s []+ [ schemaTypeToXML "partyReference" $ commodityHub_partyReference x+ , maybe [] (schemaTypeToXML "accountReference") $ commodityHub_accountReference x+ , maybe [] (schemaTypeToXML "hubCode") $ commodityHub_hubCode x+ ]+ +-- | A scheme identifying the code for a hub or other reference +-- for a physically settled commodity trade.+data CommodityHubCode = CommodityHubCode Scheme CommodityHubCodeAttributes deriving (Eq,Show)+data CommodityHubCodeAttributes = CommodityHubCodeAttributes+ { commodHubCodeAttrib_hubCodeScheme :: Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CommodityHubCode where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- getAttribute "hubCodeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CommodityHubCode v (CommodityHubCodeAttributes a0)+ schemaTypeToXML s (CommodityHubCode bt at) =+ addXMLAttributes [ toXMLAttribute "hubCodeScheme" $ commodHubCodeAttrib_hubCodeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CommodityHubCode Scheme where+ supertype (CommodityHubCode s _) = s+ +-- | ISDA 1993 or 2005 commodity market disruption elements.+data CommodityMarketDisruption = CommodityMarketDisruption+ { commodMarketDisrup_choice0 :: (Maybe (OneOf2 ((Maybe (MarketDisruptionEventsEnum)),[MarketDisruptionEvent]) [MarketDisruptionEvent]))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * If Market disruption Events are stated to be + -- Applicable then the default Market Disruption + -- Events of Section 7.4(d)(i) of the ISDA Commodity + -- Definitions shall apply unless specific Market + -- Disruption Events are stated hereunder, in which + -- case these shall override the ISDA defaults. If + -- Market Disruption Events are stated to be Not + -- Applicable, Market Disruption Events are not + -- applicable to the trade at all. It is also possible + -- to reference the Market Disruption Events set out + -- in the relevant Master Agreement governing the + -- trade.+ -- + -- * To be used when marketDisruptionEvents is set to + -- "Applicable" and additional market disruption + -- events(s) apply to the default market disruption + -- events of Section 7.4(d)(i) of the ISDA Commodity + -- Definitions.+ -- + -- (2) Market disruption event(s) that apply. Note that these + -- should only be specified if the default market + -- disruption events of Section 7.4(d)(i) of the ISDA + -- Commodity Definitions are to be overridden.+ , commodMarketDisrup_choice1 :: (Maybe (OneOf2 DisruptionFallbacksEnum [SequencedDisruptionFallback]))+ -- ^ If omitted then the standard disruption fallbacks of + -- Section 7.5(d)(i) of the ISDA Commodity Definitions shall + -- apply.+ -- + -- Choice between:+ -- + -- (1) To be used where disruption fallbacks are set out in + -- the relevant Master Agreement governing the trade.+ -- + -- (2) disruptionFallback+ , commodMarketDisrup_fallbackReferencePrice :: Maybe Underlyer+ -- ^ A fallback commodity reference price for use when relying + -- on Disruption Fallbacks in Section 7.5(d)(i) of the ISDA + -- Commodity Definitions or have selected "Fallback Reference + -- Price" as a disruptionFallback.+ , commodMarketDisrup_maximumNumberOfDaysOfDisruption :: Maybe Xsd.NonNegativeInteger+ -- ^ 2005 Commodity Definitions only. If omitted , the number of + -- days specified in Section 7.6(a) of the Definitions will + -- apply.+ , commodMarketDisrup_priceMaterialityPercentage :: Maybe Xsd.Decimal+ -- ^ 2005 Commodity Definitions only. To be used where a price + -- materiality percentage applies to the "Price Source + -- Disruption" event and this event has been specified by + -- setting marketDisruption to true or including it in + -- additionalMarketDisruptionEvent+ , commodMarketDisrup_minimumFuturesContracts :: Maybe Xsd.PositiveInteger+ -- ^ 1993 Commodity Definitions only. Specifies the Mimum + -- Futures Contracts level that dictates whether or not a "De + -- Minimis Trading" event has occurred. Only relevant if 'De + -- Minimis Trading' has been specified in + -- marketDisruptionEvent or additionalMarketDisruptionEvent.+ }+ deriving (Eq,Show)+instance SchemaType CommodityMarketDisruption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CommodityMarketDisruption+ `apply` optional (oneOf' [ ("Maybe MarketDisruptionEventsEnum [MarketDisruptionEvent]", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "marketDisruptionEvents")+ `apply` many (parseSchemaType "additionalMarketDisruptionEvent")))+ , ("[MarketDisruptionEvent]", fmap TwoOf2 (many1 (parseSchemaType "marketDisruptionEvent")))+ ])+ `apply` optional (oneOf' [ ("DisruptionFallbacksEnum", fmap OneOf2 (parseSchemaType "disruptionFallbacks"))+ , ("[SequencedDisruptionFallback]", fmap TwoOf2 (many1 (parseSchemaType "disruptionFallback")))+ ])+ `apply` optional (parseSchemaType "fallbackReferencePrice")+ `apply` optional (parseSchemaType "maximumNumberOfDaysOfDisruption")+ `apply` optional (parseSchemaType "priceMaterialityPercentage")+ `apply` optional (parseSchemaType "minimumFuturesContracts")+ schemaTypeToXML s x@CommodityMarketDisruption{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "marketDisruptionEvents") a+ , concatMap (schemaTypeToXML "additionalMarketDisruptionEvent") b+ ])+ (concatMap (schemaTypeToXML "marketDisruptionEvent"))+ ) $ commodMarketDisrup_choice0 x+ , maybe [] (foldOneOf2 (schemaTypeToXML "disruptionFallbacks")+ (concatMap (schemaTypeToXML "disruptionFallback"))+ ) $ commodMarketDisrup_choice1 x+ , maybe [] (schemaTypeToXML "fallbackReferencePrice") $ commodMarketDisrup_fallbackReferencePrice x+ , maybe [] (schemaTypeToXML "maximumNumberOfDaysOfDisruption") $ commodMarketDisrup_maximumNumberOfDaysOfDisruption x+ , maybe [] (schemaTypeToXML "priceMaterialityPercentage") $ commodMarketDisrup_priceMaterialityPercentage x+ , maybe [] (schemaTypeToXML "minimumFuturesContracts") $ commodMarketDisrup_minimumFuturesContracts x+ ]+ +-- | A type for defining the multiple exercise provisions of an +-- American style commodity option.+data CommodityMultipleExercise = CommodityMultipleExercise+ { commodMultiExerc_integralMultipleQuantity :: Maybe CommodityNotionalQuantity+ -- ^ The integral multiple quantity defines a lower limit of the + -- Notional Quantity that can be exercised and also defines a + -- unit multiple of the Notional Quantity that can be + -- exercised, i.e. only integer multiples of this Notional + -- Quantity can be exercised.+ , commodMultiExerc_minimumNotionalQuantity :: Maybe CommodityNotionalQuantity+ -- ^ The minimum Notional Quantity that can be exercised on a + -- given Exercise Date. See multipleExercise.+ }+ deriving (Eq,Show)+instance SchemaType CommodityMultipleExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CommodityMultipleExercise+ `apply` optional (parseSchemaType "integralMultipleQuantity")+ `apply` optional (parseSchemaType "minimumNotionalQuantity")+ schemaTypeToXML s x@CommodityMultipleExercise{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "integralMultipleQuantity") $ commodMultiExerc_integralMultipleQuantity x+ , maybe [] (schemaTypeToXML "minimumNotionalQuantity") $ commodMultiExerc_minimumNotionalQuantity x+ ]+ +-- | Commodity Notional.+data CommodityNotionalQuantity = CommodityNotionalQuantity+ { commodNotionQuant_ID :: Maybe Xsd.ID+ , commodNotionQuant_quantityUnit :: QuantityUnit+ -- ^ Quantity Unit is the unit of measure applicable for the + -- quantity on the Transaction.+ , commodNotionQuant_quantityFrequency :: Maybe CommodityQuantityFrequency+ -- ^ The frequency at which the Notional Quantity is deemed to + -- apply for purposes of calculating the Total Notional + -- Quantity.+ , commodNotionQuant_quantity :: Maybe Xsd.Decimal+ -- ^ Amount of commodity per quantity frequency.+ }+ deriving (Eq,Show)+instance SchemaType CommodityNotionalQuantity where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityNotionalQuantity a0)+ `apply` parseSchemaType "quantityUnit"+ `apply` optional (parseSchemaType "quantityFrequency")+ `apply` optional (parseSchemaType "quantity")+ schemaTypeToXML s x@CommodityNotionalQuantity{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodNotionQuant_ID x+ ]+ [ schemaTypeToXML "quantityUnit" $ commodNotionQuant_quantityUnit x+ , maybe [] (schemaTypeToXML "quantityFrequency") $ commodNotionQuant_quantityFrequency x+ , maybe [] (schemaTypeToXML "quantity") $ commodNotionQuant_quantity x+ ]+ +-- | The Notional Quantity per Calculation Period. There must be +-- a Notional Quantity step specified for each Calculation +-- Period, regardless of whether the Notional Quantity changes +-- or remains the same between periods.+data CommodityNotionalQuantitySchedule = CommodityNotionalQuantitySchedule+ { commodNotionQuantSched_ID :: Maybe Xsd.ID+ , commodNotionQuantSched_choice0 :: (Maybe (OneOf2 [CommodityNotionalQuantity] [CommoditySettlementPeriodsNotionalQuantitySchedule]))+ -- ^ Choice between:+ -- + -- (1) The Notional Quantity per Calculation Period. There + -- must be a Notional Quantity specified for each + -- Calculation Period, regardless of whether the quantity + -- changes or remains the same between periods.+ -- + -- (2) For an electricity transaction, the Notional Quantity + -- schedule for a one or more groups of Settlement Periods + -- to which the Notional Quantity is based. If the + -- schedule differs for different groups of Settlement + -- Periods, this element should be repeated.+ , commodNotionQuantSched_choice1 :: (Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to the Calculation Periods + -- defined on another leg.+ -- + -- (2) A pointer style reference to the Calculation Periods + -- Schedule defined on another leg.+ -- + -- (3) A pointer style reference to single-day-duration + -- Calculation Periods defined on another leg.+ }+ deriving (Eq,Show)+instance SchemaType CommodityNotionalQuantitySchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityNotionalQuantitySchedule a0)+ `apply` optional (oneOf' [ ("[CommodityNotionalQuantity]", fmap OneOf2 (many1 (parseSchemaType "notionalStep")))+ , ("[CommoditySettlementPeriodsNotionalQuantitySchedule]", fmap TwoOf2 (many1 (parseSchemaType "settlementPeriodsNotionalQuantitySchedule")))+ ])+ `apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))+ , ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))+ ])+ schemaTypeToXML s x@CommodityNotionalQuantitySchedule{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodNotionQuantSched_ID x+ ]+ [ maybe [] (foldOneOf2 (concatMap (schemaTypeToXML "notionalStep"))+ (concatMap (schemaTypeToXML "settlementPeriodsNotionalQuantitySchedule"))+ ) $ commodNotionQuantSched_choice0 x+ , maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")+ (schemaTypeToXML "calculationPeriodsScheduleReference")+ (schemaTypeToXML "calculationPeriodsDatesReference")+ ) $ commodNotionQuantSched_choice1 x+ ]+ +-- | Commodity Option.+data CommodityOption = CommodityOption+ { commodOption_ID :: Maybe Xsd.ID+ , commodOption_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , commodOption_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , commodOption_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , commodOption_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , commodOption_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , commodOption_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , commodOption_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , commodOption_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , commodOption_optionType :: Maybe PutCallEnum+ -- ^ The type of option transaction.+ , commodOption_choice9 :: OneOf2 ((Maybe (Commodity)),(Maybe (AdjustableOrRelativeDate)),((Maybe (OneOf2 CommodityCalculationPeriodsSchedule AdjustableDates))),(Maybe (CommodityPricingDates)),(Maybe (AveragingMethodEnum)),(OneOf2 ((OneOf3 CommodityNotionalQuantitySchedule CommodityNotionalQuantity [CommoditySettlementPeriodsNotionalQuantity]),Xsd.Decimal) QuantityReference),(Maybe (CommodityExercise)),(OneOf2 NonNegativeMoney CommodityStrikeSchedule)) (((Maybe (OneOf2 CommoditySwap CommodityForward))),(Maybe (CommodityPhysicalExercise)))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * Specifies the underlying component. At the time of + -- the initial schema design, only underlyers of type + -- Commodity are supported; the choice group in the + -- future could offer the possibility of adding other + -- types later.+ -- + -- * The effective date of the Commodity Option + -- Transaction. Note that the Termination/Expiration + -- Date should be specified in expirationDate within + -- the CommodityAmericanExercise type or the + -- CommodityEuropeanExercise type, as applicable.+ -- + -- * unknown+ -- + -- * The dates on which the option will price.+ -- + -- * The Method of Averaging if there is more than one + -- Pricing Date.+ -- + -- * unknown+ -- + -- * The parameters for defining how the commodity + -- option can be exercised and how it is settled.+ -- + -- * unknown+ -- + -- (2) Sequence of:+ -- + -- * unknown+ -- + -- * The parameters for defining how the commodity + -- option can be exercised into a physical + -- transaction.+ , commodOption_premium :: [CommodityPremium]+ -- ^ The option premium payable by the buyer to the seller.+ , commodOption_commonPricing :: Maybe Xsd.Boolean+ -- ^ Common pricing may be relevant for a Transaction that + -- references more than one Commodity Reference Price. If + -- Common Pricing is not specified as applicable, it will be + -- deemed not to apply.+ , commodOption_marketDisruption :: Maybe CommodityMarketDisruption+ -- ^ Market disruption events as defined in the ISDA 1993 + -- Commodity Definitions or in ISDA 2005 Commodity + -- Definitions, as applicable.+ , commodOption_settlementDisruption :: Maybe CommodityBullionSettlementDisruptionEnum+ -- ^ The consequences of Bullion Settlement Disruption Events.+ , commodOption_rounding :: Maybe Rounding+ -- ^ Rounding direction and precision for amounts.+ }+ deriving (Eq,Show)+instance SchemaType CommodityOption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityOption 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 (parseSchemaType "optionType")+ `apply` oneOf' [ ("Maybe Commodity Maybe AdjustableOrRelativeDate (Maybe (OneOf2 CommodityCalculationPeriodsSchedule AdjustableDates)) Maybe CommodityPricingDates Maybe AveragingMethodEnum OneOf2 ((OneOf3 CommodityNotionalQuantitySchedule CommodityNotionalQuantity [CommoditySettlementPeriodsNotionalQuantity]),Xsd.Decimal) QuantityReference Maybe CommodityExercise OneOf2 NonNegativeMoney CommodityStrikeSchedule", fmap OneOf2 (return (,,,,,,,) `apply` optional (parseSchemaType "commodity")+ `apply` optional (parseSchemaType "effectiveDate")+ `apply` optional (oneOf' [ ("CommodityCalculationPeriodsSchedule", fmap OneOf2 (parseSchemaType "calculationPeriodsSchedule"))+ , ("AdjustableDates", fmap TwoOf2 (parseSchemaType "calculationPeriods"))+ ])+ `apply` optional (parseSchemaType "pricingDates")+ `apply` optional (parseSchemaType "averagingMethod")+ `apply` oneOf' [ ("OneOf3 CommodityNotionalQuantitySchedule CommodityNotionalQuantity [CommoditySettlementPeriodsNotionalQuantity] Xsd.Decimal", fmap OneOf2 (return (,) `apply` oneOf' [ ("CommodityNotionalQuantitySchedule", fmap OneOf3 (parseSchemaType "notionalQuantitySchedule"))+ , ("CommodityNotionalQuantity", fmap TwoOf3 (parseSchemaType "notionalQuantity"))+ , ("[CommoditySettlementPeriodsNotionalQuantity]", fmap ThreeOf3 (many1 (parseSchemaType "settlementPeriodsNotionalQuantity")))+ ]+ `apply` parseSchemaType "totalNotionalQuantity"))+ , ("QuantityReference", fmap TwoOf2 (parseSchemaType "quantityReference"))+ ]+ `apply` optional (parseSchemaType "exercise")+ `apply` oneOf' [ ("NonNegativeMoney", fmap OneOf2 (parseSchemaType "strikePricePerUnit"))+ , ("CommodityStrikeSchedule", fmap TwoOf2 (parseSchemaType "strikePricePerUnitSchedule"))+ ]))+ , ("(Maybe (OneOf2 CommoditySwap CommodityForward)) Maybe CommodityPhysicalExercise", fmap TwoOf2 (return (,) `apply` optional (oneOf' [ ("CommoditySwap", fmap OneOf2 (elementCommoditySwap))+ , ("CommodityForward", fmap TwoOf2 (elementCommodityForward))+ ])+ `apply` optional (parseSchemaType "physicalExercise")))+ ]+ `apply` many (parseSchemaType "premium")+ `apply` optional (parseSchemaType "commonPricing")+ `apply` optional (parseSchemaType "marketDisruption")+ `apply` optional (parseSchemaType "settlementDisruption")+ `apply` optional (parseSchemaType "rounding")+ schemaTypeToXML s x@CommodityOption{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodOption_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ commodOption_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ commodOption_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ commodOption_productType x+ , concatMap (schemaTypeToXML "productId") $ commodOption_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ commodOption_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ commodOption_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ commodOption_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ commodOption_sellerAccountReference x+ , maybe [] (schemaTypeToXML "optionType") $ commodOption_optionType x+ , foldOneOf2 (\ (a,b,c,d,e,f,g,h) -> concat [ maybe [] (schemaTypeToXML "commodity") a+ , maybe [] (schemaTypeToXML "effectiveDate") b+ , maybe [] (foldOneOf2 (schemaTypeToXML "calculationPeriodsSchedule")+ (schemaTypeToXML "calculationPeriods")+ ) c+ , maybe [] (schemaTypeToXML "pricingDates") d+ , maybe [] (schemaTypeToXML "averagingMethod") e+ , foldOneOf2 (\ (a,b) -> concat [ foldOneOf3 (schemaTypeToXML "notionalQuantitySchedule")+ (schemaTypeToXML "notionalQuantity")+ (concatMap (schemaTypeToXML "settlementPeriodsNotionalQuantity"))+ a+ , schemaTypeToXML "totalNotionalQuantity" b+ ])+ (schemaTypeToXML "quantityReference")+ f+ , maybe [] (schemaTypeToXML "exercise") g+ , foldOneOf2 (schemaTypeToXML "strikePricePerUnit")+ (schemaTypeToXML "strikePricePerUnitSchedule")+ h+ ])+ (\ (a,b) -> concat [ maybe [] (foldOneOf2 (elementToXMLCommoditySwap)+ (elementToXMLCommodityForward)+ ) a+ , maybe [] (schemaTypeToXML "physicalExercise") b+ ])+ $ commodOption_choice9 x+ , concatMap (schemaTypeToXML "premium") $ commodOption_premium x+ , maybe [] (schemaTypeToXML "commonPricing") $ commodOption_commonPricing x+ , maybe [] (schemaTypeToXML "marketDisruption") $ commodOption_marketDisruption x+ , maybe [] (schemaTypeToXML "settlementDisruption") $ commodOption_settlementDisruption x+ , maybe [] (schemaTypeToXML "rounding") $ commodOption_rounding x+ ]+instance Extension CommodityOption Product where+ supertype v = Product_CommodityOption v+ +-- | A scheme identifying the physical event relative to which +-- payment occurs.+data CommodityPayRelativeToEvent = CommodityPayRelativeToEvent Scheme CommodityPayRelativeToEventAttributes deriving (Eq,Show)+data CommodityPayRelativeToEventAttributes = CommodityPayRelativeToEventAttributes+ { cprtea_commodityPayRelativeToEventScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CommodityPayRelativeToEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "commodityPayRelativeToEventScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CommodityPayRelativeToEvent v (CommodityPayRelativeToEventAttributes a0)+ schemaTypeToXML s (CommodityPayRelativeToEvent bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "commodityPayRelativeToEventScheme") $ cprtea_commodityPayRelativeToEventScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CommodityPayRelativeToEvent Scheme where+ supertype (CommodityPayRelativeToEvent s _) = s+ +-- | The parameters for defining the expiration date(s) and +-- time(s) for an American style option.+data CommodityPhysicalAmericanExercise = CommodityPhysicalAmericanExercise+ { commodPhysicAmericExerc_ID :: Maybe Xsd.ID+ , commodPhysicAmericExerc_choice0 :: (Maybe (OneOf2 ((Maybe (AdjustableOrRelativeDates)),(Maybe (AdjustableOrRelativeDates))) ((Maybe (CommodityRelativeExpirationDates)),(Maybe (CommodityRelativeExpirationDates)))))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The first day(s) of the exercise period(s) for an + -- American-style option.+ -- + -- * The Expiration Date(s) of an American-style option.+ -- + -- (2) Sequence of:+ -- + -- * The first day(s) of the exercise period(s) for an + -- American-style option where it is relative to the + -- occurrence of an external event.+ -- + -- * The Expiration Date(s) of an American-style option + -- where it is relative to the occurrence of an + -- external event.+ , commodPhysicAmericExerc_latestExerciseTime :: Maybe PrevailingTime+ -- ^ For a Bermuda or American style option, the latest time on + -- an exercise business day (excluding the expiration date) + -- within the exercise period that notice can be given by the + -- buyer to the seller or seller's agent. Notice of exercise + -- given after this time will be deemed to have been given on + -- the next exercise business day.+ , commodPhysicAmericExerc_expirationTime :: Maybe PrevailingTime+ -- ^ The specific time of day at which the option expires.+ }+ deriving (Eq,Show)+instance SchemaType CommodityPhysicalAmericanExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityPhysicalAmericanExercise a0)+ `apply` optional (oneOf' [ ("Maybe AdjustableOrRelativeDates Maybe AdjustableOrRelativeDates", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "commencementDates")+ `apply` optional (parseSchemaType "expirationDates")))+ , ("Maybe CommodityRelativeExpirationDates Maybe CommodityRelativeExpirationDates", fmap TwoOf2 (return (,) `apply` optional (parseSchemaType "relativeCommencementDates")+ `apply` optional (parseSchemaType "relativeExpirationDates")))+ ])+ `apply` optional (parseSchemaType "latestExerciseTime")+ `apply` optional (parseSchemaType "expirationTime")+ schemaTypeToXML s x@CommodityPhysicalAmericanExercise{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodPhysicAmericExerc_ID x+ ]+ [ maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "commencementDates") a+ , maybe [] (schemaTypeToXML "expirationDates") b+ ])+ (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "relativeCommencementDates") a+ , maybe [] (schemaTypeToXML "relativeExpirationDates") b+ ])+ ) $ commodPhysicAmericExerc_choice0 x+ , maybe [] (schemaTypeToXML "latestExerciseTime") $ commodPhysicAmericExerc_latestExerciseTime x+ , maybe [] (schemaTypeToXML "expirationTime") $ commodPhysicAmericExerc_expirationTime x+ ]+instance Extension CommodityPhysicalAmericanExercise Exercise where+ supertype v = Exercise_CommodityPhysicalAmericanExercise v+ +-- | The parameters for defining the expiration date(s) and +-- time(s) for a European style option.+data CommodityPhysicalEuropeanExercise = CommodityPhysicalEuropeanExercise+ { commodPhysicEuropExerc_ID :: Maybe Xsd.ID+ , commodPhysicEuropExerc_choice0 :: (Maybe (OneOf3 AdjustableOrRelativeDate AdjustableRelativeOrPeriodicDates2 CommodityRelativeExpirationDates))+ -- ^ Choice between:+ -- + -- (1) The Expiration Date of a single expiry European-style + -- option or the first Expiration Date of a multiple + -- expiry or daily expiring option.+ -- + -- (2) The Expiration Date(s) of a European-style option.+ -- + -- (3) The Expiration Date(s) of a European-style option where + -- it is relative to the occurrence of an external event.+ , commodPhysicEuropExerc_expirationTime :: Maybe PrevailingTime+ -- ^ The specific time of day at which the option expires.+ }+ deriving (Eq,Show)+instance SchemaType CommodityPhysicalEuropeanExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityPhysicalEuropeanExercise a0)+ `apply` optional (oneOf' [ ("AdjustableOrRelativeDate", fmap OneOf3 (parseSchemaType "expirationDate"))+ , ("AdjustableRelativeOrPeriodicDates2", fmap TwoOf3 (parseSchemaType "expirationDates"))+ , ("CommodityRelativeExpirationDates", fmap ThreeOf3 (parseSchemaType "relativeExpirationDates"))+ ])+ `apply` optional (parseSchemaType "expirationTime")+ schemaTypeToXML s x@CommodityPhysicalEuropeanExercise{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodPhysicEuropExerc_ID x+ ]+ [ maybe [] (foldOneOf3 (schemaTypeToXML "expirationDate")+ (schemaTypeToXML "expirationDates")+ (schemaTypeToXML "relativeExpirationDates")+ ) $ commodPhysicEuropExerc_choice0 x+ , maybe [] (schemaTypeToXML "expirationTime") $ commodPhysicEuropExerc_expirationTime x+ ]+instance Extension CommodityPhysicalEuropeanExercise Exercise where+ supertype v = Exercise_CommodityPhysicalEuropeanExercise v+ +-- | The parameters for defining how the physically-settled +-- commodity option can be exercised and how it is settled.+data CommodityPhysicalExercise = CommodityPhysicalExercise+ { commodPhysicExerc_choice0 :: (Maybe (OneOf2 CommodityPhysicalAmericanExercise CommodityPhysicalEuropeanExercise))+ -- ^ Choice between:+ -- + -- (1) The parameters for defining the expiration date(s) and + -- time(s) for an American style option.+ -- + -- (2) The parameters for defining the expiration date(s) and + -- time(s) for a European style option.+ , commodPhysicExerc_automaticExercise :: Maybe Xsd.Boolean+ -- ^ Specifies whether or not Automatic Exercise applies to a + -- Commodity Option Transaction.+ , commodPhysicExerc_writtenConfirmation :: Maybe Xsd.Boolean+ -- ^ Specifies whether or not Written Confirmation applies to a + -- Commodity Option Transaction.+ }+ deriving (Eq,Show)+instance SchemaType CommodityPhysicalExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CommodityPhysicalExercise+ `apply` optional (oneOf' [ ("CommodityPhysicalAmericanExercise", fmap OneOf2 (parseSchemaType "americanExercise"))+ , ("CommodityPhysicalEuropeanExercise", fmap TwoOf2 (parseSchemaType "europeanExercise"))+ ])+ `apply` optional (parseSchemaType "automaticExercise")+ `apply` optional (parseSchemaType "writtenConfirmation")+ schemaTypeToXML s x@CommodityPhysicalExercise{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "americanExercise")+ (schemaTypeToXML "europeanExercise")+ ) $ commodPhysicExerc_choice0 x+ , maybe [] (schemaTypeToXML "automaticExercise") $ commodPhysicExerc_automaticExercise x+ , maybe [] (schemaTypeToXML "writtenConfirmation") $ commodPhysicExerc_writtenConfirmation x+ ]+ +-- | A type defining the physical quantity of the commodity to +-- be delivered.+data CommodityPhysicalQuantity = CommodityPhysicalQuantity+ { commodPhysicQuant_ID :: Maybe Xsd.ID+ , commodPhysicQuant_choice0 :: (Maybe (OneOf2 CommodityNotionalQuantity CommodityPhysicalQuantitySchedule))+ -- ^ Choice between:+ -- + -- (1) The Quantity per Delivery Period.+ -- + -- (2) Allows the documentation of a shaped quantity trade + -- where the quantity changes over the life of the + -- transaction.+ , commodPhysicQuant_totalPhysicalQuantity :: UnitQuantity+ -- ^ The Total Quantity of the commodity to be delivered.+ }+ deriving (Eq,Show)+instance SchemaType CommodityPhysicalQuantity where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityPhysicalQuantity a0)+ `apply` optional (oneOf' [ ("CommodityNotionalQuantity", fmap OneOf2 (parseSchemaType "physicalQuantity"))+ , ("CommodityPhysicalQuantitySchedule", fmap TwoOf2 (parseSchemaType "physicalQuantitySchedule"))+ ])+ `apply` parseSchemaType "totalPhysicalQuantity"+ schemaTypeToXML s x@CommodityPhysicalQuantity{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodPhysicQuant_ID x+ ]+ [ maybe [] (foldOneOf2 (schemaTypeToXML "physicalQuantity")+ (schemaTypeToXML "physicalQuantitySchedule")+ ) $ commodPhysicQuant_choice0 x+ , schemaTypeToXML "totalPhysicalQuantity" $ commodPhysicQuant_totalPhysicalQuantity x+ ]+instance Extension CommodityPhysicalQuantity CommodityPhysicalQuantityBase where+ supertype v = CommodityPhysicalQuantityBase_CommodityPhysicalQuantity v+ +-- | An abstract base class for physical quantity types.+data CommodityPhysicalQuantityBase+ = CommodityPhysicalQuantityBase_GasPhysicalQuantity GasPhysicalQuantity+ | CommodityPhysicalQuantityBase_ElectricityPhysicalQuantity ElectricityPhysicalQuantity+ | CommodityPhysicalQuantityBase_CommodityPhysicalQuantity CommodityPhysicalQuantity+ + deriving (Eq,Show)+instance SchemaType CommodityPhysicalQuantityBase where+ parseSchemaType s = do+ (fmap CommodityPhysicalQuantityBase_GasPhysicalQuantity $ parseSchemaType s)+ `onFail`+ (fmap CommodityPhysicalQuantityBase_ElectricityPhysicalQuantity $ parseSchemaType s)+ `onFail`+ (fmap CommodityPhysicalQuantityBase_CommodityPhysicalQuantity $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of CommodityPhysicalQuantityBase,\n\+\ namely one of:\n\+\GasPhysicalQuantity,ElectricityPhysicalQuantity,CommodityPhysicalQuantity"+ schemaTypeToXML _s (CommodityPhysicalQuantityBase_GasPhysicalQuantity x) = schemaTypeToXML "gasPhysicalQuantity" x+ schemaTypeToXML _s (CommodityPhysicalQuantityBase_ElectricityPhysicalQuantity x) = schemaTypeToXML "electricityPhysicalQuantity" x+ schemaTypeToXML _s (CommodityPhysicalQuantityBase_CommodityPhysicalQuantity x) = schemaTypeToXML "commodityPhysicalQuantity" x+ +-- | The Quantity per Delivery Period. There must be a Quantity +-- step specified for each Delivery Period, regardless of +-- whether the Quantity changes or remains the same between +-- periods.+data CommodityPhysicalQuantitySchedule = CommodityPhysicalQuantitySchedule+ { commodPhysicQuantSched_ID :: Maybe Xsd.ID+ , commodPhysicQuantSched_quantityStep :: [CommodityNotionalQuantity]+ -- ^ The quantity per Calculation Period. There must be a + -- quantity specified for each Calculation Period, regardless + -- of whether the quantity changes or remains the same between + -- periods.+ , commodPhysicQuantSched_choice1 :: (Maybe (OneOf2 CalculationPeriodsReference CalculationPeriodsScheduleReference))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to the Delivery Periods + -- defined elsewhere.+ -- + -- (2) A pointer style reference to the Calculation Periods + -- Schedule defined elsewhere.+ }+ deriving (Eq,Show)+instance SchemaType CommodityPhysicalQuantitySchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityPhysicalQuantitySchedule a0)+ `apply` many (parseSchemaType "quantityStep")+ `apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf2 (parseSchemaType "deliveryPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf2 (parseSchemaType "deliveryPeriodsScheduleReference"))+ ])+ schemaTypeToXML s x@CommodityPhysicalQuantitySchedule{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodPhysicQuantSched_ID x+ ]+ [ concatMap (schemaTypeToXML "quantityStep") $ commodPhysicQuantSched_quantityStep x+ , maybe [] (foldOneOf2 (schemaTypeToXML "deliveryPeriodsReference")+ (schemaTypeToXML "deliveryPeriodsScheduleReference")+ ) $ commodPhysicQuantSched_choice1 x+ ]+ +-- | The pipeline through which the physical commodity will be +-- delivered.+data CommodityPipeline = CommodityPipeline Scheme CommodityPipelineAttributes deriving (Eq,Show)+data CommodityPipelineAttributes = CommodityPipelineAttributes+ { commodPipelAttrib_pipelineScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CommodityPipeline where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "pipelineScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CommodityPipeline v (CommodityPipelineAttributes a0)+ schemaTypeToXML s (CommodityPipeline bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "pipelineScheme") $ commodPipelAttrib_pipelineScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CommodityPipeline Scheme where+ supertype (CommodityPipeline s _) = s+ +-- | The pipeline cycle during which the physical commodity will +-- be delivered.+data CommodityPipelineCycle = CommodityPipelineCycle Scheme CommodityPipelineCycleAttributes deriving (Eq,Show)+data CommodityPipelineCycleAttributes = CommodityPipelineCycleAttributes+ { commodPipelCycleAttrib_pipelineCycleScheme :: Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CommodityPipelineCycle where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- getAttribute "pipelineCycleScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CommodityPipelineCycle v (CommodityPipelineCycleAttributes a0)+ schemaTypeToXML s (CommodityPipelineCycle bt at) =+ addXMLAttributes [ toXMLAttribute "pipelineCycleScheme" $ commodPipelCycleAttrib_pipelineCycleScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CommodityPipelineCycle Scheme where+ supertype (CommodityPipelineCycle s _) = s+ +-- | The commodity option premium payable by the buyer to the +-- seller.+data CommodityPremium = CommodityPremium+ { commodPremium_ID :: Maybe Xsd.ID+ , commodPremium_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , commodPremium_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , commodPremium_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , commodPremium_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , commodPremium_paymentDate :: Maybe AdjustableOrRelativeDate+ -- ^ The payment date, which can be expressed as either an + -- adjustable or relative date.+ , commodPremium_paymentAmount :: Maybe NonNegativeMoney+ -- ^ Non negative payment amount.+ , commodPremium_premiumPerUnit :: NonNegativeMoney+ -- ^ The currency amount of premium to be paid per Unit of the + -- Total Notional Quantity.+ }+ deriving (Eq,Show)+instance SchemaType CommodityPremium where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityPremium a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "paymentDate")+ `apply` optional (parseSchemaType "paymentAmount")+ `apply` parseSchemaType "premiumPerUnit"+ schemaTypeToXML s x@CommodityPremium{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodPremium_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ commodPremium_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ commodPremium_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ commodPremium_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ commodPremium_receiverAccountReference x+ , maybe [] (schemaTypeToXML "paymentDate") $ commodPremium_paymentDate x+ , maybe [] (schemaTypeToXML "paymentAmount") $ commodPremium_paymentAmount x+ , schemaTypeToXML "premiumPerUnit" $ commodPremium_premiumPerUnit x+ ]+instance Extension CommodityPremium NonNegativePayment where+ supertype (CommodityPremium a0 e0 e1 e2 e3 e4 e5 e6) =+ NonNegativePayment a0 e0 e1 e2 e3 e4 e5+instance Extension CommodityPremium PaymentBaseExtended where+ supertype = (supertype :: NonNegativePayment -> PaymentBaseExtended)+ . (supertype :: CommodityPremium -> NonNegativePayment)+ +instance Extension CommodityPremium PaymentBase where+ supertype = (supertype :: PaymentBaseExtended -> PaymentBase)+ . (supertype :: NonNegativePayment -> PaymentBaseExtended)+ . (supertype :: CommodityPremium -> NonNegativePayment)+ + +-- | The dates on which prices are observed for the underlyer.+data CommodityPricingDates = CommodityPricingDates+ { commodPricingDates_ID :: Maybe Xsd.ID+ , commodPricingDates_choice0 :: (Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to the Calculation Periods + -- defined on another leg.+ -- + -- (2) A pointer style reference to the Calculation Periods + -- Schedule defined on another leg.+ -- + -- (3) A pointer style reference to single-day-duration + -- Calculation Periods defined on another leg.+ , commodPricingDates_choice1 :: OneOf2 ((Maybe (Lag)),(OneOf3 ((Maybe (CommodityDayTypeEnum)),((Maybe (OneOf2 ((Maybe (CommodityFrequencyType)),(Maybe (Xsd.PositiveInteger))) ([DayOfWeekEnum],(Maybe (Xsd.Integer)))))),(Maybe (CommodityBusinessCalendar))) [SettlementPeriods] [SettlementPeriodsReference])) [AdjustableDates]+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The pricing period per calculation period if the + -- pricing days do not wholly fall within the + -- respective calculation period.+ -- + -- * unknown+ -- + -- (2) A list of adjustable dates on which the trade would + -- price. Each date will price for the Calculation Period + -- within which it falls.+ }+ deriving (Eq,Show)+instance SchemaType CommodityPricingDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityPricingDates a0)+ `apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))+ , ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))+ ])+ `apply` oneOf' [ ("Maybe Lag OneOf3 ((Maybe (CommodityDayTypeEnum)),((Maybe (OneOf2 ((Maybe (CommodityFrequencyType)),(Maybe (Xsd.PositiveInteger))) ([DayOfWeekEnum],(Maybe (Xsd.Integer)))))),(Maybe (CommodityBusinessCalendar))) [SettlementPeriods] [SettlementPeriodsReference]", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "lag")+ `apply` oneOf' [ ("Maybe CommodityDayTypeEnum (Maybe (OneOf2 ((Maybe (CommodityFrequencyType)),(Maybe (Xsd.PositiveInteger))) ([DayOfWeekEnum],(Maybe (Xsd.Integer))))) Maybe CommodityBusinessCalendar", fmap OneOf3 (return (,,) `apply` optional (parseSchemaType "dayType")+ `apply` optional (oneOf' [ ("Maybe CommodityFrequencyType Maybe Xsd.PositiveInteger", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "dayDistribution")+ `apply` optional (parseSchemaType "dayCount")))+ , ("[DayOfWeekEnum] Maybe Xsd.Integer", fmap TwoOf2 (return (,) `apply` between (Occurs (Just 0) (Just 7))+ (parseSchemaType "dayOfWeek")+ `apply` optional (parseSchemaType "dayNumber")))+ ])+ `apply` optional (parseSchemaType "businessCalendar")))+ , ("[SettlementPeriods]", fmap TwoOf3 (many1 (parseSchemaType "settlementPeriods")))+ , ("[SettlementPeriodsReference]", fmap ThreeOf3 (many1 (parseSchemaType "settlementPeriodsReference")))+ ]))+ , ("[AdjustableDates]", fmap TwoOf2 (many1 (parseSchemaType "pricingDates")))+ ]+ schemaTypeToXML s x@CommodityPricingDates{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodPricingDates_ID x+ ]+ [ maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")+ (schemaTypeToXML "calculationPeriodsScheduleReference")+ (schemaTypeToXML "calculationPeriodsDatesReference")+ ) $ commodPricingDates_choice0 x+ , foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "lag") a+ , foldOneOf3 (\ (a,b,c) -> concat [ maybe [] (schemaTypeToXML "dayType") a+ , maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "dayDistribution") a+ , maybe [] (schemaTypeToXML "dayCount") b+ ])+ (\ (a,b) -> concat [ concatMap (schemaTypeToXML "dayOfWeek") a+ , maybe [] (schemaTypeToXML "dayNumber") b+ ])+ ) b+ , maybe [] (schemaTypeToXML "businessCalendar") c+ ])+ (concatMap (schemaTypeToXML "settlementPeriods"))+ (concatMap (schemaTypeToXML "settlementPeriodsReference"))+ b+ ])+ (concatMap (schemaTypeToXML "pricingDates"))+ $ commodPricingDates_choice1 x+ ]+ +-- | A scheme identifying the grade of physical commodity +-- product to be delivered.+data CommodityProductGrade = CommodityProductGrade Scheme CommodityProductGradeAttributes deriving (Eq,Show)+data CommodityProductGradeAttributes = CommodityProductGradeAttributes+ { commodProductGradeAttrib_productGradeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CommodityProductGrade where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "productGradeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CommodityProductGrade v (CommodityProductGradeAttributes a0)+ schemaTypeToXML s (CommodityProductGrade bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "productGradeScheme") $ commodProductGradeAttrib_productGradeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CommodityProductGrade Scheme where+ supertype (CommodityProductGrade s _) = s+ +-- | A type for defining the frequency at which the Notional +-- Quantity is deemed to apply for purposes of calculating the +-- Total Notional Quantity.+data CommodityQuantityFrequency = CommodityQuantityFrequency Scheme CommodityQuantityFrequencyAttributes deriving (Eq,Show)+data CommodityQuantityFrequencyAttributes = CommodityQuantityFrequencyAttributes+ { cqfa_quantityFrequencyScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CommodityQuantityFrequency where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "quantityFrequencyScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CommodityQuantityFrequency v (CommodityQuantityFrequencyAttributes a0)+ schemaTypeToXML s (CommodityQuantityFrequency bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "quantityFrequencyScheme") $ cqfa_quantityFrequencyScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CommodityQuantityFrequency Scheme where+ supertype (CommodityQuantityFrequency s _) = s+ +-- | The Expiration Dates of the trade relative to the +-- Calculation Periods.+data CommodityRelativeExpirationDates = CommodityRelativeExpirationDates+ { commodRelatExpirDates_ID :: Maybe Xsd.ID+ , commodRelatExpirDates_expireRelativeToEvent :: Maybe CommodityExpireRelativeToEvent+ -- ^ Specifies whether the payment(s) occur relative to the date + -- of a physical event.+ , commodRelatExpirDates_expirationDateOffset :: Maybe DateOffset+ -- ^ Specifies any offset from the adjusted Calculation Period + -- start date or adjusted Calculation Period end date + -- applicable to each Payment Date.+ , commodRelatExpirDates_choice2 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to a set of financial + -- business centers defined elsewhere in the document. + -- This set of business centers is used to determine + -- whether a particular day is a business day or not.+ -- + -- (2) businessCenters+ }+ deriving (Eq,Show)+instance SchemaType CommodityRelativeExpirationDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityRelativeExpirationDates a0)+ `apply` optional (parseSchemaType "expireRelativeToEvent")+ `apply` optional (parseSchemaType "expirationDateOffset")+ `apply` optional (oneOf' [ ("BusinessCentersReference", fmap OneOf2 (parseSchemaType "businessCentersReference"))+ , ("BusinessCenters", fmap TwoOf2 (parseSchemaType "businessCenters"))+ ])+ schemaTypeToXML s x@CommodityRelativeExpirationDates{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodRelatExpirDates_ID x+ ]+ [ maybe [] (schemaTypeToXML "expireRelativeToEvent") $ commodRelatExpirDates_expireRelativeToEvent x+ , maybe [] (schemaTypeToXML "expirationDateOffset") $ commodRelatExpirDates_expirationDateOffset x+ , maybe [] (foldOneOf2 (schemaTypeToXML "businessCentersReference")+ (schemaTypeToXML "businessCenters")+ ) $ commodRelatExpirDates_choice2 x+ ]+ +-- | The Payment Dates of the trade relative to the Calculation +-- Periods.+data CommodityRelativePaymentDates = CommodityRelativePaymentDates+ { commodRelatPaymentDates_ID :: Maybe Xsd.ID+ , commodRelatPaymentDates_choice0 :: (Maybe (OneOf2 PayRelativeToEnum CommodityPayRelativeToEvent))+ -- ^ Choice between:+ -- + -- (1) Specifies whether the payment(s) occur relative to a + -- date such as the end of each Calculation Period or the + -- last Pricing Date in each Calculation Period.+ -- + -- (2) Specifies whether the payment(s) occur relative to the + -- date of a physical event.+ , commodRelatPaymentDates_choice1 :: (Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to the Calculation Periods + -- defined on another leg.+ -- + -- (2) A pointer style reference to the Calculation Periods + -- Schedule defined on another leg.+ -- + -- (3) A pointer style reference to single-day-duration + -- Calculation Periods defined on another leg.+ , commodRelatPaymentDates_paymentDaysOffset :: Maybe DateOffset+ -- ^ Specifies any offset from the adjusted Calculation Period + -- start date or adjusted Calculation Period end date + -- applicable to each Payment Date.+ , commodRelatPaymentDates_choice3 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to a set of financial + -- business centers defined elsewhere in the document. + -- This set of business centers is used to determine + -- whether a particular day is a business day or not.+ -- + -- (2) businessCenters+ }+ deriving (Eq,Show)+instance SchemaType CommodityRelativePaymentDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommodityRelativePaymentDates a0)+ `apply` optional (oneOf' [ ("PayRelativeToEnum", fmap OneOf2 (parseSchemaType "payRelativeTo"))+ , ("CommodityPayRelativeToEvent", fmap TwoOf2 (parseSchemaType "payRelativeToEvent"))+ ])+ `apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))+ , ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))+ ])+ `apply` optional (parseSchemaType "paymentDaysOffset")+ `apply` optional (oneOf' [ ("BusinessCentersReference", fmap OneOf2 (parseSchemaType "businessCentersReference"))+ , ("BusinessCenters", fmap TwoOf2 (parseSchemaType "businessCenters"))+ ])+ schemaTypeToXML s x@CommodityRelativePaymentDates{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodRelatPaymentDates_ID x+ ]+ [ maybe [] (foldOneOf2 (schemaTypeToXML "payRelativeTo")+ (schemaTypeToXML "payRelativeToEvent")+ ) $ commodRelatPaymentDates_choice0 x+ , maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")+ (schemaTypeToXML "calculationPeriodsScheduleReference")+ (schemaTypeToXML "calculationPeriodsDatesReference")+ ) $ commodRelatPaymentDates_choice1 x+ , maybe [] (schemaTypeToXML "paymentDaysOffset") $ commodRelatPaymentDates_paymentDaysOffset x+ , maybe [] (foldOneOf2 (schemaTypeToXML "businessCentersReference")+ (schemaTypeToXML "businessCenters")+ ) $ commodRelatPaymentDates_choice3 x+ ]+ +-- | The notional quantity of electricity that applies to one or +-- more groups of Settlement Periods.+data CommoditySettlementPeriodsNotionalQuantity = CommoditySettlementPeriodsNotionalQuantity+ { cspnq_ID :: Maybe Xsd.ID+ , cspnq_quantityUnit :: QuantityUnit+ -- ^ Quantity Unit is the unit of measure applicable for the + -- quantity on the Transaction.+ , cspnq_quantityFrequency :: Maybe CommodityQuantityFrequency+ -- ^ The frequency at which the Notional Quantity is deemed to + -- apply for purposes of calculating the Total Notional + -- Quantity.+ , cspnq_quantity :: Maybe Xsd.Decimal+ -- ^ Amount of commodity per quantity frequency.+ , cspnq_settlementPeriodsReference :: [SettlementPeriodsReference]+ -- ^ The range(s) of Settlement Periods to which the Notional + -- Quantity applies.+ }+ deriving (Eq,Show)+instance SchemaType CommoditySettlementPeriodsNotionalQuantity where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommoditySettlementPeriodsNotionalQuantity a0)+ `apply` parseSchemaType "quantityUnit"+ `apply` optional (parseSchemaType "quantityFrequency")+ `apply` optional (parseSchemaType "quantity")+ `apply` many (parseSchemaType "settlementPeriodsReference")+ schemaTypeToXML s x@CommoditySettlementPeriodsNotionalQuantity{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ cspnq_ID x+ ]+ [ schemaTypeToXML "quantityUnit" $ cspnq_quantityUnit x+ , maybe [] (schemaTypeToXML "quantityFrequency") $ cspnq_quantityFrequency x+ , maybe [] (schemaTypeToXML "quantity") $ cspnq_quantity x+ , concatMap (schemaTypeToXML "settlementPeriodsReference") $ cspnq_settlementPeriodsReference x+ ]+instance Extension CommoditySettlementPeriodsNotionalQuantity CommodityNotionalQuantity where+ supertype (CommoditySettlementPeriodsNotionalQuantity a0 e0 e1 e2 e3) =+ CommodityNotionalQuantity a0 e0 e1 e2+ +-- | The notional quantity schedule of electricity that applies +-- to one or more groups of Settlement Periods.+data CommoditySettlementPeriodsNotionalQuantitySchedule = CommoditySettlementPeriodsNotionalQuantitySchedule+ { cspnqs_settlementPeriodsNotionalQuantityStep :: [CommodityNotionalQuantity]+ -- ^ For an electricity transaction, the Notional Quantity for a + -- given Calculation Period during the life of the trade which + -- applies to the range(s) of Settlement Periods referenced by + -- settlementPeriodsReference. There must be a + -- settlementPeriodsNotionalQuantityStep specified for each + -- Calculation Period, regardless of whether the + -- NotionalQuantity changes or remains the same between + -- periods.+ , cspnqs_settlementPeriodsReference :: [SettlementPeriodsReference]+ -- ^ The range(s) of Settlement Periods to which the Fixed Price + -- steps apply.+ }+ deriving (Eq,Show)+instance SchemaType CommoditySettlementPeriodsNotionalQuantitySchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CommoditySettlementPeriodsNotionalQuantitySchedule+ `apply` many (parseSchemaType "settlementPeriodsNotionalQuantityStep")+ `apply` many (parseSchemaType "settlementPeriodsReference")+ schemaTypeToXML s x@CommoditySettlementPeriodsNotionalQuantitySchedule{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "settlementPeriodsNotionalQuantityStep") $ cspnqs_settlementPeriodsNotionalQuantityStep x+ , concatMap (schemaTypeToXML "settlementPeriodsReference") $ cspnqs_settlementPeriodsReference x+ ]+ +-- | The fixed price schedule for electricity that applies to +-- one or more groups of Settlement Periods.+data CommoditySettlementPeriodsPriceSchedule = CommoditySettlementPeriodsPriceSchedule+ { cspps_settlementPeriodsPriceStep :: [FixedPrice]+ -- ^ For an electricity transaction, the Fixed Price for a given + -- Calculation Period during the life of the trade which + -- applies to the range(s) of Settlement Periods referenced by + -- settlementPeriods Reference. There must be a Fixed Price + -- step specified for each Calculation Period, regardless of + -- whether the Fixed Price changes or remains the same between + -- periods.+ , cspps_settlementPeriodsReference :: [SettlementPeriodsReference]+ -- ^ The range(s) of Settlement Periods to which the Fixed Price + -- steps apply.+ }+ deriving (Eq,Show)+instance SchemaType CommoditySettlementPeriodsPriceSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CommoditySettlementPeriodsPriceSchedule+ `apply` many (parseSchemaType "settlementPeriodsPriceStep")+ `apply` many (parseSchemaType "settlementPeriodsReference")+ schemaTypeToXML s x@CommoditySettlementPeriodsPriceSchedule{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "settlementPeriodsPriceStep") $ cspps_settlementPeriodsPriceStep x+ , concatMap (schemaTypeToXML "settlementPeriodsReference") $ cspps_settlementPeriodsReference x+ ]+ +data CommoditySpread = CommoditySpread+ { commodSpread_ID :: Maybe Xsd.ID+ , commodSpread_currency :: Currency+ -- ^ The currency in which an amount is denominated.+ , commodSpread_amount :: Xsd.Decimal+ -- ^ The monetary quantity in currency units.+ , commodSpread_spreadConversionFactor :: Maybe Xsd.Decimal+ -- ^ spreadConversionFactor should be used when the unit of + -- measure of the Commodity Reference Price and the unit of + -- measure in which the spread is quoted are different. The + -- value of spreadConversionFactor is the number of units of + -- measure in which the spread is quoted per unit of measure + -- of the Commodity Reference Price.+ , commodSpread_spreadUnit :: Maybe QuantityUnit+ -- ^ spreadUnit should be used when the unit of measure of the + -- Commodity Reference Price and the unit of measure in which + -- the spread is quoted are different. The value of spreadUnit + -- is the unit of measure in which the spread is quoted.+ }+ deriving (Eq,Show)+instance SchemaType CommoditySpread where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommoditySpread a0)+ `apply` parseSchemaType "currency"+ `apply` parseSchemaType "amount"+ `apply` optional (parseSchemaType "spreadConversionFactor")+ `apply` optional (parseSchemaType "spreadUnit")+ schemaTypeToXML s x@CommoditySpread{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodSpread_ID x+ ]+ [ schemaTypeToXML "currency" $ commodSpread_currency x+ , schemaTypeToXML "amount" $ commodSpread_amount x+ , maybe [] (schemaTypeToXML "spreadConversionFactor") $ commodSpread_spreadConversionFactor x+ , maybe [] (schemaTypeToXML "spreadUnit") $ commodSpread_spreadUnit x+ ]+instance Extension CommoditySpread Money where+ supertype (CommoditySpread a0 e0 e1 e2 e3) =+ Money a0 e0 e1+instance Extension CommoditySpread MoneyBase where+ supertype = (supertype :: Money -> MoneyBase)+ . (supertype :: CommoditySpread -> Money)+ + +-- | The Spread per Calculation Period. There must be a Spread +-- specified for each Calculation Period, regardless of +-- whether the Spread changes or remains the same between +-- periods.+data CommoditySpreadSchedule = CommoditySpreadSchedule+ { commodSpreadSched_spreadStep :: [CommoditySpread]+ -- ^ The spread per Calculation Period. There must be a spread + -- step specified for each Calculation Period, regardless of + -- whether the spread changes or remains the same between + -- periods.+ , commodSpreadSched_choice1 :: (Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to the Calculation Periods + -- defined on another leg.+ -- + -- (2) A pointer style reference to the Calculation Periods + -- Schedule defined on another leg.+ -- + -- (3) A pointer style reference to single-day-duration + -- Calculation Periods defined on another leg.+ }+ deriving (Eq,Show)+instance SchemaType CommoditySpreadSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CommoditySpreadSchedule+ `apply` many (parseSchemaType "spreadStep")+ `apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))+ , ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))+ ])+ schemaTypeToXML s x@CommoditySpreadSchedule{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "spreadStep") $ commodSpreadSched_spreadStep x+ , maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")+ (schemaTypeToXML "calculationPeriodsScheduleReference")+ (schemaTypeToXML "calculationPeriodsDatesReference")+ ) $ commodSpreadSched_choice1 x+ ]+ +-- | The Strike Price per Unit per Calculation Period. There +-- must be a Strike Price per Unit step specified for each +-- Calculation Period, regardless of whether the Strike +-- changes or remains the same between periods.+data CommodityStrikeSchedule = CommodityStrikeSchedule+ { commodStrikeSched_strikePricePerUnitStep :: [NonNegativeMoney]+ -- ^ The strike price per unit per Calculation Period. There + -- must be a strike price per unit specified for each + -- Calculation Period, regardless of whether the price changes + -- or remains the same between periods.+ , commodStrikeSched_choice1 :: (Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to the Calculation Periods + -- defined on another leg.+ -- + -- (2) A pointer style reference to the Calculation Periods + -- Schedule defined on another leg.+ -- + -- (3) A pointer style reference to single-day-duration + -- Calculation Periods defined on another leg.+ }+ deriving (Eq,Show)+instance SchemaType CommodityStrikeSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CommodityStrikeSchedule+ `apply` many (parseSchemaType "strikePricePerUnitStep")+ `apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))+ , ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))+ ])+ schemaTypeToXML s x@CommodityStrikeSchedule{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "strikePricePerUnitStep") $ commodStrikeSched_strikePricePerUnitStep x+ , maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")+ (schemaTypeToXML "calculationPeriodsScheduleReference")+ (schemaTypeToXML "calculationPeriodsDatesReference")+ ) $ commodStrikeSched_choice1 x+ ]+ +-- | Commodity Swap.+data CommoditySwap = CommoditySwap+ { commodSwap_ID :: Maybe Xsd.ID+ , commodSwap_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , commodSwap_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , commodSwap_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , commodSwap_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , commodSwap_effectiveDate :: AdjustableOrRelativeDate+ -- ^ Specifies the effective date of this leg of the swap. When + -- defined in relation to a date specified somewhere else in + -- the document (through the relativeDate component), this + -- element will typically point to the effective date of the + -- other leg of the swap.+ , commodSwap_terminationDate :: AdjustableOrRelativeDate+ -- ^ Specifies the termination date of this leg of the swap. + -- When defined in relation to a date specified somewhere else + -- in the document (through the relativeDate component), this + -- element will typically point to the termination date of the + -- other leg of the swap.+ , commodSwap_settlementCurrency :: Maybe IdentifiedCurrency+ -- ^ The currency into which the Commodity Swap Transaction will + -- settle. If this is not the same as the currency in which + -- the Commodity Reference Price is quoted on a given floating + -- leg of the Commodity Swap Transaction, then an FX rate + -- should also be specified for that leg.+ , commoditySwap_leg :: [CommoditySwapLeg]+ -- ^ Defines the substitutable commodity swap leg+ , commodSwap_commonPricing :: Maybe Xsd.Boolean+ -- ^ Common pricing may be relevant for a Transaction that + -- references more than one Commodity Reference Price. If + -- Common Pricing is not specified as applicable, it will be + -- deemed not to apply.+ , commodSwap_marketDisruption :: Maybe CommodityMarketDisruption+ -- ^ Market disruption events as defined in the ISDA 1993 + -- Commodity Definitions or in ISDA 2005 Commodity + -- Definitions, as applicable.+ , commodSwap_settlementDisruption :: Maybe CommodityBullionSettlementDisruptionEnum+ -- ^ The consequences of Bullion Settlement Disruption Events.+ , commodSwap_rounding :: Maybe Rounding+ -- ^ Rounding direction and precision for amounts.+ }+ deriving (Eq,Show)+instance SchemaType CommoditySwap where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommoditySwap a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` parseSchemaType "effectiveDate"+ `apply` parseSchemaType "terminationDate"+ `apply` optional (parseSchemaType "settlementCurrency")+ `apply` many (elementCommoditySwapLeg)+ `apply` optional (parseSchemaType "commonPricing")+ `apply` optional (parseSchemaType "marketDisruption")+ `apply` optional (parseSchemaType "settlementDisruption")+ `apply` optional (parseSchemaType "rounding")+ schemaTypeToXML s x@CommoditySwap{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodSwap_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ commodSwap_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ commodSwap_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ commodSwap_productType x+ , concatMap (schemaTypeToXML "productId") $ commodSwap_productId x+ , schemaTypeToXML "effectiveDate" $ commodSwap_effectiveDate x+ , schemaTypeToXML "terminationDate" $ commodSwap_terminationDate x+ , maybe [] (schemaTypeToXML "settlementCurrency") $ commodSwap_settlementCurrency x+ , concatMap (elementToXMLCommoditySwapLeg) $ commoditySwap_leg x+ , maybe [] (schemaTypeToXML "commonPricing") $ commodSwap_commonPricing x+ , maybe [] (schemaTypeToXML "marketDisruption") $ commodSwap_marketDisruption x+ , maybe [] (schemaTypeToXML "settlementDisruption") $ commodSwap_settlementDisruption x+ , maybe [] (schemaTypeToXML "rounding") $ commodSwap_rounding x+ ]+instance Extension CommoditySwap Product where+ supertype v = Product_CommoditySwap v+ +-- | Commodity Swaption.+data CommoditySwaption = CommoditySwaption+ { commodSwapt_ID :: Maybe Xsd.ID+ , commodSwapt_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , commodSwapt_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , commodSwapt_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , commodSwapt_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , commodSwapt_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , commodSwapt_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , commodSwapt_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , commodSwapt_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , commodSwapt_optionType :: Maybe PutCallEnum+ -- ^ The type of option transaction.+ , commodSwapt_commoditySwap :: Maybe CommoditySwaptionUnderlying+ -- ^ The underlying commodity swap definiton.+ , commodSwapt_physicalExercise :: Maybe CommodityPhysicalExercise+ -- ^ The parameters for defining how the commodity option can be + -- exercised into a physical transaction.+ , commodSwapt_premium :: Maybe CommodityPremium+ -- ^ The option premium payable by the buyer to the seller.+ , commodSwapt_commonPricing :: Maybe Xsd.Boolean+ -- ^ Common pricing may be relevant for a Transaction that + -- references more than one Commodity Reference Price. If + -- Common Pricing is not specified as applicable, it will be + -- deemed not to apply.+ , commodSwapt_marketDisruption :: Maybe CommodityMarketDisruption+ -- ^ Market disruption events as defined in the ISDA 1993 + -- Commodity Definitions or in ISDA 2005 Commodity + -- Definitions, as applicable.+ , commodSwapt_settlementDisruption :: Maybe CommodityBullionSettlementDisruptionEnum+ -- ^ The consequences of Bullion Settlement Disruption Events.+ , commodSwapt_rounding :: Maybe Rounding+ -- ^ Rounding direction and precision for amounts.+ }+ deriving (Eq,Show)+instance SchemaType CommoditySwaption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CommoditySwaption 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 (parseSchemaType "optionType")+ `apply` optional (parseSchemaType "commoditySwap")+ `apply` optional (parseSchemaType "physicalExercise")+ `apply` optional (parseSchemaType "premium")+ `apply` optional (parseSchemaType "commonPricing")+ `apply` optional (parseSchemaType "marketDisruption")+ `apply` optional (parseSchemaType "settlementDisruption")+ `apply` optional (parseSchemaType "rounding")+ schemaTypeToXML s x@CommoditySwaption{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodSwapt_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ commodSwapt_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ commodSwapt_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ commodSwapt_productType x+ , concatMap (schemaTypeToXML "productId") $ commodSwapt_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ commodSwapt_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ commodSwapt_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ commodSwapt_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ commodSwapt_sellerAccountReference x+ , maybe [] (schemaTypeToXML "optionType") $ commodSwapt_optionType x+ , maybe [] (schemaTypeToXML "commoditySwap") $ commodSwapt_commoditySwap x+ , maybe [] (schemaTypeToXML "physicalExercise") $ commodSwapt_physicalExercise x+ , maybe [] (schemaTypeToXML "premium") $ commodSwapt_premium x+ , maybe [] (schemaTypeToXML "commonPricing") $ commodSwapt_commonPricing x+ , maybe [] (schemaTypeToXML "marketDisruption") $ commodSwapt_marketDisruption x+ , maybe [] (schemaTypeToXML "settlementDisruption") $ commodSwapt_settlementDisruption x+ , maybe [] (schemaTypeToXML "rounding") $ commodSwapt_rounding x+ ]+instance Extension CommoditySwaption Product where+ supertype v = Product_CommoditySwaption v+ +data CommoditySwaptionUnderlying = CommoditySwaptionUnderlying+ { commodSwaptUnderly_effectiveDate :: AdjustableOrRelativeDate+ -- ^ Specifies the effective date of this leg of the swap. When + -- defined in relation to a date specified somewhere else in + -- the document (through the relativeDate component), this + -- element will typically point to the effective date of the + -- other leg of the swap.+ , commodSwaptUnderly_terminationDate :: AdjustableOrRelativeDate+ -- ^ Specifies the termination date of this leg of the swap. + -- When defined in relation to a date specified somewhere else + -- in the document (through the relativeDate component), this + -- element will typically point to the termination date of the + -- other leg of the swap.+ , commodSwaptUnderly_settlementCurrency :: Maybe IdentifiedCurrency+ -- ^ The currency into which the Commodity Swap Transaction will + -- settle. If this is not the same as the currency in which + -- the Commodity Reference Price is quoted on a given floating + -- leg of the Commodity Swap Transaction, then an FX rate + -- should also be specified for that leg.+ , commodSwaptUnderly_commoditySwapLeg :: [CommoditySwapLeg]+ -- ^ Defines the substitutable commodity swap leg+ , commodSwaptUnderly_commonPricing :: Maybe Xsd.Boolean+ -- ^ Common pricing may be relevant for a Transaction that + -- references more than one Commodity Reference Price. If + -- Common Pricing is not specified as applicable, it will be + -- deemed not to apply.+ , commodSwaptUnderly_marketDisruption :: Maybe CommodityMarketDisruption+ -- ^ Market disruption events as defined in the ISDA 1993 + -- Commodity Definitions or in ISDA 2005 Commodity + -- Definitions, as applicable.+ , commodSwaptUnderly_settlementDisruption :: Maybe CommodityBullionSettlementDisruptionEnum+ -- ^ The consequences of Bullion Settlement Disruption Events.+ , commodSwaptUnderly_rounding :: Maybe Rounding+ -- ^ Rounding direction and precision for amounts.+ }+ deriving (Eq,Show)+instance SchemaType CommoditySwaptionUnderlying where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CommoditySwaptionUnderlying+ `apply` parseSchemaType "effectiveDate"+ `apply` parseSchemaType "terminationDate"+ `apply` optional (parseSchemaType "settlementCurrency")+ `apply` many (elementCommoditySwapLeg)+ `apply` optional (parseSchemaType "commonPricing")+ `apply` optional (parseSchemaType "marketDisruption")+ `apply` optional (parseSchemaType "settlementDisruption")+ `apply` optional (parseSchemaType "rounding")+ schemaTypeToXML s x@CommoditySwaptionUnderlying{} =+ toXMLElement s []+ [ schemaTypeToXML "effectiveDate" $ commodSwaptUnderly_effectiveDate x+ , schemaTypeToXML "terminationDate" $ commodSwaptUnderly_terminationDate x+ , maybe [] (schemaTypeToXML "settlementCurrency") $ commodSwaptUnderly_settlementCurrency x+ , concatMap (elementToXMLCommoditySwapLeg) $ commodSwaptUnderly_commoditySwapLeg x+ , maybe [] (schemaTypeToXML "commonPricing") $ commodSwaptUnderly_commonPricing x+ , maybe [] (schemaTypeToXML "marketDisruption") $ commodSwaptUnderly_marketDisruption x+ , maybe [] (schemaTypeToXML "settlementDisruption") $ commodSwaptUnderly_settlementDisruption x+ , maybe [] (schemaTypeToXML "rounding") $ commodSwaptUnderly_rounding x+ ]+ +-- | Abstract base class for all commodity swap legs+data CommoditySwapLeg+ = CommoditySwapLeg_PhysicalSwapLeg PhysicalSwapLeg+ | CommoditySwapLeg_NonPeriodicFixedPriceLeg NonPeriodicFixedPriceLeg+ | CommoditySwapLeg_FinancialSwapLeg FinancialSwapLeg+ + deriving (Eq,Show)+instance SchemaType CommoditySwapLeg where+ parseSchemaType s = do+ (fmap CommoditySwapLeg_PhysicalSwapLeg $ parseSchemaType s)+ `onFail`+ (fmap CommoditySwapLeg_NonPeriodicFixedPriceLeg $ parseSchemaType s)+ `onFail`+ (fmap CommoditySwapLeg_FinancialSwapLeg $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of CommoditySwapLeg,\n\+\ namely one of:\n\+\PhysicalSwapLeg,NonPeriodicFixedPriceLeg,FinancialSwapLeg"+ schemaTypeToXML _s (CommoditySwapLeg_PhysicalSwapLeg x) = schemaTypeToXML "physicalSwapLeg" x+ schemaTypeToXML _s (CommoditySwapLeg_NonPeriodicFixedPriceLeg x) = schemaTypeToXML "nonPeriodicFixedPriceLeg" x+ schemaTypeToXML _s (CommoditySwapLeg_FinancialSwapLeg x) = schemaTypeToXML "financialSwapLeg" x+instance Extension CommoditySwapLeg Leg where+ supertype v = Leg_CommoditySwapLeg v+ +-- | A Disruption Fallback.+data DisruptionFallback = DisruptionFallback Scheme DisruptionFallbackAttributes deriving (Eq,Show)+data DisruptionFallbackAttributes = DisruptionFallbackAttributes+ { disrupFallbAttrib_commodityMarketDisruptionFallbackScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType DisruptionFallback where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "commodityMarketDisruptionFallbackScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ DisruptionFallback v (DisruptionFallbackAttributes a0)+ schemaTypeToXML s (DisruptionFallback bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "commodityMarketDisruptionFallbackScheme") $ disrupFallbAttrib_commodityMarketDisruptionFallbackScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension DisruptionFallback Scheme where+ supertype (DisruptionFallback s _) = s+ +-- | The physical delivery conditions for electricity.+data ElectricityDelivery = ElectricityDelivery+ { electrDeliv_choice0 :: OneOf2 (ElectricityDeliveryPoint,ElectricityDeliveryType,(Maybe (ElectricityTransmissionContingency))) ((Maybe (CommodityDeliveryPoint)),(Maybe (PartyReference)))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The point at which delivery of the electricity will + -- occur.+ -- + -- * Indicates the under what conditions the Parties' + -- delivery obligations apply.+ -- + -- * Indicates that the performance of the buyer or + -- seller shall be excused (under the conditions + -- specified) if transmission of the elctricity is + -- unavailable or interrupted.+ -- + -- (2) Sequence of:+ -- + -- * The zone covering potential delivery points for the + -- electricity.+ -- + -- * Indicates the party able to decide which delivery + -- point within the deliveryPoint is used for + -- delivery. For EEI transactions, this should + -- reference the seller of the electricity.+ }+ deriving (Eq,Show)+instance SchemaType ElectricityDelivery where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ElectricityDelivery+ `apply` oneOf' [ ("ElectricityDeliveryPoint ElectricityDeliveryType Maybe ElectricityTransmissionContingency", fmap OneOf2 (return (,,) `apply` parseSchemaType "deliveryPoint"+ `apply` parseSchemaType "deliveryType"+ `apply` optional (parseSchemaType "transmissionContingency")))+ , ("Maybe CommodityDeliveryPoint Maybe PartyReference", fmap TwoOf2 (return (,) `apply` optional (parseSchemaType "deliveryZone")+ `apply` optional (parseSchemaType "electingPartyReference")))+ ]+ schemaTypeToXML s x@ElectricityDelivery{} =+ toXMLElement s []+ [ foldOneOf2 (\ (a,b,c) -> concat [ schemaTypeToXML "deliveryPoint" a+ , schemaTypeToXML "deliveryType" b+ , maybe [] (schemaTypeToXML "transmissionContingency") c+ ])+ (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "deliveryZone") a+ , maybe [] (schemaTypeToXML "electingPartyReference") b+ ])+ $ electrDeliv_choice0 x+ ]+ +-- | The physical delivery obligation options specific to a firm +-- transaction.+data ElectricityDeliveryFirm = ElectricityDeliveryFirm+ { electrDelivFirm_forceMajeure :: Maybe Xsd.Boolean+ -- ^ If true, indicates that the buyer and seller should be + -- excused of their delivery obligations when such performance + -- is prevented by Force Majeure. For EEI transactions, this + -- would indicate "Firm (LD)" If false, indicates that the + -- buyer and seller should not be excused of their delivery + -- obligations when such performance is prevented by Force + -- Majeure. For EEI transactions, this would indicate "Firm + -- (No Force Majeure)"+ }+ deriving (Eq,Show)+instance SchemaType ElectricityDeliveryFirm where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ElectricityDeliveryFirm+ `apply` optional (parseSchemaType "forceMajeure")+ schemaTypeToXML s x@ElectricityDeliveryFirm{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "forceMajeure") $ electrDelivFirm_forceMajeure x+ ]+ +-- | The different options for specifying the Delivery Periods +-- for a physically settled electricity trade.+data ElectricityDeliveryPeriods = ElectricityDeliveryPeriods+ { electrDelivPeriods_ID :: Maybe Xsd.ID+ , electrDelivPeriods_choice0 :: OneOf3 AdjustableDates CommodityCalculationPeriodsSchedule ((Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference)))+ -- ^ Choice between:+ -- + -- (1) The Delivery Periods for this leg of the swap. This + -- type is only intended to be used if the Delivery + -- Periods differ from the Calculation Periods on the + -- fixed or floating leg. If DeliveryPeriods mirror + -- another leg, then the calculationPeriodsReference + -- element should be used to point to the Calculation + -- Periods on that leg - or the + -- calculationPeriodsScheduleReference can be used to + -- point to the Calculation Periods Schedule for that leg.+ -- + -- (2) The Delivery Periods for this leg of the swap. This + -- type is only intended to be used if the Delivery + -- Periods differ from the Calculation Periods on the + -- fixed or floating leg. If DeliveryPeriods mirror + -- another leg, then the calculationPeriodsReference + -- element should be used to point to the Calculation + -- Periods on that leg - or the + -- calculationPeriodsScheduleReference can be used to + -- point to the Calculation Periods Schedule for that leg.+ -- + -- (3) unknown+ , electrDelivPeriods_settlementPeriods :: [SettlementPeriods]+ -- ^ The periods within the Delivery Periods during which the + -- electricity will be delivered.+ }+ deriving (Eq,Show)+instance SchemaType ElectricityDeliveryPeriods where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ElectricityDeliveryPeriods a0)+ `apply` oneOf' [ ("AdjustableDates", fmap OneOf3 (parseSchemaType "periods"))+ , ("CommodityCalculationPeriodsSchedule", fmap TwoOf3 (parseSchemaType "periodsSchedule"))+ , ("(Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))", fmap ThreeOf3 (optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))+ , ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))+ ])))+ ]+ `apply` many (parseSchemaType "settlementPeriods")+ schemaTypeToXML s x@ElectricityDeliveryPeriods{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ electrDelivPeriods_ID x+ ]+ [ foldOneOf3 (schemaTypeToXML "periods")+ (schemaTypeToXML "periodsSchedule")+ (maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")+ (schemaTypeToXML "calculationPeriodsScheduleReference")+ (schemaTypeToXML "calculationPeriodsDatesReference")+ ))+ $ electrDelivPeriods_choice0 x+ , concatMap (schemaTypeToXML "settlementPeriods") $ electrDelivPeriods_settlementPeriods x+ ]+instance Extension ElectricityDeliveryPeriods CommodityDeliveryPeriods where+ supertype (ElectricityDeliveryPeriods a0 e0 e1) =+ CommodityDeliveryPeriods a0 e0+ +-- | A scheme identifying the types of the Delivery Point for a +-- physically settled electricity trade.+data ElectricityDeliveryPoint = ElectricityDeliveryPoint Scheme ElectricityDeliveryPointAttributes deriving (Eq,Show)+data ElectricityDeliveryPointAttributes = ElectricityDeliveryPointAttributes+ { electrDelivPointAttrib_deliveryPointScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ElectricityDeliveryPoint where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "deliveryPointScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ElectricityDeliveryPoint v (ElectricityDeliveryPointAttributes a0)+ schemaTypeToXML s (ElectricityDeliveryPoint bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "deliveryPointScheme") $ electrDelivPointAttrib_deliveryPointScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ElectricityDeliveryPoint Scheme where+ supertype (ElectricityDeliveryPoint s _) = s+ +-- | The physical delivery obligation options specific to a +-- system firm transaction.+data ElectricityDeliverySystemFirm = ElectricityDeliverySystemFirm+ { electrDelivSystemFirm_applicable :: Maybe Xsd.Boolean+ -- ^ Indicates that the trade is for a System Firm product. + -- Should always be set to "true".+ , electrDelivSystemFirm_system :: Maybe CommodityDeliveryPoint+ }+ deriving (Eq,Show)+instance SchemaType ElectricityDeliverySystemFirm where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ElectricityDeliverySystemFirm+ `apply` optional (parseSchemaType "applicable")+ `apply` optional (parseSchemaType "system")+ schemaTypeToXML s x@ElectricityDeliverySystemFirm{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "applicable") $ electrDelivSystemFirm_applicable x+ , maybe [] (schemaTypeToXML "system") $ electrDelivSystemFirm_system x+ ]+ +data ElectricityDeliveryType = ElectricityDeliveryType+ { electrDelivType_choice0 :: (Maybe (OneOf4 ElectricityDeliveryFirm Xsd.Boolean ElectricityDeliverySystemFirm ElectricityDeliveryUnitFirm))+ -- ^ Choice between:+ -- + -- (1) Indicates under what condtitions the Parties' delivery + -- obligations apply.+ -- + -- (2) If present and set to true, indicates that delivery or + -- receipt of the electricity may be interrupted for any + -- reason or for no reason, without liability on the part + -- of either Party. This element should never have a value + -- of false.+ -- + -- (3) Indicates that the electricity is intended to be + -- supplied from the owned or controlled generation or + -- pre-existing purchased power assets of the system + -- specified.+ -- + -- (4) Indicates that the electricity is intended to be + -- supplied from a generation asset which can optionally + -- be specified.+ }+ deriving (Eq,Show)+instance SchemaType ElectricityDeliveryType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ElectricityDeliveryType+ `apply` optional (oneOf' [ ("ElectricityDeliveryFirm", fmap OneOf4 (parseSchemaType "firm"))+ , ("Xsd.Boolean", fmap TwoOf4 (parseSchemaType "nonFirm"))+ , ("ElectricityDeliverySystemFirm", fmap ThreeOf4 (parseSchemaType "systemFirm"))+ , ("ElectricityDeliveryUnitFirm", fmap FourOf4 (parseSchemaType "unitFirm"))+ ])+ schemaTypeToXML s x@ElectricityDeliveryType{} =+ toXMLElement s []+ [ maybe [] (foldOneOf4 (schemaTypeToXML "firm")+ (schemaTypeToXML "nonFirm")+ (schemaTypeToXML "systemFirm")+ (schemaTypeToXML "unitFirm")+ ) $ electrDelivType_choice0 x+ ]+ +-- | The physical delivery obligation options specific to a unit +-- firm transaction.+data ElectricityDeliveryUnitFirm = ElectricityDeliveryUnitFirm+ { electrDelivUnitFirm_applicable :: Maybe Xsd.Boolean+ -- ^ Indicates that the trade is for a Unit Firm product. Should + -- always be set to "true".+ , electrDelivUnitFirm_generationAsset :: Maybe CommodityDeliveryPoint+ }+ deriving (Eq,Show)+instance SchemaType ElectricityDeliveryUnitFirm where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ElectricityDeliveryUnitFirm+ `apply` optional (parseSchemaType "applicable")+ `apply` optional (parseSchemaType "generationAsset")+ schemaTypeToXML s x@ElectricityDeliveryUnitFirm{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "applicable") $ electrDelivUnitFirm_applicable x+ , maybe [] (schemaTypeToXML "generationAsset") $ electrDelivUnitFirm_generationAsset x+ ]+ +-- | A type defining the physical quantity of the electricity to +-- be delivered.+data ElectricityPhysicalDeliveryQuantity = ElectricityPhysicalDeliveryQuantity+ { epdq_ID :: Maybe Xsd.ID+ , epdq_quantityUnit :: QuantityUnit+ -- ^ Quantity Unit is the unit of measure applicable for the + -- quantity on the Transaction.+ , epdq_quantityFrequency :: Maybe CommodityQuantityFrequency+ -- ^ The frequency at which the Notional Quantity is deemed to + -- apply for purposes of calculating the Total Notional + -- Quantity.+ , epdq_quantity :: Maybe Xsd.Decimal+ -- ^ Amount of commodity per quantity frequency.+ , epdq_settlementPeriodsReference :: [SettlementPeriodsReference]+ -- ^ A pointer style reference to the range(s) of Settlement + -- Periods to which this quantity applies.+ }+ deriving (Eq,Show)+instance SchemaType ElectricityPhysicalDeliveryQuantity where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ElectricityPhysicalDeliveryQuantity a0)+ `apply` parseSchemaType "quantityUnit"+ `apply` optional (parseSchemaType "quantityFrequency")+ `apply` optional (parseSchemaType "quantity")+ `apply` many (parseSchemaType "settlementPeriodsReference")+ schemaTypeToXML s x@ElectricityPhysicalDeliveryQuantity{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ epdq_ID x+ ]+ [ schemaTypeToXML "quantityUnit" $ epdq_quantityUnit x+ , maybe [] (schemaTypeToXML "quantityFrequency") $ epdq_quantityFrequency x+ , maybe [] (schemaTypeToXML "quantity") $ epdq_quantity x+ , concatMap (schemaTypeToXML "settlementPeriodsReference") $ epdq_settlementPeriodsReference x+ ]+instance Extension ElectricityPhysicalDeliveryQuantity CommodityNotionalQuantity where+ supertype (ElectricityPhysicalDeliveryQuantity a0 e0 e1 e2 e3) =+ CommodityNotionalQuantity a0 e0 e1 e2+ +-- | Allows the documentation of a shaped quantity trade where +-- the quantity changes over the life of the transaction.+data ElectricityPhysicalDeliveryQuantitySchedule = ElectricityPhysicalDeliveryQuantitySchedule+ { epdqs_ID :: Maybe Xsd.ID+ , epdqs_quantityStep :: [CommodityNotionalQuantity]+ -- ^ The quantity per Calculation Period. There must be a + -- quantity specified for each Calculation Period, regardless + -- of whether the quantity changes or remains the same between + -- periods.+ , epdqs_choice1 :: (Maybe (OneOf2 CalculationPeriodsReference CalculationPeriodsScheduleReference))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to the Delivery Periods + -- defined elsewhere.+ -- + -- (2) A pointer style reference to the Calculation Periods + -- Schedule defined elsewhere.+ , epdqs_settlementPeriodsReference :: [SettlementPeriodsReference]+ -- ^ A pointer style reference to the range(s) of Settlement + -- Periods to which this quantity applies.+ }+ deriving (Eq,Show)+instance SchemaType ElectricityPhysicalDeliveryQuantitySchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ElectricityPhysicalDeliveryQuantitySchedule a0)+ `apply` many (parseSchemaType "quantityStep")+ `apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf2 (parseSchemaType "deliveryPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf2 (parseSchemaType "deliveryPeriodsScheduleReference"))+ ])+ `apply` many (parseSchemaType "settlementPeriodsReference")+ schemaTypeToXML s x@ElectricityPhysicalDeliveryQuantitySchedule{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ epdqs_ID x+ ]+ [ concatMap (schemaTypeToXML "quantityStep") $ epdqs_quantityStep x+ , maybe [] (foldOneOf2 (schemaTypeToXML "deliveryPeriodsReference")+ (schemaTypeToXML "deliveryPeriodsScheduleReference")+ ) $ epdqs_choice1 x+ , concatMap (schemaTypeToXML "settlementPeriodsReference") $ epdqs_settlementPeriodsReference x+ ]+instance Extension ElectricityPhysicalDeliveryQuantitySchedule CommodityPhysicalQuantitySchedule where+ supertype (ElectricityPhysicalDeliveryQuantitySchedule a0 e0 e1 e2) =+ CommodityPhysicalQuantitySchedule a0 e0 e1+ +-- | Physically settled leg of a physically settled electricity +-- transaction.+data ElectricityPhysicalLeg = ElectricityPhysicalLeg+ { electrPhysicLeg_ID :: Maybe Xsd.ID+ , electrPhysicLeg_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , electrPhysicLeg_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , electrPhysicLeg_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , electrPhysicLeg_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , electrPhysicLeg_deliveryPeriods :: Maybe CommodityDeliveryPeriods+ -- ^ The different options for specifying the Delivery or Supply + -- Periods. Unless the quantity or price is to vary + -- periodically during the trade or physical delivery occurs + -- on a periodic basis, periodsSchedule should be used and set + -- to 1T.+ , electrPhysicLeg_settlementPeriods :: [SettlementPeriods]+ -- ^ The specification of the Settlement Periods in which the + -- electricity will be delivered. The Settlement Periods will + -- apply from and including the Effective Date up to and + -- including the Termination Date. If more than one + -- settlementPeriods element is present this indicates + -- multiple ranges of Settlement Periods apply to the entire + -- trade - for example off-peak weekdays and all day weekends. + -- Settlement Period ranges should not overlap.+ , electrPhysicLeg_settlementPeriodsSchedule :: Maybe SettlementPeriodsSchedule+ -- ^ The specification of the Settlement Periods in which the + -- electricity will be delivered for a "shaped" trade i.e. + -- where different Settlement Period ranges will apply to + -- different periods of the trade.+ , electrPhysicLeg_electricity :: ElectricityProduct+ -- ^ The specification of the electricity to be delivered.+ , electrPhysicLeg_deliveryConditions :: ElectricityDelivery+ -- ^ The physical delivery conditions for the transaction.+ , electrPhysicLeg_deliveryQuantity :: ElectricityPhysicalQuantity+ -- ^ The different options for specifying the quantity.+ }+ deriving (Eq,Show)+instance SchemaType ElectricityPhysicalLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ElectricityPhysicalLeg a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "deliveryPeriods")+ `apply` many1 (parseSchemaType "settlementPeriods")+ `apply` optional (parseSchemaType "settlementPeriodsSchedule")+ `apply` parseSchemaType "electricity"+ `apply` parseSchemaType "deliveryConditions"+ `apply` parseSchemaType "deliveryQuantity"+ schemaTypeToXML s x@ElectricityPhysicalLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ electrPhysicLeg_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ electrPhysicLeg_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ electrPhysicLeg_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ electrPhysicLeg_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ electrPhysicLeg_receiverAccountReference x+ , maybe [] (schemaTypeToXML "deliveryPeriods") $ electrPhysicLeg_deliveryPeriods x+ , concatMap (schemaTypeToXML "settlementPeriods") $ electrPhysicLeg_settlementPeriods x+ , maybe [] (schemaTypeToXML "settlementPeriodsSchedule") $ electrPhysicLeg_settlementPeriodsSchedule x+ , schemaTypeToXML "electricity" $ electrPhysicLeg_electricity x+ , schemaTypeToXML "deliveryConditions" $ electrPhysicLeg_deliveryConditions x+ , schemaTypeToXML "deliveryQuantity" $ electrPhysicLeg_deliveryQuantity x+ ]+instance Extension ElectricityPhysicalLeg PhysicalSwapLeg where+ supertype v = PhysicalSwapLeg_ElectricityPhysicalLeg v+instance Extension ElectricityPhysicalLeg CommoditySwapLeg where+ supertype = (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)+ . (supertype :: ElectricityPhysicalLeg -> PhysicalSwapLeg)+ +instance Extension ElectricityPhysicalLeg Leg where+ supertype = (supertype :: CommoditySwapLeg -> Leg)+ . (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)+ . (supertype :: ElectricityPhysicalLeg -> PhysicalSwapLeg)+ + +-- | The quantity of gas to be delivered.+data ElectricityPhysicalQuantity = ElectricityPhysicalQuantity+ { electrPhysicQuant_ID :: Maybe Xsd.ID+ , electrPhysicQuant_choice0 :: (Maybe (OneOf2 [ElectricityPhysicalDeliveryQuantity] [ElectricityPhysicalDeliveryQuantitySchedule]))+ -- ^ Choice between:+ -- + -- (1) The Quantity per Delivery Period.+ -- + -- (2) Allows the documentation of a shaped quantity trade + -- where the quantity changes over the life of the + -- transaction. Note that if the range of Settlement + -- Periods also varies over the life of the transaction + -- this element should not be used. Instead, + -- physicalQuantity should be repeated for each range of + -- Settlement Periods that apply at any point during the + -- trade.+ , electrPhysicQuant_totalPhysicalQuantity :: UnitQuantity+ -- ^ The Total Quantity of the commodity to be delivered.+ }+ deriving (Eq,Show)+instance SchemaType ElectricityPhysicalQuantity where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ElectricityPhysicalQuantity a0)+ `apply` optional (oneOf' [ ("[ElectricityPhysicalDeliveryQuantity]", fmap OneOf2 (many1 (parseSchemaType "physicalQuantity")))+ , ("[ElectricityPhysicalDeliveryQuantitySchedule]", fmap TwoOf2 (many1 (parseSchemaType "physicalQuantitySchedule")))+ ])+ `apply` parseSchemaType "totalPhysicalQuantity"+ schemaTypeToXML s x@ElectricityPhysicalQuantity{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ electrPhysicQuant_ID x+ ]+ [ maybe [] (foldOneOf2 (concatMap (schemaTypeToXML "physicalQuantity"))+ (concatMap (schemaTypeToXML "physicalQuantitySchedule"))+ ) $ electrPhysicQuant_choice0 x+ , schemaTypeToXML "totalPhysicalQuantity" $ electrPhysicQuant_totalPhysicalQuantity x+ ]+instance Extension ElectricityPhysicalQuantity CommodityPhysicalQuantityBase where+ supertype v = CommodityPhysicalQuantityBase_ElectricityPhysicalQuantity v+ +-- | The specification of the electricity to be delivered.+data ElectricityProduct = ElectricityProduct+ { electrProduct_type :: Maybe ElectricityProductTypeEnum+ -- ^ The type of electricity product to be delivered.+ , electrProduct_voltage :: Maybe PositiveDecimal+ -- ^ The voltage, expressed as a number of volts, of the + -- electricity to be delivered.+ }+ deriving (Eq,Show)+instance SchemaType ElectricityProduct where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ElectricityProduct+ `apply` optional (parseSchemaType "type")+ `apply` optional (parseSchemaType "voltage")+ schemaTypeToXML s x@ElectricityProduct{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "type") $ electrProduct_type x+ , maybe [] (schemaTypeToXML "voltage") $ electrProduct_voltage x+ ]+ +-- | A structure to specify the tranmission contingency and the +-- party that bears the obligation.+data ElectricityTransmissionContingency = ElectricityTransmissionContingency+ { electrTransmContin_contingency :: Maybe ElectricityTransmissionContingencyType+ -- ^ The conditions under which the party specified in + -- contingentParty will be excused from damages if + -- transmission is interrupted or curtailed.+ , electrTransmContin_contingentParty :: [PartyReference]+ -- ^ The party to which the contingency applies.+ }+ deriving (Eq,Show)+instance SchemaType ElectricityTransmissionContingency where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ElectricityTransmissionContingency+ `apply` optional (parseSchemaType "contingency")+ `apply` between (Occurs (Just 0) (Just 2))+ (parseSchemaType "contingentParty")+ schemaTypeToXML s x@ElectricityTransmissionContingency{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "contingency") $ electrTransmContin_contingency x+ , concatMap (schemaTypeToXML "contingentParty") $ electrTransmContin_contingentParty x+ ]+ +-- | The type of transmission contingency, i.e. what portion of +-- the transmission the delivery obligations are applicable.+data ElectricityTransmissionContingencyType = ElectricityTransmissionContingencyType Scheme ElectricityTransmissionContingencyTypeAttributes deriving (Eq,Show)+data ElectricityTransmissionContingencyTypeAttributes = ElectricityTransmissionContingencyTypeAttributes+ { etcta_electricityTransmissionContingencyScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ElectricityTransmissionContingencyType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "electricityTransmissionContingencyScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ElectricityTransmissionContingencyType v (ElectricityTransmissionContingencyTypeAttributes a0)+ schemaTypeToXML s (ElectricityTransmissionContingencyType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "electricityTransmissionContingencyScheme") $ etcta_electricityTransmissionContingencyScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ElectricityTransmissionContingencyType Scheme where+ supertype (ElectricityTransmissionContingencyType s _) = s+ +-- | The common components of a financially settled leg of a +-- Commodity Swap. This is an abstract type and should be +-- extended by commodity-specific types.+data FinancialSwapLeg+ = FinancialSwapLeg_FloatingPriceLeg FloatingPriceLeg+ | FinancialSwapLeg_FixedPriceLeg FixedPriceLeg+ + deriving (Eq,Show)+instance SchemaType FinancialSwapLeg where+ parseSchemaType s = do+ (fmap FinancialSwapLeg_FloatingPriceLeg $ parseSchemaType s)+ `onFail`+ (fmap FinancialSwapLeg_FixedPriceLeg $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of FinancialSwapLeg,\n\+\ namely one of:\n\+\FloatingPriceLeg,FixedPriceLeg"+ schemaTypeToXML _s (FinancialSwapLeg_FloatingPriceLeg x) = schemaTypeToXML "floatingPriceLeg" x+ schemaTypeToXML _s (FinancialSwapLeg_FixedPriceLeg x) = schemaTypeToXML "fixedPriceLeg" x+instance Extension FinancialSwapLeg CommoditySwapLeg where+ supertype v = CommoditySwapLeg_FinancialSwapLeg v+ +-- | A type defining the Fixed Price.+data FixedPrice = FixedPrice+ { fixedPrice_ID :: Maybe Xsd.ID+ , fixedPrice_price :: Xsd.Decimal+ -- ^ The Fixed Price.+ , fixedPrice_priceCurrency :: Currency+ -- ^ Currency of the fixed price.+ , fixedPrice_priceUnit :: QuantityUnit+ -- ^ The unit of measure used to calculate the Fixed Price.+ }+ deriving (Eq,Show)+instance SchemaType FixedPrice where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FixedPrice a0)+ `apply` parseSchemaType "price"+ `apply` parseSchemaType "priceCurrency"+ `apply` parseSchemaType "priceUnit"+ schemaTypeToXML s x@FixedPrice{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fixedPrice_ID x+ ]+ [ schemaTypeToXML "price" $ fixedPrice_price x+ , schemaTypeToXML "priceCurrency" $ fixedPrice_priceCurrency x+ , schemaTypeToXML "priceUnit" $ fixedPrice_priceUnit x+ ]+ +-- | Fixed Price Leg of a Commodity Swap.+data FixedPriceLeg = FixedPriceLeg+ { fixedPriceLeg_ID :: Maybe Xsd.ID+ , fixedPriceLeg_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , fixedPriceLeg_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , fixedPriceLeg_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , fixedPriceLeg_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , fixedPriceLeg_choice4 :: OneOf4 AdjustableDates AdjustableDates CommodityCalculationPeriodsSchedule ((Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference)))+ -- ^ Choice between:+ -- + -- (1) The Calculation Period dates for this leg of the trade + -- where the Calculation Periods are all one day long, + -- typically a physically-settled emissions or metals + -- trade. Only dates explicitly included determine the + -- Calculation Periods and there is a Calculation Period + -- for each date specified.+ -- + -- (2) The Calculation Period start dates for this leg of the + -- swap. This type is only intended to be used if the + -- Calculation Periods differ on each leg. If Calculation + -- Periods mirror another leg, then the + -- calculationPeriodsReference element should be used to + -- point to the Calculation Periods on that leg - or the + -- calculationPeriodsScheduleReference can be used to + -- point to the Calculation Periods Schedule for that leg.+ -- + -- (3) The Calculation Periods for this leg of the swap. This + -- type is only intended to be used if the Calculation + -- Periods differ on each leg. If Calculation Periods + -- mirror another leg, then the + -- calculationPeriodsReference element should be used to + -- point to the Calculation Periods on the other leg - or + -- the calculationPeriodsScheduleReference can be used to + -- point to the Calculation Periods Schedule for that leg.+ -- + -- (4) unknown+ , fixedPriceLeg_choice5 :: OneOf2 CommodityFixedPriceSchedule (OneOf4 FixedPrice Xsd.Decimal NonNegativeMoney [SettlementPeriodsFixedPrice])+ -- ^ Choice between:+ -- + -- (1) Allows the specification of a Fixed Price that varies + -- over the life of the trade.+ -- + -- (2) unknown+ , fixedPriceLeg_totalPrice :: Maybe NonNegativeMoney+ -- ^ The total amount of all fixed payments due during the term + -- of the trade.+ , fixedPriceLeg_choice7 :: OneOf2 ((OneOf3 CommodityNotionalQuantitySchedule CommodityNotionalQuantity [CommoditySettlementPeriodsNotionalQuantity]),Xsd.Decimal) QuantityReference+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * unknown+ -- + -- * The Total Notional Quantity.+ -- + -- (2) A pointer style reference to a quantity defined on + -- another leg.+ , fixedPriceLeg_choice8 :: OneOf2 CommodityRelativePaymentDates ((Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean)))+ -- ^ Choice between:+ -- + -- (1) The Payment Dates of the trade relative to the + -- Calculation Periods.+ -- + -- (2) unknown+ , fixedPriceLeg_flatRate :: Maybe FlatRateEnum+ -- ^ Whether the Flat Rate is the New Worldwide Tanker Nominal + -- Freight Scale for the Freight Index Route taken at the + -- Trade Date of the transaction or taken on each Pricing + -- Date.+ , fixedPriceLeg_flatRateAmount :: Maybe NonNegativeMoney+ -- ^ If flatRate is set to "Fixed", the actual value of the Flat + -- Rate.+ }+ deriving (Eq,Show)+instance SchemaType FixedPriceLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FixedPriceLeg a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` oneOf' [ ("AdjustableDates", fmap OneOf4 (parseSchemaType "calculationDates"))+ , ("AdjustableDates", fmap TwoOf4 (parseSchemaType "calculationPeriods"))+ , ("CommodityCalculationPeriodsSchedule", fmap ThreeOf4 (parseSchemaType "calculationPeriodsSchedule"))+ , ("(Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))", fmap FourOf4 (optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))+ , ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))+ ])))+ ]+ `apply` oneOf' [ ("CommodityFixedPriceSchedule", fmap OneOf2 (parseSchemaType "fixedPriceSchedule"))+ , ("OneOf4 FixedPrice Xsd.Decimal NonNegativeMoney [SettlementPeriodsFixedPrice]", fmap TwoOf2 (oneOf' [ ("FixedPrice", fmap OneOf4 (parseSchemaType "fixedPrice"))+ , ("Xsd.Decimal", fmap TwoOf4 (parseSchemaType "worldscaleRate"))+ , ("NonNegativeMoney", fmap ThreeOf4 (parseSchemaType "contractRate"))+ , ("[SettlementPeriodsFixedPrice]", fmap FourOf4 (many1 (parseSchemaType "settlementPeriodsPrice")))+ ]))+ ]+ `apply` optional (parseSchemaType "totalPrice")+ `apply` oneOf' [ ("OneOf3 CommodityNotionalQuantitySchedule CommodityNotionalQuantity [CommoditySettlementPeriodsNotionalQuantity] Xsd.Decimal", fmap OneOf2 (return (,) `apply` oneOf' [ ("CommodityNotionalQuantitySchedule", fmap OneOf3 (parseSchemaType "notionalQuantitySchedule"))+ , ("CommodityNotionalQuantity", fmap TwoOf3 (parseSchemaType "notionalQuantity"))+ , ("[CommoditySettlementPeriodsNotionalQuantity]", fmap ThreeOf3 (many1 (parseSchemaType "settlementPeriodsNotionalQuantity")))+ ]+ `apply` parseSchemaType "totalNotionalQuantity"))+ , ("QuantityReference", fmap TwoOf2 (parseSchemaType "quantityReference"))+ ]+ `apply` oneOf' [ ("CommodityRelativePaymentDates", fmap OneOf2 (parseSchemaType "relativePaymentDates"))+ , ("(Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean))", fmap TwoOf2 (optional (oneOf' [ ("AdjustableDatesOrRelativeDateOffset", fmap OneOf2 (parseSchemaType "paymentDates"))+ , ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "masterAgreementPaymentDates"))+ ])))+ ]+ `apply` optional (parseSchemaType "flatRate")+ `apply` optional (parseSchemaType "flatRateAmount")+ schemaTypeToXML s x@FixedPriceLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fixedPriceLeg_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ fixedPriceLeg_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ fixedPriceLeg_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ fixedPriceLeg_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ fixedPriceLeg_receiverAccountReference x+ , foldOneOf4 (schemaTypeToXML "calculationDates")+ (schemaTypeToXML "calculationPeriods")+ (schemaTypeToXML "calculationPeriodsSchedule")+ (maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")+ (schemaTypeToXML "calculationPeriodsScheduleReference")+ (schemaTypeToXML "calculationPeriodsDatesReference")+ ))+ $ fixedPriceLeg_choice4 x+ , foldOneOf2 (schemaTypeToXML "fixedPriceSchedule")+ (foldOneOf4 (schemaTypeToXML "fixedPrice")+ (schemaTypeToXML "worldscaleRate")+ (schemaTypeToXML "contractRate")+ (concatMap (schemaTypeToXML "settlementPeriodsPrice"))+ )+ $ fixedPriceLeg_choice5 x+ , maybe [] (schemaTypeToXML "totalPrice") $ fixedPriceLeg_totalPrice x+ , foldOneOf2 (\ (a,b) -> concat [ foldOneOf3 (schemaTypeToXML "notionalQuantitySchedule")+ (schemaTypeToXML "notionalQuantity")+ (concatMap (schemaTypeToXML "settlementPeriodsNotionalQuantity"))+ a+ , schemaTypeToXML "totalNotionalQuantity" b+ ])+ (schemaTypeToXML "quantityReference")+ $ fixedPriceLeg_choice7 x+ , foldOneOf2 (schemaTypeToXML "relativePaymentDates")+ (maybe [] (foldOneOf2 (schemaTypeToXML "paymentDates")+ (schemaTypeToXML "masterAgreementPaymentDates")+ ))+ $ fixedPriceLeg_choice8 x+ , maybe [] (schemaTypeToXML "flatRate") $ fixedPriceLeg_flatRate x+ , maybe [] (schemaTypeToXML "flatRateAmount") $ fixedPriceLeg_flatRateAmount x+ ]+instance Extension FixedPriceLeg FinancialSwapLeg where+ supertype v = FinancialSwapLeg_FixedPriceLeg v+instance Extension FixedPriceLeg CommoditySwapLeg where+ supertype = (supertype :: FinancialSwapLeg -> CommoditySwapLeg)+ . (supertype :: FixedPriceLeg -> FinancialSwapLeg)+ +instance Extension FixedPriceLeg Leg where+ supertype = (supertype :: CommoditySwapLeg -> Leg)+ . (supertype :: FinancialSwapLeg -> CommoditySwapLeg)+ . (supertype :: FixedPriceLeg -> FinancialSwapLeg)+ + +-- | A type to capture details relevant to the calculation of +-- the floating price.+data FloatingLegCalculation = FloatingLegCalculation+ { floatLegCalc_pricingDates :: CommodityPricingDates+ -- ^ Commodity Pricing Dates.+ , floatLegCalc_averagingMethod :: Maybe AveragingMethodEnum+ -- ^ The parties may specify a Method of Averaging where more + -- than one pricing Dates is being specified as being + -- applicable.+ , floatLegCalc_conversionFactor :: Maybe Xsd.Decimal+ -- ^ If the Notional Quantity is specified in a unit that does + -- not match the unit in which the Commodity Reference Price + -- is quoted, the scaling or conversion factor used to convert + -- the Commodity Reference Price unit into the Notional + -- Quantity unit should be stated here. If there is no + -- conversion, this element is not intended to be used.+ , floatLegCalc_rounding :: Maybe Rounding+ -- ^ Rounding direction and precision for price values.+ , floatLegCalc_choice4 :: (Maybe (OneOf2 CommoditySpread [CommoditySpreadSchedule]))+ -- ^ Choice between:+ -- + -- (1) The spread over or under the Commodity Reference Price + -- for this leg of the trade. This element is intended to + -- be used for basis trades.+ -- + -- (2) The spread over or under the Commodity Reference Price + -- for this leg of the trade for each Calculation Period. + -- This element is intended to be used for basis trades.+ , floatLegCalc_fx :: Maybe CommodityFx+ -- ^ FX observations to be used to convert the observed + -- Commodity Reference Price to the Settlement Currency.+ }+ deriving (Eq,Show)+instance SchemaType FloatingLegCalculation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FloatingLegCalculation+ `apply` parseSchemaType "pricingDates"+ `apply` optional (parseSchemaType "averagingMethod")+ `apply` optional (parseSchemaType "conversionFactor")+ `apply` optional (parseSchemaType "rounding")+ `apply` optional (oneOf' [ ("CommoditySpread", fmap OneOf2 (parseSchemaType "spread"))+ , ("[CommoditySpreadSchedule]", fmap TwoOf2 (many1 (parseSchemaType "spreadSchedule")))+ ])+ `apply` optional (parseSchemaType "fx")+ schemaTypeToXML s x@FloatingLegCalculation{} =+ toXMLElement s []+ [ schemaTypeToXML "pricingDates" $ floatLegCalc_pricingDates x+ , maybe [] (schemaTypeToXML "averagingMethod") $ floatLegCalc_averagingMethod x+ , maybe [] (schemaTypeToXML "conversionFactor") $ floatLegCalc_conversionFactor x+ , maybe [] (schemaTypeToXML "rounding") $ floatLegCalc_rounding x+ , maybe [] (foldOneOf2 (schemaTypeToXML "spread")+ (concatMap (schemaTypeToXML "spreadSchedule"))+ ) $ floatLegCalc_choice4 x+ , maybe [] (schemaTypeToXML "fx") $ floatLegCalc_fx x+ ]+ +-- | Floating Price Leg of a Commodity Swap.+data FloatingPriceLeg = FloatingPriceLeg+ { floatPriceLeg_ID :: Maybe Xsd.ID+ , floatPriceLeg_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , floatPriceLeg_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , floatPriceLeg_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , floatPriceLeg_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , floatPriceLeg_choice4 :: OneOf4 AdjustableDates AdjustableDates CommodityCalculationPeriodsSchedule ((Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference)))+ -- ^ Choice between:+ -- + -- (1) The Calculation Period dates for this leg of the trade + -- where the Calculation Periods are all one day long, + -- typically a physically-settled emissions or metals + -- trade. Only dates explicitly included determine the + -- Calculation Periods and there is a Calculation Period + -- for each date specified.+ -- + -- (2) The Calculation Period start dates for this leg of the + -- swap. This type is only intended to be used if the + -- Calculation Periods differ on each leg. If Calculation + -- Periods mirror another leg, then the + -- calculationPeriodsReference element should be used to + -- point to the Calculation Periods on that leg - or the + -- calculationPeriodsScheduleReference can be used to + -- point to the Calculation Periods Schedule for that leg.+ -- + -- (3) The Calculation Periods for this leg of the swap. This + -- type is only intended to be used if the Calculation + -- Periods differ on each leg. If Calculation Periods + -- mirror another leg, then the + -- calculationPeriodsReference element should be used to + -- point to the Calculation Periods on the other leg - or + -- the calculationPeriodsScheduleReference can be used to + -- point to the Calculation Periods Schedule for that leg.+ -- + -- (4) unknown+ , floatPriceLeg_commodity :: Commodity+ -- ^ Specifies the underlying instrument. At this time, only + -- underlyers of type Commodity are supported; the choice + -- group in the future could offer the possibility of adding + -- other types later.+ , floatPriceLeg_choice6 :: OneOf2 ((OneOf3 CommodityNotionalQuantitySchedule CommodityNotionalQuantity [CommoditySettlementPeriodsNotionalQuantity]),Xsd.Decimal) QuantityReference+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * unknown+ -- + -- * The Total Notional Quantity.+ -- + -- (2) A pointer style reference to a quantity defined on + -- another leg.+ , floatPriceLeg_calculation :: FloatingLegCalculation+ -- ^ Defines details relevant to the calculation of the floating + -- price.+ , floatPriceLeg_choice8 :: OneOf2 CommodityRelativePaymentDates ((Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean)))+ -- ^ Choice between:+ -- + -- (1) The Payment Dates of the trade relative to the + -- Calculation Periods.+ -- + -- (2) unknown+ , floatPriceLeg_flatRate :: Maybe FlatRateEnum+ -- ^ Whether the Flat Rate is the New Worldwide Tanker Nominal + -- Freight Scale for the Freight Index Route taken at the + -- Trade Date of the transaction or taken on each Pricing + -- Date.+ , floatPriceLeg_flatRateAmount :: Maybe NonNegativeMoney+ -- ^ If flatRate is set to "Fixed", the actual value of the Flat + -- Rate.+ }+ deriving (Eq,Show)+instance SchemaType FloatingPriceLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FloatingPriceLeg a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` oneOf' [ ("AdjustableDates", fmap OneOf4 (parseSchemaType "calculationDates"))+ , ("AdjustableDates", fmap TwoOf4 (parseSchemaType "calculationPeriods"))+ , ("CommodityCalculationPeriodsSchedule", fmap ThreeOf4 (parseSchemaType "calculationPeriodsSchedule"))+ , ("(Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))", fmap FourOf4 (optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))+ , ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))+ ])))+ ]+ `apply` parseSchemaType "commodity"+ `apply` oneOf' [ ("OneOf3 CommodityNotionalQuantitySchedule CommodityNotionalQuantity [CommoditySettlementPeriodsNotionalQuantity] Xsd.Decimal", fmap OneOf2 (return (,) `apply` oneOf' [ ("CommodityNotionalQuantitySchedule", fmap OneOf3 (parseSchemaType "notionalQuantitySchedule"))+ , ("CommodityNotionalQuantity", fmap TwoOf3 (parseSchemaType "notionalQuantity"))+ , ("[CommoditySettlementPeriodsNotionalQuantity]", fmap ThreeOf3 (many1 (parseSchemaType "settlementPeriodsNotionalQuantity")))+ ]+ `apply` parseSchemaType "totalNotionalQuantity"))+ , ("QuantityReference", fmap TwoOf2 (parseSchemaType "quantityReference"))+ ]+ `apply` parseSchemaType "calculation"+ `apply` oneOf' [ ("CommodityRelativePaymentDates", fmap OneOf2 (parseSchemaType "relativePaymentDates"))+ , ("(Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean))", fmap TwoOf2 (optional (oneOf' [ ("AdjustableDatesOrRelativeDateOffset", fmap OneOf2 (parseSchemaType "paymentDates"))+ , ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "masterAgreementPaymentDates"))+ ])))+ ]+ `apply` optional (parseSchemaType "flatRate")+ `apply` optional (parseSchemaType "flatRateAmount")+ schemaTypeToXML s x@FloatingPriceLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ floatPriceLeg_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ floatPriceLeg_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ floatPriceLeg_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ floatPriceLeg_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ floatPriceLeg_receiverAccountReference x+ , foldOneOf4 (schemaTypeToXML "calculationDates")+ (schemaTypeToXML "calculationPeriods")+ (schemaTypeToXML "calculationPeriodsSchedule")+ (maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")+ (schemaTypeToXML "calculationPeriodsScheduleReference")+ (schemaTypeToXML "calculationPeriodsDatesReference")+ ))+ $ floatPriceLeg_choice4 x+ , schemaTypeToXML "commodity" $ floatPriceLeg_commodity x+ , foldOneOf2 (\ (a,b) -> concat [ foldOneOf3 (schemaTypeToXML "notionalQuantitySchedule")+ (schemaTypeToXML "notionalQuantity")+ (concatMap (schemaTypeToXML "settlementPeriodsNotionalQuantity"))+ a+ , schemaTypeToXML "totalNotionalQuantity" b+ ])+ (schemaTypeToXML "quantityReference")+ $ floatPriceLeg_choice6 x+ , schemaTypeToXML "calculation" $ floatPriceLeg_calculation x+ , foldOneOf2 (schemaTypeToXML "relativePaymentDates")+ (maybe [] (foldOneOf2 (schemaTypeToXML "paymentDates")+ (schemaTypeToXML "masterAgreementPaymentDates")+ ))+ $ floatPriceLeg_choice8 x+ , maybe [] (schemaTypeToXML "flatRate") $ floatPriceLeg_flatRate x+ , maybe [] (schemaTypeToXML "flatRateAmount") $ floatPriceLeg_flatRateAmount x+ ]+instance Extension FloatingPriceLeg FinancialSwapLeg where+ supertype v = FinancialSwapLeg_FloatingPriceLeg v+instance Extension FloatingPriceLeg CommoditySwapLeg where+ supertype = (supertype :: FinancialSwapLeg -> CommoditySwapLeg)+ . (supertype :: FloatingPriceLeg -> FinancialSwapLeg)+ +instance Extension FloatingPriceLeg Leg where+ supertype = (supertype :: CommoditySwapLeg -> Leg)+ . (supertype :: FinancialSwapLeg -> CommoditySwapLeg)+ . (supertype :: FloatingPriceLeg -> FinancialSwapLeg)+ + +-- | The specification of the gas to be delivered.+data GasDelivery = GasDelivery+ { gasDelivery_choice0 :: (Maybe (OneOf2 GasDeliveryPoint ((Maybe (CommodityDeliveryPoint)),(Maybe (CommodityDeliveryPoint)))))+ -- ^ Choice between:+ -- + -- (1) The physical or virtual point at which the commodity + -- will be delivered.+ -- + -- (2) Sequence of:+ -- + -- * The physical or virtual point at which the + -- commodity enters a transportation system.+ -- + -- * The physical or virtual point at which the + -- commodity is withdrawn from a transportation + -- system.+ , gasDelivery_deliveryType :: Maybe DeliveryTypeEnum+ -- ^ Indicates whether the buyer and seller are contractually + -- obliged to consume and supply the specified quantities of + -- the commodity.+ , gasDelivery_buyerHub :: Maybe CommodityHub+ -- ^ The hub code of the gas buyer.+ , gasDelivery_sellerHub :: Maybe CommodityHub+ -- ^ The hub code of the has seller.+ }+ deriving (Eq,Show)+instance SchemaType GasDelivery where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return GasDelivery+ `apply` optional (oneOf' [ ("GasDeliveryPoint", fmap OneOf2 (parseSchemaType "deliveryPoint"))+ , ("Maybe CommodityDeliveryPoint Maybe CommodityDeliveryPoint", fmap TwoOf2 (return (,) `apply` optional (parseSchemaType "entryPoint")+ `apply` optional (parseSchemaType "withdrawalPoint")))+ ])+ `apply` optional (parseSchemaType "deliveryType")+ `apply` optional (parseSchemaType "buyerHub")+ `apply` optional (parseSchemaType "sellerHub")+ schemaTypeToXML s x@GasDelivery{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "deliveryPoint")+ (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "entryPoint") a+ , maybe [] (schemaTypeToXML "withdrawalPoint") b+ ])+ ) $ gasDelivery_choice0 x+ , maybe [] (schemaTypeToXML "deliveryType") $ gasDelivery_deliveryType x+ , maybe [] (schemaTypeToXML "buyerHub") $ gasDelivery_buyerHub x+ , maybe [] (schemaTypeToXML "sellerHub") $ gasDelivery_sellerHub x+ ]+ +-- | A scheme identifying the types of the Delivery Point for a +-- physically settled gas trade.+data GasDeliveryPoint = GasDeliveryPoint Scheme GasDeliveryPointAttributes deriving (Eq,Show)+data GasDeliveryPointAttributes = GasDeliveryPointAttributes+ { gasDelivPointAttrib_deliveryPointScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType GasDeliveryPoint where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "deliveryPointScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ GasDeliveryPoint v (GasDeliveryPointAttributes a0)+ schemaTypeToXML s (GasDeliveryPoint bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "deliveryPointScheme") $ gasDelivPointAttrib_deliveryPointScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension GasDeliveryPoint Scheme where+ supertype (GasDeliveryPoint s _) = s+ +-- | The different options for specifying the Delivery Periods +-- for a physically settled gas trade.+data GasDeliveryPeriods = GasDeliveryPeriods+ { gasDelivPeriods_ID :: Maybe Xsd.ID+ , gasDelivPeriods_choice0 :: OneOf3 AdjustableDates CommodityCalculationPeriodsSchedule ((Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference)))+ -- ^ Choice between:+ -- + -- (1) The Delivery Periods for this leg of the swap. This + -- type is only intended to be used if the Delivery + -- Periods differ from the Calculation Periods on the + -- fixed or floating leg. If DeliveryPeriods mirror + -- another leg, then the calculationPeriodsReference + -- element should be used to point to the Calculation + -- Periods on that leg - or the + -- calculationPeriodsScheduleReference can be used to + -- point to the Calculation Periods Schedule for that leg.+ -- + -- (2) The Delivery Periods for this leg of the swap. This + -- type is only intended to be used if the Delivery + -- Periods differ from the Calculation Periods on the + -- fixed or floating leg. If DeliveryPeriods mirror + -- another leg, then the calculationPeriodsReference + -- element should be used to point to the Calculation + -- Periods on that leg - or the + -- calculationPeriodsScheduleReference can be used to + -- point to the Calculation Periods Schedule for that leg.+ -- + -- (3) unknown+ , gasDelivPeriods_supplyStartTime :: PrevailingTime+ -- ^ The time at which gas delivery should start on each day of + -- the Delivery Period(s).+ , gasDelivPeriods_supplyEndTime :: PrevailingTime+ -- ^ The time at which gas delivery should end on each day of + -- the Delivery Period(s).+ }+ deriving (Eq,Show)+instance SchemaType GasDeliveryPeriods where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (GasDeliveryPeriods a0)+ `apply` oneOf' [ ("AdjustableDates", fmap OneOf3 (parseSchemaType "periods"))+ , ("CommodityCalculationPeriodsSchedule", fmap TwoOf3 (parseSchemaType "periodsSchedule"))+ , ("(Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))", fmap ThreeOf3 (optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))+ , ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))+ ])))+ ]+ `apply` parseSchemaType "supplyStartTime"+ `apply` parseSchemaType "supplyEndTime"+ schemaTypeToXML s x@GasDeliveryPeriods{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ gasDelivPeriods_ID x+ ]+ [ foldOneOf3 (schemaTypeToXML "periods")+ (schemaTypeToXML "periodsSchedule")+ (maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")+ (schemaTypeToXML "calculationPeriodsScheduleReference")+ (schemaTypeToXML "calculationPeriodsDatesReference")+ ))+ $ gasDelivPeriods_choice0 x+ , schemaTypeToXML "supplyStartTime" $ gasDelivPeriods_supplyStartTime x+ , schemaTypeToXML "supplyEndTime" $ gasDelivPeriods_supplyEndTime x+ ]+instance Extension GasDeliveryPeriods CommodityDeliveryPeriods where+ supertype (GasDeliveryPeriods a0 e0 e1 e2) =+ CommodityDeliveryPeriods a0 e0+ +-- | Physically settled leg of a physically settled gas +-- transaction.+data GasPhysicalLeg = GasPhysicalLeg+ { gasPhysicLeg_ID :: Maybe Xsd.ID+ , gasPhysicLeg_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , gasPhysicLeg_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , gasPhysicLeg_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , gasPhysicLeg_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , gasPhysicLeg_deliveryPeriods :: GasDeliveryPeriods+ -- ^ The different options for specifying the Delivery or Supply + -- Periods. Unless the quantity or price is to vary + -- periodically during the trade or physical delivery occurs + -- on a periodic basis, periodsSchedule should be used and set + -- to 1T.+ , gasPhysicLeg_gas :: GasProduct+ -- ^ The specification of the gas to be delivered.+ , gasPhysicLeg_deliveryConditions :: Maybe GasDelivery+ -- ^ The physical delivery conditions for the transaction.+ , gasPhysicLeg_deliveryQuantity :: GasPhysicalQuantity+ -- ^ The different options for specifying the quantity. For + -- Fixed trades where the quantity is known at the time of + -- confirmation, a single quantity or a quantity per Delivery + -- Period may be specified. For Variable trades minimum and + -- maximum trades may be specified.+ }+ deriving (Eq,Show)+instance SchemaType GasPhysicalLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (GasPhysicalLeg a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` parseSchemaType "deliveryPeriods"+ `apply` parseSchemaType "gas"+ `apply` optional (parseSchemaType "deliveryConditions")+ `apply` parseSchemaType "deliveryQuantity"+ schemaTypeToXML s x@GasPhysicalLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ gasPhysicLeg_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ gasPhysicLeg_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ gasPhysicLeg_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ gasPhysicLeg_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ gasPhysicLeg_receiverAccountReference x+ , schemaTypeToXML "deliveryPeriods" $ gasPhysicLeg_deliveryPeriods x+ , schemaTypeToXML "gas" $ gasPhysicLeg_gas x+ , maybe [] (schemaTypeToXML "deliveryConditions") $ gasPhysicLeg_deliveryConditions x+ , schemaTypeToXML "deliveryQuantity" $ gasPhysicLeg_deliveryQuantity x+ ]+instance Extension GasPhysicalLeg PhysicalSwapLeg where+ supertype v = PhysicalSwapLeg_GasPhysicalLeg v+instance Extension GasPhysicalLeg CommoditySwapLeg where+ supertype = (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)+ . (supertype :: GasPhysicalLeg -> PhysicalSwapLeg)+ +instance Extension GasPhysicalLeg Leg where+ supertype = (supertype :: CommoditySwapLeg -> Leg)+ . (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)+ . (supertype :: GasPhysicalLeg -> PhysicalSwapLeg)+ + +-- | The quantity of gas to be delivered.+data GasPhysicalQuantity = GasPhysicalQuantity+ { gasPhysicQuant_ID :: Maybe Xsd.ID+ , gasPhysicQuant_choice0 :: OneOf2 (((Maybe (OneOf2 CommodityNotionalQuantity CommodityPhysicalQuantitySchedule))),UnitQuantity) ([CommodityNotionalQuantity],[CommodityNotionalQuantity],(Maybe (PartyReference)))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * unknown+ -- + -- * The Total Quantity of the commodity to be + -- delivered.+ -- + -- (2) Sequence of:+ -- + -- * The minimum quantity to be delivered. If separate + -- minimums need to be specified for different periods + -- (e.g. a minimum per day and a minimum per month) + -- this element should be repeated.+ -- + -- * The maximum quantity to be delivered. If separate + -- minimums need to be specified for different periods + -- (e.g. a minimum per day and a minimum per month) + -- this element should be repeated.+ -- + -- * Indicates the party able to choose whether the gas + -- is delivered for a particular period e.g. a swing + -- or interruptible contract.+ }+ deriving (Eq,Show)+instance SchemaType GasPhysicalQuantity where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (GasPhysicalQuantity a0)+ `apply` oneOf' [ ("(Maybe (OneOf2 CommodityNotionalQuantity CommodityPhysicalQuantitySchedule)) UnitQuantity", fmap OneOf2 (return (,) `apply` optional (oneOf' [ ("CommodityNotionalQuantity", fmap OneOf2 (parseSchemaType "physicalQuantity"))+ , ("CommodityPhysicalQuantitySchedule", fmap TwoOf2 (parseSchemaType "physicalQuantitySchedule"))+ ])+ `apply` parseSchemaType "totalPhysicalQuantity"))+ , ("[CommodityNotionalQuantity] [CommodityNotionalQuantity] Maybe PartyReference", fmap TwoOf2 (return (,,) `apply` many (parseSchemaType "minPhysicalQuantity")+ `apply` many (parseSchemaType "maxPhysicalQuantity")+ `apply` optional (parseSchemaType "electingParty")))+ ]+ schemaTypeToXML s x@GasPhysicalQuantity{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ gasPhysicQuant_ID x+ ]+ [ foldOneOf2 (\ (a,b) -> concat [ maybe [] (foldOneOf2 (schemaTypeToXML "physicalQuantity")+ (schemaTypeToXML "physicalQuantitySchedule")+ ) a+ , schemaTypeToXML "totalPhysicalQuantity" b+ ])+ (\ (a,b,c) -> concat [ concatMap (schemaTypeToXML "minPhysicalQuantity") a+ , concatMap (schemaTypeToXML "maxPhysicalQuantity") b+ , maybe [] (schemaTypeToXML "electingParty") c+ ])+ $ gasPhysicQuant_choice0 x+ ]+instance Extension GasPhysicalQuantity CommodityPhysicalQuantityBase where+ supertype v = CommodityPhysicalQuantityBase_GasPhysicalQuantity v+ +-- | A type defining the characteristics of the gas being traded +-- in a physically settled gas transaction.+data GasProduct = GasProduct+ { gasProduct_type :: GasProductTypeEnum+ -- ^ The type of gas to be delivered.+ , gasProduct_choice1 :: (Maybe (OneOf2 NonNegativeDecimal GasQuality))+ -- ^ Choice between:+ -- + -- (1) The calorific value of the gas to be delivered, + -- specified in megajoules per cubic meter (MJ/m3).+ -- + -- (2) The quality of the gas to be delivered.+ }+ deriving (Eq,Show)+instance SchemaType GasProduct where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return GasProduct+ `apply` parseSchemaType "type"+ `apply` optional (oneOf' [ ("NonNegativeDecimal", fmap OneOf2 (parseSchemaType "calorificValue"))+ , ("GasQuality", fmap TwoOf2 (parseSchemaType "quality"))+ ])+ schemaTypeToXML s x@GasProduct{} =+ toXMLElement s []+ [ schemaTypeToXML "type" $ gasProduct_type x+ , maybe [] (foldOneOf2 (schemaTypeToXML "calorificValue")+ (schemaTypeToXML "quality")+ ) $ gasProduct_choice1 x+ ]+ +-- | The quantity of gas to be delivered.+data GasQuality = GasQuality Scheme GasQualityAttributes deriving (Eq,Show)+data GasQualityAttributes = GasQualityAttributes+ { gasQualityAttrib_gasQualityScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType GasQuality where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "gasQualityScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ GasQuality v (GasQualityAttributes a0)+ schemaTypeToXML s (GasQuality bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "gasQualityScheme") $ gasQualityAttrib_gasQualityScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension GasQuality Scheme where+ supertype (GasQuality s _) = s+ +-- | An observation period that is offset from a Calculation +-- Period.+data Lag = Lag+ { lag_ID :: Maybe Xsd.ID+ , lag_duration :: Maybe Period+ -- ^ The period during which observations will be made. If a + -- firstObservationDateOffset is specified, the observation + -- period will start the specified interval prior to each + -- Calculation Period - i.e. if the firstObservationDateOffset + -- is 4 months and the lagDuration is 3 months, observations + -- will be taken in months 4,3 and 2 (but not 1) prior to each + -- Calculation Period. If no firstObservationDate is + -- specified, the observation period will end immediately + -- preceding each Calculation Period.+ , lag_firstObservationDateOffset :: Maybe Period+ -- ^ The interval between the start of each lagDuration and the + -- start of each respective calculation period.+ }+ deriving (Eq,Show)+instance SchemaType Lag where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Lag a0)+ `apply` optional (parseSchemaType "lagDuration")+ `apply` optional (parseSchemaType "firstObservationDateOffset")+ schemaTypeToXML s x@Lag{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ lag_ID x+ ]+ [ maybe [] (schemaTypeToXML "lagDuration") $ lag_duration x+ , maybe [] (schemaTypeToXML "firstObservationDateOffset") $ lag_firstObservationDateOffset x+ ]+ +-- | Allows a lag to reference one already defined elsewhere in +-- the trade.+data LagReference = LagReference+ { lagReference_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType LagReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (LagReference a0)+ schemaTypeToXML s x@LagReference{} =+ toXMLElement s [ toXMLAttribute "href" $ lagReference_href x+ ]+ []+instance Extension LagReference Reference where+ supertype v = Reference_LagReference v+ +-- | A Market Disruption Event.+data MarketDisruptionEvent = MarketDisruptionEvent Scheme MarketDisruptionEventAttributes deriving (Eq,Show)+data MarketDisruptionEventAttributes = MarketDisruptionEventAttributes+ { marketDisrupEventAttrib_commodityMarketDisruptionScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MarketDisruptionEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "commodityMarketDisruptionScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MarketDisruptionEvent v (MarketDisruptionEventAttributes a0)+ schemaTypeToXML s (MarketDisruptionEvent bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "commodityMarketDisruptionScheme") $ marketDisrupEventAttrib_commodityMarketDisruptionScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MarketDisruptionEvent Scheme where+ supertype (MarketDisruptionEvent s _) = s+ +-- | The details of a fixed payment. Can be used for a forward +-- transaction or as the base for a more complex fixed leg +-- component such as the fixed leg of a swap.+data NonPeriodicFixedPriceLeg = NonPeriodicFixedPriceLeg+ { nonPeriodFixedPriceLeg_ID :: Maybe Xsd.ID+ , nonPeriodFixedPriceLeg_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , nonPeriodFixedPriceLeg_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , nonPeriodFixedPriceLeg_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , nonPeriodFixedPriceLeg_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , nonPeriodFixedPriceLeg_fixedPrice :: FixedPrice+ -- ^ Fixed price on which fixed payments are based.+ , nonPeriodFixedPriceLeg_totalPrice :: Maybe NonNegativeMoney+ -- ^ The total amount of the fixed payment for all units of the + -- underlying commodity.+ , nonPeriodFixedPriceLeg_quantityReference :: Maybe QuantityReference+ -- ^ A pointer style reference to a quantity defined on another + -- leg.+ , nonPeriodFixedPriceLeg_choice7 :: OneOf2 CommodityRelativePaymentDates ((Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean)))+ -- ^ Choice between:+ -- + -- (1) The Payment Dates of the trade relative to the + -- Calculation Periods.+ -- + -- (2) unknown+ }+ deriving (Eq,Show)+instance SchemaType NonPeriodicFixedPriceLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (NonPeriodicFixedPriceLeg a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` parseSchemaType "fixedPrice"+ `apply` optional (parseSchemaType "totalPrice")+ `apply` optional (parseSchemaType "quantityReference")+ `apply` oneOf' [ ("CommodityRelativePaymentDates", fmap OneOf2 (parseSchemaType "relativePaymentDates"))+ , ("(Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean))", fmap TwoOf2 (optional (oneOf' [ ("AdjustableDatesOrRelativeDateOffset", fmap OneOf2 (parseSchemaType "paymentDates"))+ , ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "masterAgreementPaymentDates"))+ ])))+ ]+ schemaTypeToXML s x@NonPeriodicFixedPriceLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ nonPeriodFixedPriceLeg_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ nonPeriodFixedPriceLeg_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ nonPeriodFixedPriceLeg_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ nonPeriodFixedPriceLeg_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ nonPeriodFixedPriceLeg_receiverAccountReference x+ , schemaTypeToXML "fixedPrice" $ nonPeriodFixedPriceLeg_fixedPrice x+ , maybe [] (schemaTypeToXML "totalPrice") $ nonPeriodFixedPriceLeg_totalPrice x+ , maybe [] (schemaTypeToXML "quantityReference") $ nonPeriodFixedPriceLeg_quantityReference x+ , foldOneOf2 (schemaTypeToXML "relativePaymentDates")+ (maybe [] (foldOneOf2 (schemaTypeToXML "paymentDates")+ (schemaTypeToXML "masterAgreementPaymentDates")+ ))+ $ nonPeriodFixedPriceLeg_choice7 x+ ]+instance Extension NonPeriodicFixedPriceLeg CommoditySwapLeg where+ supertype v = CommoditySwapLeg_NonPeriodicFixedPriceLeg v+instance Extension NonPeriodicFixedPriceLeg Leg where+ supertype = (supertype :: CommoditySwapLeg -> Leg)+ . (supertype :: NonPeriodicFixedPriceLeg -> CommoditySwapLeg)+ + +-- | The physical delivery conditions for an oil product.+data OilDelivery = OilDelivery+ { oilDelivery_choice0 :: (Maybe (OneOf2 OilPipelineDelivery OilTransferDelivery))+ -- ^ Choice between:+ -- + -- (1) Specified the delivery conditions where the oil product + -- is to be delivered by pipeline.+ -- + -- (2) Specified the delivery conditions where the oil product + -- is to be delivered by title transfer.+ , oilDelivery_importerOfRecord :: Maybe PartyReference+ -- ^ Specifies which party is the Importer of Record for the + -- purposes of paying customs duties and applicable taxes or + -- costs related to the import of the oil product.+ , oilDelivery_choice2 :: (Maybe (OneOf2 AbsoluteTolerance PercentageTolerance))+ -- ^ Choice between:+ -- + -- (1) Specifies the allowable quantity tolerance as an + -- absolute quantity.+ -- + -- (2) Specifies the allowable quantity tolerance as a + -- percentage of the quantity.+ }+ deriving (Eq,Show)+instance SchemaType OilDelivery where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OilDelivery+ `apply` optional (oneOf' [ ("OilPipelineDelivery", fmap OneOf2 (parseSchemaType "pipeline"))+ , ("OilTransferDelivery", fmap TwoOf2 (parseSchemaType "transfer"))+ ])+ `apply` optional (parseSchemaType "importerOfRecord")+ `apply` optional (oneOf' [ ("AbsoluteTolerance", fmap OneOf2 (parseSchemaType "absoluteTolerance"))+ , ("PercentageTolerance", fmap TwoOf2 (parseSchemaType "percentageTolerance"))+ ])+ schemaTypeToXML s x@OilDelivery{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "pipeline")+ (schemaTypeToXML "transfer")+ ) $ oilDelivery_choice0 x+ , maybe [] (schemaTypeToXML "importerOfRecord") $ oilDelivery_importerOfRecord x+ , maybe [] (foldOneOf2 (schemaTypeToXML "absoluteTolerance")+ (schemaTypeToXML "percentageTolerance")+ ) $ oilDelivery_choice2 x+ ]+ +-- | Physically settled leg of a physically settled oil product +-- transaction.+data OilPhysicalLeg = OilPhysicalLeg+ { oilPhysicLeg_ID :: Maybe Xsd.ID+ , oilPhysicLeg_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , oilPhysicLeg_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , oilPhysicLeg_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , oilPhysicLeg_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , oilPhysicLeg_deliveryPeriods :: Maybe CommodityDeliveryPeriods+ -- ^ The different options for specifying the Delivery or Supply + -- Periods. Unless the quantity or price is to vary + -- periodically during the trade or physical delivery occurs + -- on a periodic basis, periodsSchedule should be used and set + -- to 1T.+ , oilPhysicLeg_oil :: OilProduct+ -- ^ The specification of the oil product to be delivered.+ , oilPhysicLeg_deliveryConditions :: Maybe OilDelivery+ -- ^ The physical delivery conditions for the transaction.+ , oilPhysicLeg_deliveryQuantity :: CommodityPhysicalQuantity+ -- ^ The different options for specifying the quantity.+ }+ deriving (Eq,Show)+instance SchemaType OilPhysicalLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (OilPhysicalLeg a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "deliveryPeriods")+ `apply` parseSchemaType "oil"+ `apply` optional (parseSchemaType "deliveryConditions")+ `apply` parseSchemaType "deliveryQuantity"+ schemaTypeToXML s x@OilPhysicalLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ oilPhysicLeg_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ oilPhysicLeg_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ oilPhysicLeg_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ oilPhysicLeg_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ oilPhysicLeg_receiverAccountReference x+ , maybe [] (schemaTypeToXML "deliveryPeriods") $ oilPhysicLeg_deliveryPeriods x+ , schemaTypeToXML "oil" $ oilPhysicLeg_oil x+ , maybe [] (schemaTypeToXML "deliveryConditions") $ oilPhysicLeg_deliveryConditions x+ , schemaTypeToXML "deliveryQuantity" $ oilPhysicLeg_deliveryQuantity x+ ]+instance Extension OilPhysicalLeg PhysicalSwapLeg where+ supertype v = PhysicalSwapLeg_OilPhysicalLeg v+instance Extension OilPhysicalLeg CommoditySwapLeg where+ supertype = (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)+ . (supertype :: OilPhysicalLeg -> PhysicalSwapLeg)+ +instance Extension OilPhysicalLeg Leg where+ supertype = (supertype :: CommoditySwapLeg -> Leg)+ . (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)+ . (supertype :: OilPhysicalLeg -> PhysicalSwapLeg)+ + +-- | The physical delivery conditions specific to an oil product +-- delivered by pipeline.+data OilPipelineDelivery = OilPipelineDelivery+ { oilPipelDeliv_pipelineName :: Maybe CommodityPipeline+ -- ^ The name of pipeline by which the oil product will be + -- delivered.+ , oilPipelDeliv_withdrawalPoint :: Maybe CommodityDeliveryPoint+ -- ^ The location at which the transfer of the title to the + -- commodity takes place.+ , oilPipelDeliv_entryPoint :: Maybe CommodityDeliveryPoint+ -- ^ The point at which the oil product will enter the pipeline.+ , oilPipelDeliv_deliverableByBarge :: Maybe Xsd.Boolean+ -- ^ Whether or not the delivery can go to barge. For trades + -- documented under the ISDA Master Agreement and Oil Annex, + -- this should always be set to 'false'.+ , oilPipelDeliv_risk :: Maybe CommodityDeliveryRisk+ -- ^ Specifies how the risk associated with the delivery is + -- assigned. For trades documented under the ISDA Master + -- Agreement and Oil Annex, this presence of this element + -- indicates that the provisions of clause (b)(i) of the ISDA + -- Oil Annex are being varied.+ , oilPipelDeliv_cycle :: [CommodityPipelineCycle]+ -- ^ The cycle(s) during which the oil product will be + -- transported in the pipeline.+ }+ deriving (Eq,Show)+instance SchemaType OilPipelineDelivery where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OilPipelineDelivery+ `apply` optional (parseSchemaType "pipelineName")+ `apply` optional (parseSchemaType "withdrawalPoint")+ `apply` optional (parseSchemaType "entryPoint")+ `apply` optional (parseSchemaType "deliverableByBarge")+ `apply` optional (parseSchemaType "risk")+ `apply` many (parseSchemaType "cycle")+ schemaTypeToXML s x@OilPipelineDelivery{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "pipelineName") $ oilPipelDeliv_pipelineName x+ , maybe [] (schemaTypeToXML "withdrawalPoint") $ oilPipelDeliv_withdrawalPoint x+ , maybe [] (schemaTypeToXML "entryPoint") $ oilPipelDeliv_entryPoint x+ , maybe [] (schemaTypeToXML "deliverableByBarge") $ oilPipelDeliv_deliverableByBarge x+ , maybe [] (schemaTypeToXML "risk") $ oilPipelDeliv_risk x+ , concatMap (schemaTypeToXML "cycle") $ oilPipelDeliv_cycle x+ ]+ +-- | The specification of the oil product to be delivered.+data OilProduct = OilProduct+ { oilProduct_type :: OilProductType+ -- ^ The type of oil product to be delivered.+ , oilProduct_grade :: CommodityProductGrade+ -- ^ The grade of oil product to be delivered.+ }+ deriving (Eq,Show)+instance SchemaType OilProduct where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OilProduct+ `apply` parseSchemaType "type"+ `apply` parseSchemaType "grade"+ schemaTypeToXML s x@OilProduct{} =+ toXMLElement s []+ [ schemaTypeToXML "type" $ oilProduct_type x+ , schemaTypeToXML "grade" $ oilProduct_grade x+ ]+ +-- | The type of physical commodity product to be delivered.+data OilProductType = OilProductType Scheme OilProductTypeAttributes deriving (Eq,Show)+data OilProductTypeAttributes = OilProductTypeAttributes+ { oilProductTypeAttrib_commodityOilProductTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType OilProductType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "commodityOilProductTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ OilProductType v (OilProductTypeAttributes a0)+ schemaTypeToXML s (OilProductType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "commodityOilProductTypeScheme") $ oilProductTypeAttrib_commodityOilProductTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension OilProductType Scheme where+ supertype (OilProductType s _) = s+ +-- | The physical delivery conditions specific to an oil product +-- delivered by title transfer.+data OilTransferDelivery = OilTransferDelivery+ { oilTransfDeliv_applicable :: Maybe Xsd.Boolean+ -- ^ Indicates that the oil product will be delivered by title + -- transfer. Should always be set to "true".+ , oilTransfDeliv_deliveryLocation :: Maybe CommodityDeliveryPoint+ -- ^ The location at which the transfer of the title to the + -- commodity takes place.+ }+ deriving (Eq,Show)+instance SchemaType OilTransferDelivery where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OilTransferDelivery+ `apply` optional (parseSchemaType "applicable")+ `apply` optional (parseSchemaType "deliveryLocation")+ schemaTypeToXML s x@OilTransferDelivery{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "applicable") $ oilTransfDeliv_applicable x+ , maybe [] (schemaTypeToXML "deliveryLocation") $ oilTransfDeliv_deliveryLocation x+ ]+ +-- | The acceptable tolerance in the delivered quantity of a +-- physical commodity product in terms of a percentage of the +-- agreed delivery quantity.+data PercentageTolerance = PercentageTolerance+ { percenToler_postitive :: Maybe RestrictedPercentage+ -- ^ The maximum percentage amount by which the quantity + -- delivered can exceed the agreed quantity.+ , percenToler_negative :: Maybe RestrictedPercentage+ -- ^ The maximum percentage amount by which the quantity + -- delivered can be less than the agreed quantity.+ , percenToler_option :: Maybe PartyReference+ -- ^ Indicates whether the tolerance it at the seller's or + -- buyer's option.+ }+ deriving (Eq,Show)+instance SchemaType PercentageTolerance where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PercentageTolerance+ `apply` optional (parseSchemaType "postitive")+ `apply` optional (parseSchemaType "negative")+ `apply` optional (parseSchemaType "option")+ schemaTypeToXML s x@PercentageTolerance{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "postitive") $ percenToler_postitive x+ , maybe [] (schemaTypeToXML "negative") $ percenToler_negative x+ , maybe [] (schemaTypeToXML "option") $ percenToler_option x+ ]+ +-- | The common components of a physically settled leg of a +-- Commodity Forward. This is an abstract type and should be +-- extended by commodity-specific types.+data PhysicalForwardLeg+ = PhysicalForwardLeg_BullionPhysicalLeg BullionPhysicalLeg+ + deriving (Eq,Show)+instance SchemaType PhysicalForwardLeg where+ parseSchemaType s = do+ (fmap PhysicalForwardLeg_BullionPhysicalLeg $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of PhysicalForwardLeg,\n\+\ namely one of:\n\+\BullionPhysicalLeg"+ schemaTypeToXML _s (PhysicalForwardLeg_BullionPhysicalLeg x) = schemaTypeToXML "bullionPhysicalLeg" x+instance Extension PhysicalForwardLeg CommodityForwardLeg where+ supertype v = CommodityForwardLeg_PhysicalForwardLeg v+ +-- | The common components of a physically settled leg of a +-- Commodity Swap. This is an abstract type and should be +-- extended by commodity-specific types.+data PhysicalSwapLeg+ = PhysicalSwapLeg_OilPhysicalLeg OilPhysicalLeg+ | PhysicalSwapLeg_GasPhysicalLeg GasPhysicalLeg+ | PhysicalSwapLeg_ElectricityPhysicalLeg ElectricityPhysicalLeg+ | PhysicalSwapLeg_CoalPhysicalLeg CoalPhysicalLeg+ + deriving (Eq,Show)+instance SchemaType PhysicalSwapLeg where+ parseSchemaType s = do+ (fmap PhysicalSwapLeg_OilPhysicalLeg $ parseSchemaType s)+ `onFail`+ (fmap PhysicalSwapLeg_GasPhysicalLeg $ parseSchemaType s)+ `onFail`+ (fmap PhysicalSwapLeg_ElectricityPhysicalLeg $ parseSchemaType s)+ `onFail`+ (fmap PhysicalSwapLeg_CoalPhysicalLeg $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of PhysicalSwapLeg,\n\+\ namely one of:\n\+\OilPhysicalLeg,GasPhysicalLeg,ElectricityPhysicalLeg,CoalPhysicalLeg"+ schemaTypeToXML _s (PhysicalSwapLeg_OilPhysicalLeg x) = schemaTypeToXML "oilPhysicalLeg" x+ schemaTypeToXML _s (PhysicalSwapLeg_GasPhysicalLeg x) = schemaTypeToXML "gasPhysicalLeg" x+ schemaTypeToXML _s (PhysicalSwapLeg_ElectricityPhysicalLeg x) = schemaTypeToXML "electricityPhysicalLeg" x+ schemaTypeToXML _s (PhysicalSwapLeg_CoalPhysicalLeg x) = schemaTypeToXML "coalPhysicalLeg" x+instance Extension PhysicalSwapLeg CommoditySwapLeg where+ supertype v = CommoditySwapLeg_PhysicalSwapLeg v+ +-- | A pointer tyle reference to a Quantity schedule defined +-- elsewhere.+data QuantityScheduleReference = QuantityScheduleReference+ { quantSchedRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType QuantityScheduleReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (QuantityScheduleReference a0)+ schemaTypeToXML s x@QuantityScheduleReference{} =+ toXMLElement s [ toXMLAttribute "href" $ quantSchedRef_href x+ ]+ []+instance Extension QuantityScheduleReference Reference where+ supertype v = Reference_QuantityScheduleReference v+ +-- | A pointer tyle reference to a Quantity defined elsewhere.+data QuantityReference = QuantityReference+ { quantRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType QuantityReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (QuantityReference a0)+ schemaTypeToXML s x@QuantityReference{} =+ toXMLElement s [ toXMLAttribute "href" $ quantRef_href x+ ]+ []+instance Extension QuantityReference Reference where+ supertype v = Reference_QuantityReference v+ +-- | A Disruption Fallback with the sequence in which it should +-- be applied relative to other Disruption Fallbacks.+data SequencedDisruptionFallback = SequencedDisruptionFallback+ { sequenDisrupFallb_fallback :: Maybe DisruptionFallback+ -- ^ Disruption fallback that applies to the trade.+ , sequenDisrupFallb_sequence :: Maybe Xsd.PositiveInteger+ -- ^ Sequence in which the reference to the disruption fallback + -- should be applied.+ }+ deriving (Eq,Show)+instance SchemaType SequencedDisruptionFallback where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SequencedDisruptionFallback+ `apply` optional (parseSchemaType "fallback")+ `apply` optional (parseSchemaType "sequence")+ schemaTypeToXML s x@SequencedDisruptionFallback{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "fallback") $ sequenDisrupFallb_fallback x+ , maybe [] (schemaTypeToXML "sequence") $ sequenDisrupFallb_sequence x+ ]+ +-- | Specifies a set of Settlement Periods associated with an +-- Electricity Transaction for delivery on an Applicable Day +-- or for a series of Applicable Days.+data SettlementPeriods = SettlementPeriods+ { settlPeriods_ID :: Maybe Xsd.ID+ , settlPeriods_duration :: Maybe SettlementPeriodDurationEnum+ -- ^ The length of each Settlement Period.+ , settlPeriods_applicableDay :: [DayOfWeekEnum]+ -- ^ Specifies the Applicable Day with respect to a range of + -- Settlement Periods. This element can only be omitted if + -- includesHolidays is present, in which case this range of + -- Settlement Periods will apply to days that are holidays + -- only.+ , settlPeriods_startTime :: Maybe OffsetPrevailingTime+ -- ^ Specifies the hour-ending Start Time with respect to a + -- range of Settlement Periods.+ , settlPeriods_endTime :: Maybe OffsetPrevailingTime+ -- ^ Specifies the hour-ending End Time with respect to a range + -- of Settlement Periods. If neither startTime nor endTime + -- contain an offset element and endTime is earlier than + -- startTime, this indicates that the time period "wraps + -- around" midnight. For example, if startTime is 23:00 and + -- endTime is 01:00 then Settlement Periods apply from 00:00 + -- to 01:00 and 23:00 to 00:00 on each included day.+ , settlPeriods_choice4 :: (Maybe (OneOf2 CommodityBusinessCalendar CommodityBusinessCalendar))+ -- ^ Choice between:+ -- + -- (1) Indicates that days that are holidays according to the + -- referenced commodity business calendar should be + -- excluded from this range of Settlement Periods, even if + -- such day is an applicable day.+ -- + -- (2) Indicates that days that are holidays according to the + -- referenced commodity business calendar should be + -- included in this range of Settlement Periods, even if + -- such day is not an applicable day.+ }+ deriving (Eq,Show)+instance SchemaType SettlementPeriods where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (SettlementPeriods a0)+ `apply` optional (parseSchemaType "duration")+ `apply` between (Occurs (Just 0) (Just 7))+ (parseSchemaType "applicableDay")+ `apply` optional (parseSchemaType "startTime")+ `apply` optional (parseSchemaType "endTime")+ `apply` optional (oneOf' [ ("CommodityBusinessCalendar", fmap OneOf2 (parseSchemaType "excludeHolidays"))+ , ("CommodityBusinessCalendar", fmap TwoOf2 (parseSchemaType "includeHolidays"))+ ])+ schemaTypeToXML s x@SettlementPeriods{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ settlPeriods_ID x+ ]+ [ maybe [] (schemaTypeToXML "duration") $ settlPeriods_duration x+ , concatMap (schemaTypeToXML "applicableDay") $ settlPeriods_applicableDay x+ , maybe [] (schemaTypeToXML "startTime") $ settlPeriods_startTime x+ , maybe [] (schemaTypeToXML "endTime") $ settlPeriods_endTime x+ , maybe [] (foldOneOf2 (schemaTypeToXML "excludeHolidays")+ (schemaTypeToXML "includeHolidays")+ ) $ settlPeriods_choice4 x+ ]+ +-- | A type defining the Fixed Price applicable to a range or +-- ranges of Settlement Periods.+data SettlementPeriodsFixedPrice = SettlementPeriodsFixedPrice+ { settlPeriodsFixedPrice_ID :: Maybe Xsd.ID+ , settlPeriodsFixedPrice_price :: Xsd.Decimal+ -- ^ The Fixed Price.+ , settlPeriodsFixedPrice_priceCurrency :: Currency+ -- ^ Currency of the fixed price.+ , settlPeriodsFixedPrice_priceUnit :: QuantityUnit+ -- ^ The unit of measure used to calculate the Fixed Price.+ , settlPeriodsFixedPrice_settlementPeriodsReference :: [SettlementPeriodsReference]+ }+ deriving (Eq,Show)+instance SchemaType SettlementPeriodsFixedPrice where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (SettlementPeriodsFixedPrice a0)+ `apply` parseSchemaType "price"+ `apply` parseSchemaType "priceCurrency"+ `apply` parseSchemaType "priceUnit"+ `apply` many (parseSchemaType "settlementPeriodsReference")+ schemaTypeToXML s x@SettlementPeriodsFixedPrice{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ settlPeriodsFixedPrice_ID x+ ]+ [ schemaTypeToXML "price" $ settlPeriodsFixedPrice_price x+ , schemaTypeToXML "priceCurrency" $ settlPeriodsFixedPrice_priceCurrency x+ , schemaTypeToXML "priceUnit" $ settlPeriodsFixedPrice_priceUnit x+ , concatMap (schemaTypeToXML "settlementPeriodsReference") $ settlPeriodsFixedPrice_settlementPeriodsReference x+ ]+instance Extension SettlementPeriodsFixedPrice FixedPrice where+ supertype (SettlementPeriodsFixedPrice a0 e0 e1 e2 e3) =+ FixedPrice a0 e0 e1 e2+ +-- | Allows a set of Settlement Periods to reference one already +-- defined elsewhere in the trade.+data SettlementPeriodsReference = SettlementPeriodsReference+ { settlPeriodsRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType SettlementPeriodsReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (SettlementPeriodsReference a0)+ schemaTypeToXML s x@SettlementPeriodsReference{} =+ toXMLElement s [ toXMLAttribute "href" $ settlPeriodsRef_href x+ ]+ []+instance Extension SettlementPeriodsReference Reference where+ supertype v = Reference_SettlementPeriodsReference v+ +-- | The specification of the Settlement Periods in which the +-- electricity will be delivered for a "shaped" trade i.e. +-- where different Settlement Period ranges will apply to +-- different periods of the trade.+data SettlementPeriodsSchedule = SettlementPeriodsSchedule+ { settlPeriodsSched_settlementPeriodsStep :: [SettlementPeriodsStep]+ -- ^ The range of Settlement Periods per Calculation Period. + -- There must be a range of Settlement Periods specified for + -- each Calculation Period, regardless of whether the range of + -- Settlement Periods changes or stays the same between + -- periods.+ , settlPeriodsSched_choice1 :: (Maybe (OneOf2 CalculationPeriodsReference CalculationPeriodsScheduleReference))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to the Delivery Periods + -- defined elsewhere.+ -- + -- (2) A pointer style reference to the Calculation Periods + -- Schedule defined elsewhere.+ }+ deriving (Eq,Show)+instance SchemaType SettlementPeriodsSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SettlementPeriodsSchedule+ `apply` many (parseSchemaType "settlementPeriodsStep")+ `apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf2 (parseSchemaType "deliveryPeriodsReference"))+ , ("CalculationPeriodsScheduleReference", fmap TwoOf2 (parseSchemaType "deliveryPeriodsScheduleReference"))+ ])+ schemaTypeToXML s x@SettlementPeriodsSchedule{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "settlementPeriodsStep") $ settlPeriodsSched_settlementPeriodsStep x+ , maybe [] (foldOneOf2 (schemaTypeToXML "deliveryPeriodsReference")+ (schemaTypeToXML "deliveryPeriodsScheduleReference")+ ) $ settlPeriodsSched_choice1 x+ ]+ +-- | A reference to the range of Settlement Periods that applies +-- to a given period of a transaction.+data SettlementPeriodsStep = SettlementPeriodsStep+ { settlPeriodsStep_settlementPeriodsReference :: [SettlementPeriodsReference]+ -- ^ The specification of the Settlement Periods in which the + -- electricity will be delivered. The Settlement Periods will + -- apply for the duration of the appliable period. If more + -- than one settlementPeriods element is present this + -- indicates multiple ranges of Settlement Periods apply for + -- the duration of the applicable period.+ }+ deriving (Eq,Show)+instance SchemaType SettlementPeriodsStep where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SettlementPeriodsStep+ `apply` many (parseSchemaType "settlementPeriodsReference")+ schemaTypeToXML s x@SettlementPeriodsStep{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "settlementPeriodsReference") $ settlPeriodsStep_settlementPeriodsReference x+ ]+ +-- | A quantity and associated unit.+data UnitQuantity = UnitQuantity+ { unitQuantity_ID :: Maybe Xsd.ID+ , unitQuantity_quantityUnit :: QuantityUnit+ -- ^ Quantity Unit is the unit of measure applicable for the + -- quantity on the Transaction.+ , unitQuantity_quantity :: NonNegativeDecimal+ -- ^ Amount of commodity per quantity frequency.+ }+ deriving (Eq,Show)+instance SchemaType UnitQuantity where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (UnitQuantity a0)+ `apply` parseSchemaType "quantityUnit"+ `apply` parseSchemaType "quantity"+ schemaTypeToXML s x@UnitQuantity{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ unitQuantity_ID x+ ]+ [ schemaTypeToXML "quantityUnit" $ unitQuantity_quantityUnit x+ , schemaTypeToXML "quantity" $ unitQuantity_quantity x+ ]+ +-- | The physical leg of a Commodity Forward Transaction for +-- which the underlyer is Bullion.+elementBullionPhysicalLeg :: XMLParser BullionPhysicalLeg+elementBullionPhysicalLeg = parseSchemaType "bullionPhysicalLeg"+elementToXMLBullionPhysicalLeg :: BullionPhysicalLeg -> [Content ()]+elementToXMLBullionPhysicalLeg = schemaTypeToXML "bullionPhysicalLeg"+ +-- | Physically settled coal leg.+elementCoalPhysicalLeg :: XMLParser CoalPhysicalLeg+elementCoalPhysicalLeg = parseSchemaType "coalPhysicalLeg"+elementToXMLCoalPhysicalLeg :: CoalPhysicalLeg -> [Content ()]+elementToXMLCoalPhysicalLeg = schemaTypeToXML "coalPhysicalLeg"+ +-- | Defines a commodity forward product.+elementCommodityForward :: XMLParser CommodityForward+elementCommodityForward = parseSchemaType "commodityForward"+elementToXMLCommodityForward :: CommodityForward -> [Content ()]+elementToXMLCommodityForward = schemaTypeToXML "commodityForward"+ +-- | Defines the substitutable commodity forward leg+elementCommodityForwardLeg :: XMLParser CommodityForwardLeg+elementCommodityForwardLeg = fmap supertype elementBullionPhysicalLeg+ `onFail` fail "Parse failed when expecting an element in the substitution group for\n\+\ <commodityForwardLeg>,\n\+\ namely one of:\n\+\<bullionPhysicalLeg>"+elementToXMLCommodityForwardLeg :: CommodityForwardLeg -> [Content ()]+elementToXMLCommodityForwardLeg = schemaTypeToXML "commodityForwardLeg"+ +-- | Defines a commodity option product.+elementCommodityOption :: XMLParser CommodityOption+elementCommodityOption = parseSchemaType "commodityOption"+elementToXMLCommodityOption :: CommodityOption -> [Content ()]+elementToXMLCommodityOption = schemaTypeToXML "commodityOption"+ +-- | Defines a commodity swap product.+elementCommoditySwap :: XMLParser CommoditySwap+elementCommoditySwap = parseSchemaType "commoditySwap"+elementToXMLCommoditySwap :: CommoditySwap -> [Content ()]+elementToXMLCommoditySwap = schemaTypeToXML "commoditySwap"+ +-- | Defines a commodity swaption product+elementCommoditySwaption :: XMLParser CommoditySwaption+elementCommoditySwaption = parseSchemaType "commoditySwaption"+elementToXMLCommoditySwaption :: CommoditySwaption -> [Content ()]+elementToXMLCommoditySwaption = schemaTypeToXML "commoditySwaption"+ +-- | Defines the substitutable commodity swap leg+elementCommoditySwapLeg :: XMLParser CommoditySwapLeg+elementCommoditySwapLeg = fmap supertype elementOilPhysicalLeg+ `onFail`+ fmap supertype elementGasPhysicalLeg+ `onFail`+ fmap supertype elementFloatingLeg+ `onFail`+ fmap supertype elementFixedLeg+ `onFail`+ fmap supertype elementElectricityPhysicalLeg+ `onFail`+ fmap supertype elementCoalPhysicalLeg+ `onFail` fail "Parse failed when expecting an element in the substitution group for\n\+\ <commoditySwapLeg>,\n\+\ namely one of:\n\+\<oilPhysicalLeg>, <gasPhysicalLeg>, <floatingLeg>, <fixedLeg>, <electricityPhysicalLeg>, <coalPhysicalLeg>"+elementToXMLCommoditySwapLeg :: CommoditySwapLeg -> [Content ()]+elementToXMLCommoditySwapLeg = schemaTypeToXML "commoditySwapLeg"+ +-- | Physically settled electricity leg.+elementElectricityPhysicalLeg :: XMLParser ElectricityPhysicalLeg+elementElectricityPhysicalLeg = parseSchemaType "electricityPhysicalLeg"+elementToXMLElectricityPhysicalLeg :: ElectricityPhysicalLeg -> [Content ()]+elementToXMLElectricityPhysicalLeg = schemaTypeToXML "electricityPhysicalLeg"+ +-- | Fixed Price Leg.+elementFixedLeg :: XMLParser FixedPriceLeg+elementFixedLeg = parseSchemaType "fixedLeg"+elementToXMLFixedLeg :: FixedPriceLeg -> [Content ()]+elementToXMLFixedLeg = schemaTypeToXML "fixedLeg"+ +-- | Floating Price leg.+elementFloatingLeg :: XMLParser FloatingPriceLeg+elementFloatingLeg = parseSchemaType "floatingLeg"+elementToXMLFloatingLeg :: FloatingPriceLeg -> [Content ()]+elementToXMLFloatingLeg = schemaTypeToXML "floatingLeg"+ +-- | Physically settled natural gas leg.+elementGasPhysicalLeg :: XMLParser GasPhysicalLeg+elementGasPhysicalLeg = parseSchemaType "gasPhysicalLeg"+elementToXMLGasPhysicalLeg :: GasPhysicalLeg -> [Content ()]+elementToXMLGasPhysicalLeg = schemaTypeToXML "gasPhysicalLeg"+ +-- | Physically settled oil or refined products leg.+elementOilPhysicalLeg :: XMLParser OilPhysicalLeg+elementOilPhysicalLeg = parseSchemaType "oilPhysicalLeg"+elementToXMLOilPhysicalLeg :: OilPhysicalLeg -> [Content ()]+elementToXMLOilPhysicalLeg = schemaTypeToXML "oilPhysicalLeg"+ + + + + + + + + + + + + + + + + + + + + + + +
+ Data/FpML/V53/Com.hs-boot view
@@ -0,0 +1,1045 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Com+ ( module Data.FpML.V53.Com+ , module Data.FpML.V53.Shared.Option+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Shared.Option+ +-- | The acceptable tolerance in the delivered quantity of a +-- physical commodity product in terms of a number of units of +-- that product. +data AbsoluteTolerance+instance Eq AbsoluteTolerance+instance Show AbsoluteTolerance+instance SchemaType AbsoluteTolerance+ +-- | A scheme defining where bullion is to be delivered for a +-- Bullion Transaction. +data BullionDeliveryLocation+data BullionDeliveryLocationAttributes+instance Eq BullionDeliveryLocation+instance Eq BullionDeliveryLocationAttributes+instance Show BullionDeliveryLocation+instance Show BullionDeliveryLocationAttributes+instance SchemaType BullionDeliveryLocation+instance Extension BullionDeliveryLocation Scheme+ +-- | Physically settled leg of a physically settled Bullion +-- Transaction. +data BullionPhysicalLeg+instance Eq BullionPhysicalLeg+instance Show BullionPhysicalLeg+instance SchemaType BullionPhysicalLeg+instance Extension BullionPhysicalLeg PhysicalForwardLeg+instance Extension BullionPhysicalLeg CommodityForwardLeg+instance Extension BullionPhysicalLeg Leg+ +-- | A pointer style reference to single-day-duration +-- calculation periods defined elsewhere - note that this +-- schedule consists of a parameterised schedule in a +-- calculationPeriodsSchedule container. +data CalculationPeriodsDatesReference+instance Eq CalculationPeriodsDatesReference+instance Show CalculationPeriodsDatesReference+instance SchemaType CalculationPeriodsDatesReference+instance Extension CalculationPeriodsDatesReference Reference+ +-- | A pointer style reference to a calculation periods schedule +-- defined elsewhere - note that this schedule consists of a +-- series of actual dates in a calculationPeriods container. +data CalculationPeriodsReference+instance Eq CalculationPeriodsReference+instance Show CalculationPeriodsReference+instance SchemaType CalculationPeriodsReference+instance Extension CalculationPeriodsReference Reference+ +-- | A pointer style reference to a calculation periods schedule +-- defined elsewhere - note that this schedule consists of a +-- parameterised schedule in a calculationPeriodsSchedule +-- container. +data CalculationPeriodsScheduleReference+instance Eq CalculationPeriodsScheduleReference+instance Show CalculationPeriodsScheduleReference+instance SchemaType CalculationPeriodsScheduleReference+instance Extension CalculationPeriodsScheduleReference Reference+ +-- | The different options for specifying the attributes of a +-- coal quality measure as a decimal value. +data CoalAttributeDecimal+instance Eq CoalAttributeDecimal+instance Show CoalAttributeDecimal+instance SchemaType CoalAttributeDecimal+ +-- | The different options for specifying the attributes of a +-- coal quality measure as a percentage of the measured value. +data CoalAttributePercentage+instance Eq CoalAttributePercentage+instance Show CoalAttributePercentage+instance SchemaType CoalAttributePercentage+ +-- | The physical delivery conditions for coal. +data CoalDelivery+instance Eq CoalDelivery+instance Show CoalDelivery+instance SchemaType CoalDelivery+ +-- | A scheme identifying the types of the Delivery Point for a +-- physically settled coal trade. +data CoalDeliveryPoint+data CoalDeliveryPointAttributes+instance Eq CoalDeliveryPoint+instance Eq CoalDeliveryPointAttributes+instance Show CoalDeliveryPoint+instance Show CoalDeliveryPointAttributes+instance SchemaType CoalDeliveryPoint+instance Extension CoalDeliveryPoint Scheme+ +-- | Physically settled leg of a physically settled coal +-- transaction. +data CoalPhysicalLeg+instance Eq CoalPhysicalLeg+instance Show CoalPhysicalLeg+instance SchemaType CoalPhysicalLeg+instance Extension CoalPhysicalLeg PhysicalSwapLeg+instance Extension CoalPhysicalLeg CommoditySwapLeg+instance Extension CoalPhysicalLeg Leg+ +-- | A type defining the characteristics of the coal being +-- traded in a physically settled gas transaction. +data CoalProduct+instance Eq CoalProduct+instance Show CoalProduct+instance SchemaType CoalProduct+ +-- | A scheme identifying the sources of coal for a physically +-- settled coal trade. +data CoalProductSource+data CoalProductSourceAttributes+instance Eq CoalProductSource+instance Eq CoalProductSourceAttributes+instance Show CoalProductSource+instance Show CoalProductSourceAttributes+instance SchemaType CoalProductSource+instance Extension CoalProductSource Scheme+ +-- | The different options for specifying the quality attributes +-- of the coal to be delivered. +data CoalProductSpecifications+instance Eq CoalProductSpecifications+instance Show CoalProductSpecifications+instance SchemaType CoalProductSpecifications+ +-- | A scheme identifying the types of coal for a physically +-- settled coal trade. +data CoalProductType+data CoalProductTypeAttributes+instance Eq CoalProductType+instance Eq CoalProductTypeAttributes+instance Show CoalProductType+instance Show CoalProductTypeAttributes+instance SchemaType CoalProductType+instance Extension CoalProductType Scheme+ +-- | A scheme identifying the quality adjustment formulae for a +-- physically settled coal trade. +data CoalQualityAdjustments+data CoalQualityAdjustmentsAttributes+instance Eq CoalQualityAdjustments+instance Eq CoalQualityAdjustmentsAttributes+instance Show CoalQualityAdjustments+instance Show CoalQualityAdjustmentsAttributes+instance SchemaType CoalQualityAdjustments+instance Extension CoalQualityAdjustments Scheme+ +-- | The quality attributes of the coal to be delivered. +data CoalStandardQuality+instance Eq CoalStandardQuality+instance Show CoalStandardQuality+instance SchemaType CoalStandardQuality+ +-- | The quality attributes of the coal to be delivered, +-- specified on a periodic basis. +data CoalStandardQualitySchedule+instance Eq CoalStandardQualitySchedule+instance Show CoalStandardQualitySchedule+instance SchemaType CoalStandardQualitySchedule+ +-- | A scheme identifying the methods by which coal may be +-- transported. +data CoalTransportationEquipment+data CoalTransportationEquipmentAttributes+instance Eq CoalTransportationEquipment+instance Eq CoalTransportationEquipmentAttributes+instance Show CoalTransportationEquipment+instance Show CoalTransportationEquipmentAttributes+instance SchemaType CoalTransportationEquipment+instance Extension CoalTransportationEquipment Scheme+ +-- | A type for defining exercise procedures associated with an +-- American style exercise of a commodity option. +data CommodityAmericanExercise+instance Eq CommodityAmericanExercise+instance Show CommodityAmericanExercise+instance SchemaType CommodityAmericanExercise+instance Extension CommodityAmericanExercise Exercise+ +-- | A parametric representation of the Calculation Periods for +-- on Asian option or a leg of a swap. In case the calculation +-- frequency is of value T (term), the period is defined by +-- the commoditySwap\effectiveDate and the +-- commoditySwap\terminationDate. +data CommodityCalculationPeriodsSchedule+instance Eq CommodityCalculationPeriodsSchedule+instance Show CommodityCalculationPeriodsSchedule+instance SchemaType CommodityCalculationPeriodsSchedule+instance Extension CommodityCalculationPeriodsSchedule Frequency+ +-- | The different options for specifying the Delivery Periods +-- of a physical leg. +data CommodityDeliveryPeriods+instance Eq CommodityDeliveryPeriods+instance Show CommodityDeliveryPeriods+instance SchemaType CommodityDeliveryPeriods+ +-- | A scheme identifying the types of the Delivery Point for a +-- physically settled commodity trade. +data CommodityDeliveryPoint+data CommodityDeliveryPointAttributes+instance Eq CommodityDeliveryPoint+instance Eq CommodityDeliveryPointAttributes+instance Show CommodityDeliveryPoint+instance Show CommodityDeliveryPointAttributes+instance SchemaType CommodityDeliveryPoint+instance Extension CommodityDeliveryPoint Scheme+ +-- | A scheme identifying how the parties to the trade aportion +-- responsibility for the delivery of the commodity product +-- (for example Free On Board, Cost, Insurance, Freight) +data CommodityDeliveryRisk+data CommodityDeliveryRiskAttributes+instance Eq CommodityDeliveryRisk+instance Eq CommodityDeliveryRiskAttributes+instance Show CommodityDeliveryRisk+instance Show CommodityDeliveryRiskAttributes+instance SchemaType CommodityDeliveryRisk+instance Extension CommodityDeliveryRisk Scheme+ +-- | A type for defining exercise procedures associated with a +-- European style exercise of a commodity option. +data CommodityEuropeanExercise+instance Eq CommodityEuropeanExercise+instance Show CommodityEuropeanExercise+instance SchemaType CommodityEuropeanExercise+instance Extension CommodityEuropeanExercise Exercise+ +-- | The parameters for defining how the commodity option can be +-- exercised, how it is priced and how it is settled. +data CommodityExercise+instance Eq CommodityExercise+instance Show CommodityExercise+instance SchemaType CommodityExercise+ +data CommodityExercisePeriods+instance Eq CommodityExercisePeriods+instance Show CommodityExercisePeriods+instance SchemaType CommodityExercisePeriods+ +-- | A scheme identifying the physical event relative to which +-- option expiration occurs. +data CommodityExpireRelativeToEvent+data CommodityExpireRelativeToEventAttributes+instance Eq CommodityExpireRelativeToEvent+instance Eq CommodityExpireRelativeToEventAttributes+instance Show CommodityExpireRelativeToEvent+instance Show CommodityExpireRelativeToEventAttributes+instance SchemaType CommodityExpireRelativeToEvent+instance Extension CommodityExpireRelativeToEvent Scheme+ +-- | Commodity Forward +data CommodityForward+instance Eq CommodityForward+instance Show CommodityForward+instance SchemaType CommodityForward+instance Extension CommodityForward Product+ +-- | The Fixed Price for a given Calculation Period during the +-- life of the trade. There must be a Fixed Price step +-- specified for each Calculation Period, regardless of +-- whether the Fixed Price changes or remains the same between +-- periods. +data CommodityFixedPriceSchedule+instance Eq CommodityFixedPriceSchedule+instance Show CommodityFixedPriceSchedule+instance SchemaType CommodityFixedPriceSchedule+ +-- | Abstract base class for all commodity forward legs +data CommodityForwardLeg+instance Eq CommodityForwardLeg+instance Show CommodityForwardLeg+instance SchemaType CommodityForwardLeg+instance Extension CommodityForwardLeg Leg+ +-- | Frequency Type for use in Pricing Date specifications. +data CommodityFrequencyType+data CommodityFrequencyTypeAttributes+instance Eq CommodityFrequencyType+instance Eq CommodityFrequencyTypeAttributes+instance Show CommodityFrequencyType+instance Show CommodityFrequencyTypeAttributes+instance SchemaType CommodityFrequencyType+instance Extension CommodityFrequencyType Scheme+ +-- | A type defining the FX observations to be used to convert +-- the observed Commodity Reference Price to the Settlement +-- Currency. The rate source must be specified. Additionally, +-- a time for the spot price to be observed on that source may +-- be specified, or else an averaging schedule for trades +-- priced using an average FX rate. +data CommodityFx+instance Eq CommodityFx+instance Show CommodityFx+instance SchemaType CommodityFx+ +-- | Identifes how the FX rate will be applied. This is intended +-- to differentiate between the various methods for applying +-- FX to the floating price such as a daily calculation, or +-- averaging the FX and applying the average at the end of +-- each CalculationPeriod. +data CommodityFxType+data CommodityFxTypeAttributes+instance Eq CommodityFxType+instance Eq CommodityFxTypeAttributes+instance Show CommodityFxType+instance Show CommodityFxTypeAttributes+instance SchemaType CommodityFxType+instance Extension CommodityFxType Scheme+ +-- | A type defining a hub or other reference for a physically +-- settled commodity trade. +data CommodityHub+instance Eq CommodityHub+instance Show CommodityHub+instance SchemaType CommodityHub+ +-- | A scheme identifying the code for a hub or other reference +-- for a physically settled commodity trade. +data CommodityHubCode+data CommodityHubCodeAttributes+instance Eq CommodityHubCode+instance Eq CommodityHubCodeAttributes+instance Show CommodityHubCode+instance Show CommodityHubCodeAttributes+instance SchemaType CommodityHubCode+instance Extension CommodityHubCode Scheme+ +-- | ISDA 1993 or 2005 commodity market disruption elements. +data CommodityMarketDisruption+instance Eq CommodityMarketDisruption+instance Show CommodityMarketDisruption+instance SchemaType CommodityMarketDisruption+ +-- | A type for defining the multiple exercise provisions of an +-- American style commodity option. +data CommodityMultipleExercise+instance Eq CommodityMultipleExercise+instance Show CommodityMultipleExercise+instance SchemaType CommodityMultipleExercise+ +-- | Commodity Notional. +data CommodityNotionalQuantity+instance Eq CommodityNotionalQuantity+instance Show CommodityNotionalQuantity+instance SchemaType CommodityNotionalQuantity+ +-- | The Notional Quantity per Calculation Period. There must be +-- a Notional Quantity step specified for each Calculation +-- Period, regardless of whether the Notional Quantity changes +-- or remains the same between periods. +data CommodityNotionalQuantitySchedule+instance Eq CommodityNotionalQuantitySchedule+instance Show CommodityNotionalQuantitySchedule+instance SchemaType CommodityNotionalQuantitySchedule+ +-- | Commodity Option. +data CommodityOption+instance Eq CommodityOption+instance Show CommodityOption+instance SchemaType CommodityOption+instance Extension CommodityOption Product+ +-- | A scheme identifying the physical event relative to which +-- payment occurs. +data CommodityPayRelativeToEvent+data CommodityPayRelativeToEventAttributes+instance Eq CommodityPayRelativeToEvent+instance Eq CommodityPayRelativeToEventAttributes+instance Show CommodityPayRelativeToEvent+instance Show CommodityPayRelativeToEventAttributes+instance SchemaType CommodityPayRelativeToEvent+instance Extension CommodityPayRelativeToEvent Scheme+ +-- | The parameters for defining the expiration date(s) and +-- time(s) for an American style option. +data CommodityPhysicalAmericanExercise+instance Eq CommodityPhysicalAmericanExercise+instance Show CommodityPhysicalAmericanExercise+instance SchemaType CommodityPhysicalAmericanExercise+instance Extension CommodityPhysicalAmericanExercise Exercise+ +-- | The parameters for defining the expiration date(s) and +-- time(s) for a European style option. +data CommodityPhysicalEuropeanExercise+instance Eq CommodityPhysicalEuropeanExercise+instance Show CommodityPhysicalEuropeanExercise+instance SchemaType CommodityPhysicalEuropeanExercise+instance Extension CommodityPhysicalEuropeanExercise Exercise+ +-- | The parameters for defining how the physically-settled +-- commodity option can be exercised and how it is settled. +data CommodityPhysicalExercise+instance Eq CommodityPhysicalExercise+instance Show CommodityPhysicalExercise+instance SchemaType CommodityPhysicalExercise+ +-- | A type defining the physical quantity of the commodity to +-- be delivered. +data CommodityPhysicalQuantity+instance Eq CommodityPhysicalQuantity+instance Show CommodityPhysicalQuantity+instance SchemaType CommodityPhysicalQuantity+instance Extension CommodityPhysicalQuantity CommodityPhysicalQuantityBase+ +-- | An abstract base class for physical quantity types. +data CommodityPhysicalQuantityBase+instance Eq CommodityPhysicalQuantityBase+instance Show CommodityPhysicalQuantityBase+instance SchemaType CommodityPhysicalQuantityBase+ +-- | The Quantity per Delivery Period. There must be a Quantity +-- step specified for each Delivery Period, regardless of +-- whether the Quantity changes or remains the same between +-- periods. +data CommodityPhysicalQuantitySchedule+instance Eq CommodityPhysicalQuantitySchedule+instance Show CommodityPhysicalQuantitySchedule+instance SchemaType CommodityPhysicalQuantitySchedule+ +-- | The pipeline through which the physical commodity will be +-- delivered. +data CommodityPipeline+data CommodityPipelineAttributes+instance Eq CommodityPipeline+instance Eq CommodityPipelineAttributes+instance Show CommodityPipeline+instance Show CommodityPipelineAttributes+instance SchemaType CommodityPipeline+instance Extension CommodityPipeline Scheme+ +-- | The pipeline cycle during which the physical commodity will +-- be delivered. +data CommodityPipelineCycle+data CommodityPipelineCycleAttributes+instance Eq CommodityPipelineCycle+instance Eq CommodityPipelineCycleAttributes+instance Show CommodityPipelineCycle+instance Show CommodityPipelineCycleAttributes+instance SchemaType CommodityPipelineCycle+instance Extension CommodityPipelineCycle Scheme+ +-- | The commodity option premium payable by the buyer to the +-- seller. +data CommodityPremium+instance Eq CommodityPremium+instance Show CommodityPremium+instance SchemaType CommodityPremium+instance Extension CommodityPremium NonNegativePayment+instance Extension CommodityPremium PaymentBaseExtended+instance Extension CommodityPremium PaymentBase+ +-- | The dates on which prices are observed for the underlyer. +data CommodityPricingDates+instance Eq CommodityPricingDates+instance Show CommodityPricingDates+instance SchemaType CommodityPricingDates+ +-- | A scheme identifying the grade of physical commodity +-- product to be delivered. +data CommodityProductGrade+data CommodityProductGradeAttributes+instance Eq CommodityProductGrade+instance Eq CommodityProductGradeAttributes+instance Show CommodityProductGrade+instance Show CommodityProductGradeAttributes+instance SchemaType CommodityProductGrade+instance Extension CommodityProductGrade Scheme+ +-- | A type for defining the frequency at which the Notional +-- Quantity is deemed to apply for purposes of calculating the +-- Total Notional Quantity. +data CommodityQuantityFrequency+data CommodityQuantityFrequencyAttributes+instance Eq CommodityQuantityFrequency+instance Eq CommodityQuantityFrequencyAttributes+instance Show CommodityQuantityFrequency+instance Show CommodityQuantityFrequencyAttributes+instance SchemaType CommodityQuantityFrequency+instance Extension CommodityQuantityFrequency Scheme+ +-- | The Expiration Dates of the trade relative to the +-- Calculation Periods. +data CommodityRelativeExpirationDates+instance Eq CommodityRelativeExpirationDates+instance Show CommodityRelativeExpirationDates+instance SchemaType CommodityRelativeExpirationDates+ +-- | The Payment Dates of the trade relative to the Calculation +-- Periods. +data CommodityRelativePaymentDates+instance Eq CommodityRelativePaymentDates+instance Show CommodityRelativePaymentDates+instance SchemaType CommodityRelativePaymentDates+ +-- | The notional quantity of electricity that applies to one or +-- more groups of Settlement Periods. +data CommoditySettlementPeriodsNotionalQuantity+instance Eq CommoditySettlementPeriodsNotionalQuantity+instance Show CommoditySettlementPeriodsNotionalQuantity+instance SchemaType CommoditySettlementPeriodsNotionalQuantity+instance Extension CommoditySettlementPeriodsNotionalQuantity CommodityNotionalQuantity+ +-- | The notional quantity schedule of electricity that applies +-- to one or more groups of Settlement Periods. +data CommoditySettlementPeriodsNotionalQuantitySchedule+instance Eq CommoditySettlementPeriodsNotionalQuantitySchedule+instance Show CommoditySettlementPeriodsNotionalQuantitySchedule+instance SchemaType CommoditySettlementPeriodsNotionalQuantitySchedule+ +-- | The fixed price schedule for electricity that applies to +-- one or more groups of Settlement Periods. +data CommoditySettlementPeriodsPriceSchedule+instance Eq CommoditySettlementPeriodsPriceSchedule+instance Show CommoditySettlementPeriodsPriceSchedule+instance SchemaType CommoditySettlementPeriodsPriceSchedule+ +data CommoditySpread+instance Eq CommoditySpread+instance Show CommoditySpread+instance SchemaType CommoditySpread+instance Extension CommoditySpread Money+instance Extension CommoditySpread MoneyBase+ +-- | The Spread per Calculation Period. There must be a Spread +-- specified for each Calculation Period, regardless of +-- whether the Spread changes or remains the same between +-- periods. +data CommoditySpreadSchedule+instance Eq CommoditySpreadSchedule+instance Show CommoditySpreadSchedule+instance SchemaType CommoditySpreadSchedule+ +-- | The Strike Price per Unit per Calculation Period. There +-- must be a Strike Price per Unit step specified for each +-- Calculation Period, regardless of whether the Strike +-- changes or remains the same between periods. +data CommodityStrikeSchedule+instance Eq CommodityStrikeSchedule+instance Show CommodityStrikeSchedule+instance SchemaType CommodityStrikeSchedule+ +-- | Commodity Swap. +data CommoditySwap+instance Eq CommoditySwap+instance Show CommoditySwap+instance SchemaType CommoditySwap+instance Extension CommoditySwap Product+ +-- | Commodity Swaption. +data CommoditySwaption+instance Eq CommoditySwaption+instance Show CommoditySwaption+instance SchemaType CommoditySwaption+instance Extension CommoditySwaption Product+ +data CommoditySwaptionUnderlying+instance Eq CommoditySwaptionUnderlying+instance Show CommoditySwaptionUnderlying+instance SchemaType CommoditySwaptionUnderlying+ +-- | Abstract base class for all commodity swap legs +data CommoditySwapLeg+instance Eq CommoditySwapLeg+instance Show CommoditySwapLeg+instance SchemaType CommoditySwapLeg+instance Extension CommoditySwapLeg Leg+ +-- | A Disruption Fallback. +data DisruptionFallback+data DisruptionFallbackAttributes+instance Eq DisruptionFallback+instance Eq DisruptionFallbackAttributes+instance Show DisruptionFallback+instance Show DisruptionFallbackAttributes+instance SchemaType DisruptionFallback+instance Extension DisruptionFallback Scheme+ +-- | The physical delivery conditions for electricity. +data ElectricityDelivery+instance Eq ElectricityDelivery+instance Show ElectricityDelivery+instance SchemaType ElectricityDelivery+ +-- | The physical delivery obligation options specific to a firm +-- transaction. +data ElectricityDeliveryFirm+instance Eq ElectricityDeliveryFirm+instance Show ElectricityDeliveryFirm+instance SchemaType ElectricityDeliveryFirm+ +-- | The different options for specifying the Delivery Periods +-- for a physically settled electricity trade. +data ElectricityDeliveryPeriods+instance Eq ElectricityDeliveryPeriods+instance Show ElectricityDeliveryPeriods+instance SchemaType ElectricityDeliveryPeriods+instance Extension ElectricityDeliveryPeriods CommodityDeliveryPeriods+ +-- | A scheme identifying the types of the Delivery Point for a +-- physically settled electricity trade. +data ElectricityDeliveryPoint+data ElectricityDeliveryPointAttributes+instance Eq ElectricityDeliveryPoint+instance Eq ElectricityDeliveryPointAttributes+instance Show ElectricityDeliveryPoint+instance Show ElectricityDeliveryPointAttributes+instance SchemaType ElectricityDeliveryPoint+instance Extension ElectricityDeliveryPoint Scheme+ +-- | The physical delivery obligation options specific to a +-- system firm transaction. +data ElectricityDeliverySystemFirm+instance Eq ElectricityDeliverySystemFirm+instance Show ElectricityDeliverySystemFirm+instance SchemaType ElectricityDeliverySystemFirm+ +data ElectricityDeliveryType+instance Eq ElectricityDeliveryType+instance Show ElectricityDeliveryType+instance SchemaType ElectricityDeliveryType+ +-- | The physical delivery obligation options specific to a unit +-- firm transaction. +data ElectricityDeliveryUnitFirm+instance Eq ElectricityDeliveryUnitFirm+instance Show ElectricityDeliveryUnitFirm+instance SchemaType ElectricityDeliveryUnitFirm+ +-- | A type defining the physical quantity of the electricity to +-- be delivered. +data ElectricityPhysicalDeliveryQuantity+instance Eq ElectricityPhysicalDeliveryQuantity+instance Show ElectricityPhysicalDeliveryQuantity+instance SchemaType ElectricityPhysicalDeliveryQuantity+instance Extension ElectricityPhysicalDeliveryQuantity CommodityNotionalQuantity+ +-- | Allows the documentation of a shaped quantity trade where +-- the quantity changes over the life of the transaction. +data ElectricityPhysicalDeliveryQuantitySchedule+instance Eq ElectricityPhysicalDeliveryQuantitySchedule+instance Show ElectricityPhysicalDeliveryQuantitySchedule+instance SchemaType ElectricityPhysicalDeliveryQuantitySchedule+instance Extension ElectricityPhysicalDeliveryQuantitySchedule CommodityPhysicalQuantitySchedule+ +-- | Physically settled leg of a physically settled electricity +-- transaction. +data ElectricityPhysicalLeg+instance Eq ElectricityPhysicalLeg+instance Show ElectricityPhysicalLeg+instance SchemaType ElectricityPhysicalLeg+instance Extension ElectricityPhysicalLeg PhysicalSwapLeg+instance Extension ElectricityPhysicalLeg CommoditySwapLeg+instance Extension ElectricityPhysicalLeg Leg+ +-- | The quantity of gas to be delivered. +data ElectricityPhysicalQuantity+instance Eq ElectricityPhysicalQuantity+instance Show ElectricityPhysicalQuantity+instance SchemaType ElectricityPhysicalQuantity+instance Extension ElectricityPhysicalQuantity CommodityPhysicalQuantityBase+ +-- | The specification of the electricity to be delivered. +data ElectricityProduct+instance Eq ElectricityProduct+instance Show ElectricityProduct+instance SchemaType ElectricityProduct+ +-- | A structure to specify the tranmission contingency and the +-- party that bears the obligation. +data ElectricityTransmissionContingency+instance Eq ElectricityTransmissionContingency+instance Show ElectricityTransmissionContingency+instance SchemaType ElectricityTransmissionContingency+ +-- | The type of transmission contingency, i.e. what portion of +-- the transmission the delivery obligations are applicable. +data ElectricityTransmissionContingencyType+data ElectricityTransmissionContingencyTypeAttributes+instance Eq ElectricityTransmissionContingencyType+instance Eq ElectricityTransmissionContingencyTypeAttributes+instance Show ElectricityTransmissionContingencyType+instance Show ElectricityTransmissionContingencyTypeAttributes+instance SchemaType ElectricityTransmissionContingencyType+instance Extension ElectricityTransmissionContingencyType Scheme+ +-- | The common components of a financially settled leg of a +-- Commodity Swap. This is an abstract type and should be +-- extended by commodity-specific types. +data FinancialSwapLeg+instance Eq FinancialSwapLeg+instance Show FinancialSwapLeg+instance SchemaType FinancialSwapLeg+instance Extension FinancialSwapLeg CommoditySwapLeg+ +-- | A type defining the Fixed Price. +data FixedPrice+instance Eq FixedPrice+instance Show FixedPrice+instance SchemaType FixedPrice+ +-- | Fixed Price Leg of a Commodity Swap. +data FixedPriceLeg+instance Eq FixedPriceLeg+instance Show FixedPriceLeg+instance SchemaType FixedPriceLeg+instance Extension FixedPriceLeg FinancialSwapLeg+instance Extension FixedPriceLeg CommoditySwapLeg+instance Extension FixedPriceLeg Leg+ +-- | A type to capture details relevant to the calculation of +-- the floating price. +data FloatingLegCalculation+instance Eq FloatingLegCalculation+instance Show FloatingLegCalculation+instance SchemaType FloatingLegCalculation+ +-- | Floating Price Leg of a Commodity Swap. +data FloatingPriceLeg+instance Eq FloatingPriceLeg+instance Show FloatingPriceLeg+instance SchemaType FloatingPriceLeg+instance Extension FloatingPriceLeg FinancialSwapLeg+instance Extension FloatingPriceLeg CommoditySwapLeg+instance Extension FloatingPriceLeg Leg+ +-- | The specification of the gas to be delivered. +data GasDelivery+instance Eq GasDelivery+instance Show GasDelivery+instance SchemaType GasDelivery+ +-- | A scheme identifying the types of the Delivery Point for a +-- physically settled gas trade. +data GasDeliveryPoint+data GasDeliveryPointAttributes+instance Eq GasDeliveryPoint+instance Eq GasDeliveryPointAttributes+instance Show GasDeliveryPoint+instance Show GasDeliveryPointAttributes+instance SchemaType GasDeliveryPoint+instance Extension GasDeliveryPoint Scheme+ +-- | The different options for specifying the Delivery Periods +-- for a physically settled gas trade. +data GasDeliveryPeriods+instance Eq GasDeliveryPeriods+instance Show GasDeliveryPeriods+instance SchemaType GasDeliveryPeriods+instance Extension GasDeliveryPeriods CommodityDeliveryPeriods+ +-- | Physically settled leg of a physically settled gas +-- transaction. +data GasPhysicalLeg+instance Eq GasPhysicalLeg+instance Show GasPhysicalLeg+instance SchemaType GasPhysicalLeg+instance Extension GasPhysicalLeg PhysicalSwapLeg+instance Extension GasPhysicalLeg CommoditySwapLeg+instance Extension GasPhysicalLeg Leg+ +-- | The quantity of gas to be delivered. +data GasPhysicalQuantity+instance Eq GasPhysicalQuantity+instance Show GasPhysicalQuantity+instance SchemaType GasPhysicalQuantity+instance Extension GasPhysicalQuantity CommodityPhysicalQuantityBase+ +-- | A type defining the characteristics of the gas being traded +-- in a physically settled gas transaction. +data GasProduct+instance Eq GasProduct+instance Show GasProduct+instance SchemaType GasProduct+ +-- | The quantity of gas to be delivered. +data GasQuality+data GasQualityAttributes+instance Eq GasQuality+instance Eq GasQualityAttributes+instance Show GasQuality+instance Show GasQualityAttributes+instance SchemaType GasQuality+instance Extension GasQuality Scheme+ +-- | An observation period that is offset from a Calculation +-- Period. +data Lag+instance Eq Lag+instance Show Lag+instance SchemaType Lag+ +-- | Allows a lag to reference one already defined elsewhere in +-- the trade. +data LagReference+instance Eq LagReference+instance Show LagReference+instance SchemaType LagReference+instance Extension LagReference Reference+ +-- | A Market Disruption Event. +data MarketDisruptionEvent+data MarketDisruptionEventAttributes+instance Eq MarketDisruptionEvent+instance Eq MarketDisruptionEventAttributes+instance Show MarketDisruptionEvent+instance Show MarketDisruptionEventAttributes+instance SchemaType MarketDisruptionEvent+instance Extension MarketDisruptionEvent Scheme+ +-- | The details of a fixed payment. Can be used for a forward +-- transaction or as the base for a more complex fixed leg +-- component such as the fixed leg of a swap. +data NonPeriodicFixedPriceLeg+instance Eq NonPeriodicFixedPriceLeg+instance Show NonPeriodicFixedPriceLeg+instance SchemaType NonPeriodicFixedPriceLeg+instance Extension NonPeriodicFixedPriceLeg CommoditySwapLeg+instance Extension NonPeriodicFixedPriceLeg Leg+ +-- | The physical delivery conditions for an oil product. +data OilDelivery+instance Eq OilDelivery+instance Show OilDelivery+instance SchemaType OilDelivery+ +-- | Physically settled leg of a physically settled oil product +-- transaction. +data OilPhysicalLeg+instance Eq OilPhysicalLeg+instance Show OilPhysicalLeg+instance SchemaType OilPhysicalLeg+instance Extension OilPhysicalLeg PhysicalSwapLeg+instance Extension OilPhysicalLeg CommoditySwapLeg+instance Extension OilPhysicalLeg Leg+ +-- | The physical delivery conditions specific to an oil product +-- delivered by pipeline. +data OilPipelineDelivery+instance Eq OilPipelineDelivery+instance Show OilPipelineDelivery+instance SchemaType OilPipelineDelivery+ +-- | The specification of the oil product to be delivered. +data OilProduct+instance Eq OilProduct+instance Show OilProduct+instance SchemaType OilProduct+ +-- | The type of physical commodity product to be delivered. +data OilProductType+data OilProductTypeAttributes+instance Eq OilProductType+instance Eq OilProductTypeAttributes+instance Show OilProductType+instance Show OilProductTypeAttributes+instance SchemaType OilProductType+instance Extension OilProductType Scheme+ +-- | The physical delivery conditions specific to an oil product +-- delivered by title transfer. +data OilTransferDelivery+instance Eq OilTransferDelivery+instance Show OilTransferDelivery+instance SchemaType OilTransferDelivery+ +-- | The acceptable tolerance in the delivered quantity of a +-- physical commodity product in terms of a percentage of the +-- agreed delivery quantity. +data PercentageTolerance+instance Eq PercentageTolerance+instance Show PercentageTolerance+instance SchemaType PercentageTolerance+ +-- | The common components of a physically settled leg of a +-- Commodity Forward. This is an abstract type and should be +-- extended by commodity-specific types. +data PhysicalForwardLeg+instance Eq PhysicalForwardLeg+instance Show PhysicalForwardLeg+instance SchemaType PhysicalForwardLeg+instance Extension PhysicalForwardLeg CommodityForwardLeg+ +-- | The common components of a physically settled leg of a +-- Commodity Swap. This is an abstract type and should be +-- extended by commodity-specific types. +data PhysicalSwapLeg+instance Eq PhysicalSwapLeg+instance Show PhysicalSwapLeg+instance SchemaType PhysicalSwapLeg+instance Extension PhysicalSwapLeg CommoditySwapLeg+ +-- | A pointer tyle reference to a Quantity schedule defined +-- elsewhere. +data QuantityScheduleReference+instance Eq QuantityScheduleReference+instance Show QuantityScheduleReference+instance SchemaType QuantityScheduleReference+instance Extension QuantityScheduleReference Reference+ +-- | A pointer tyle reference to a Quantity defined elsewhere. +data QuantityReference+instance Eq QuantityReference+instance Show QuantityReference+instance SchemaType QuantityReference+instance Extension QuantityReference Reference+ +-- | A Disruption Fallback with the sequence in which it should +-- be applied relative to other Disruption Fallbacks. +data SequencedDisruptionFallback+instance Eq SequencedDisruptionFallback+instance Show SequencedDisruptionFallback+instance SchemaType SequencedDisruptionFallback+ +-- | Specifies a set of Settlement Periods associated with an +-- Electricity Transaction for delivery on an Applicable Day +-- or for a series of Applicable Days. +data SettlementPeriods+instance Eq SettlementPeriods+instance Show SettlementPeriods+instance SchemaType SettlementPeriods+ +-- | A type defining the Fixed Price applicable to a range or +-- ranges of Settlement Periods. +data SettlementPeriodsFixedPrice+instance Eq SettlementPeriodsFixedPrice+instance Show SettlementPeriodsFixedPrice+instance SchemaType SettlementPeriodsFixedPrice+instance Extension SettlementPeriodsFixedPrice FixedPrice+ +-- | Allows a set of Settlement Periods to reference one already +-- defined elsewhere in the trade. +data SettlementPeriodsReference+instance Eq SettlementPeriodsReference+instance Show SettlementPeriodsReference+instance SchemaType SettlementPeriodsReference+instance Extension SettlementPeriodsReference Reference+ +-- | The specification of the Settlement Periods in which the +-- electricity will be delivered for a "shaped" trade i.e. +-- where different Settlement Period ranges will apply to +-- different periods of the trade. +data SettlementPeriodsSchedule+instance Eq SettlementPeriodsSchedule+instance Show SettlementPeriodsSchedule+instance SchemaType SettlementPeriodsSchedule+ +-- | A reference to the range of Settlement Periods that applies +-- to a given period of a transaction. +data SettlementPeriodsStep+instance Eq SettlementPeriodsStep+instance Show SettlementPeriodsStep+instance SchemaType SettlementPeriodsStep+ +-- | A quantity and associated unit. +data UnitQuantity+instance Eq UnitQuantity+instance Show UnitQuantity+instance SchemaType UnitQuantity+ +-- | The physical leg of a Commodity Forward Transaction for +-- which the underlyer is Bullion. +elementBullionPhysicalLeg :: XMLParser BullionPhysicalLeg+elementToXMLBullionPhysicalLeg :: BullionPhysicalLeg -> [Content ()]+ +-- | Physically settled coal leg. +elementCoalPhysicalLeg :: XMLParser CoalPhysicalLeg+elementToXMLCoalPhysicalLeg :: CoalPhysicalLeg -> [Content ()]+ +-- | Defines a commodity forward product. +elementCommodityForward :: XMLParser CommodityForward+elementToXMLCommodityForward :: CommodityForward -> [Content ()]+ +-- | Defines the substitutable commodity forward leg +elementCommodityForwardLeg :: XMLParser CommodityForwardLeg+ +-- | Defines a commodity option product. +elementCommodityOption :: XMLParser CommodityOption+elementToXMLCommodityOption :: CommodityOption -> [Content ()]+ +-- | Defines a commodity swap product. +elementCommoditySwap :: XMLParser CommoditySwap+elementToXMLCommoditySwap :: CommoditySwap -> [Content ()]+ +-- | Defines a commodity swaption product +elementCommoditySwaption :: XMLParser CommoditySwaption+elementToXMLCommoditySwaption :: CommoditySwaption -> [Content ()]+ +-- | Defines the substitutable commodity swap leg +elementCommoditySwapLeg :: XMLParser CommoditySwapLeg+ +-- | Physically settled electricity leg. +elementElectricityPhysicalLeg :: XMLParser ElectricityPhysicalLeg+elementToXMLElectricityPhysicalLeg :: ElectricityPhysicalLeg -> [Content ()]+ +-- | Fixed Price Leg. +elementFixedLeg :: XMLParser FixedPriceLeg+elementToXMLFixedLeg :: FixedPriceLeg -> [Content ()]+ +-- | Floating Price leg. +elementFloatingLeg :: XMLParser FloatingPriceLeg+elementToXMLFloatingLeg :: FloatingPriceLeg -> [Content ()]+ +-- | Physically settled natural gas leg. +elementGasPhysicalLeg :: XMLParser GasPhysicalLeg+elementToXMLGasPhysicalLeg :: GasPhysicalLeg -> [Content ()]+ +-- | Physically settled oil or refined products leg. +elementOilPhysicalLeg :: XMLParser OilPhysicalLeg+elementToXMLOilPhysicalLeg :: OilPhysicalLeg -> [Content ()]+ + + + + + + + + + + + + + + + + + + + + + + +
+ Data/FpML/V53/Doc.hs view
@@ -0,0 +1,2290 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+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+ +-- Some hs-boot imports are required, for fwd-declaring types.+import {-# SOURCE #-} Data.FpML.V53.Msg ( Message )+ +-- | A type representing a value corresponding to an identifier +-- for a parameter describing a query portfolio.+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+ -- XXX should enforce the restrictions somehow?+ -- The restrictions are:+ simpleTypeText (QueryParameterValue x) = simpleTypeText x+ +data Allocation = Allocation+ { allocation_tradeId :: Maybe TradeIdentifier+ -- ^ Unique ID for the allocation.+ , allocation_partyReference :: PartyReference+ -- ^ Reference to a party.+ , allocation_accountReference :: Maybe AccountReference+ -- ^ Reference to an account.+ , allocation_choice3 :: (Maybe (OneOf2 Xsd.Decimal [Money]))+ -- ^ Choice between:+ -- + -- (1) The fractional allocation (0.45 = 45%) of the notional + -- and "block" fees to this particular client subaccount.+ -- + -- (2) The notional allocation (amount and currency) to this + -- particular client account.+ , allocation_collateral :: Maybe Collateral+ -- ^ The sum that must be posted upfront to collateralize + -- against counterparty credit risk.+ , allocation_creditChargeAmount :: Maybe Money+ -- ^ Special credit fee assessed to certain institutions.+ , allocation_approvals :: Maybe Approvals+ -- ^ A container for approval states in the workflow.+ , allocation_masterConfirmationDate :: Maybe Xsd.Date+ -- ^ The date of the confirmation executed between the parties + -- and intended to govern the allocated trade between those + -- parties.+ , allocation_relatedParty :: [RelatedParty]+ -- ^ Specifies any relevant parties to the allocation which + -- should be referenced.+ }+ 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+ ]+ +-- | A specific approval state in the workflow.+data Approval = Approval+ { approval_type :: Maybe Xsd.NormalizedString+ -- ^ The type of approval (e.g. "Credit").+ , approval_status :: Maybe Xsd.NormalizedString+ -- ^ The current state of approval (.e.g preapproved, pending + -- approval, etc.)+ , approval_approver :: Maybe Xsd.NormalizedString+ -- ^ The full name or identifiying ID of the relevant approver.+ }+ 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+ ]+ +-- | A type used to record the differences between the current +-- trade and another indicated trade.+data BestFitTrade = BestFitTrade+ { bestFitTrade_tradeIdentifier :: Maybe TradeIdentifier+ -- ^ The identifier for the trade compared against.+ , bestFitTrade_differences :: [TradeDifference]+ -- ^ An optional set of detailed difference records.+ }+ 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+ ]+ +-- | A type for defining the obligations of the counterparty +-- subject to credit support requirements.+data Collateral = Collateral+ { collateral_independentAmount :: Maybe IndependentAmount+ -- ^ Independent Amount is an amount that usually less + -- creditworthy counterparties are asked to provide. It can + -- either be a fixed amount or a percentage of the + -- Transaction's value. The Independent Amount can be: (i) + -- transferred before any trading between the parties occurs + -- (as a deposit at a third party's account or with the + -- counterparty) or (ii) callable after trading has occurred + -- (typically because a downgrade has occurred). In situation + -- (i), the Independent Amount is not included in the + -- calculation of Exposure, but in situation (ii), it is + -- included in the calculation of Exposure. Thus, for + -- situation (ii), the Independent Amount may be transferred + -- along with any collateral call. Independent Amount is a + -- defined term in the ISDA Credit Support Annex. ("with + -- respect to a party, the amount specified as such for that + -- party in Paragraph 13; if no amount is specified, zero").+ }+ 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+ ]+ +-- | A contact id identifier allocated by a party. FpML does not +-- define the domain values associated with this element.+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+ +-- | A type defining a contract identifier issued by the +-- indicated party.+data ContractIdentifier = ContractIdentifier+ { contrIdent_ID :: Maybe Xsd.ID+ , contrIdent_partyReference :: Maybe PartyReference+ -- ^ A pointer style reference to a party identifier defined + -- elsewhere in the document. The party referenced has + -- allocated the contract identifier.+ , contrIdent_choice1 :: (Maybe (OneOf2 [ContractId] [VersionedContractId]))+ -- ^ Where the legal activity is to agree a contract of + -- variation then the business process should be to modify a + -- contract. This is a contract in its own right and not a + -- version of a previous contract. Where the business process + -- is to replace and supersede a contract then you have a new + -- contract and a contract version should not be used.+ -- + -- Choice between:+ -- + -- (1) A contract id which is not version aware.+ -- + -- (2) A contract id which is version aware.+ }+ 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+ -- ^ This element corresponds to the Credit Event Notice + -- Delivered Under Old Transaction and Deemed Delivered Under + -- New Transaction under the EXHIBIT C to 2004 ISDA Novation + -- Definitions.+ , creditDerivNotices_publiclyAvailableInformation :: Maybe Xsd.Boolean+ -- ^ This element corresponds to the Notice of Publicly + -- Available Information Delivered Under Old Transaction and + -- Deemed Delivered Under New Transaction under the EXHIBIT C + -- to 2004 ISDA Novation Definitions.+ , creditDerivNotices_physicalSettlement :: Maybe Xsd.Boolean+ -- ^ This element corresponds to the Notice of Intended Physical + -- Settlement Delivered Under Old Transaction under the + -- EXHIBIT C to 2004 ISDA Novation Definitions.+ }+ 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+ ]+ +-- | A type defining a content model that is backwards +-- compatible with older FpML releases and which can be used +-- to contain sets of data without expressing any processing +-- intention.+data DataDocument = DataDocument+ { dataDocument_fpmlVersion :: Xsd.XsdString+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , dataDocument_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , dataDocument_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , dataDocument_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , dataDocument_choice1 :: (Maybe (OneOf2 Xsd.Boolean Xsd.Boolean))+ -- ^ Choice between:+ -- + -- (1) Indicates if this message corrects an earlier request.+ -- + -- (2) Indicates if this message corrects an earlier request.+ , dataDocument_onBehalfOf :: Maybe OnBehalfOf+ -- ^ Indicates which party (and accounts) a trade is being + -- processed for.+ , dataDocument_originatingEvent :: Maybe OriginatingEvent+ , dataDocument_trade :: [Trade]+ -- ^ The root element in an FpML trade document.+ , dataDocument_party :: [Party]+ , dataDocument_account :: [Account]+ -- ^ Optional account information used to precisely define the + -- origination and destination of financial instruments.+ }+ 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+ +-- | The abstract base type from which all FpML compliant +-- messages and documents must be derived.+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+ +-- | A type defining the trade execution date time and the +-- source of it. For use inside containing types which already +-- have a Reference to a Party that has assigned this trade +-- execution date time.+data ExecutionDateTime = ExecutionDateTime Xsd.DateTime ExecutionDateTimeAttributes deriving (Eq,Show)+data ExecutionDateTimeAttributes = ExecutionDateTimeAttributes+ { executDateTimeAttrib_executionDateTimeScheme :: Maybe Xsd.AnyURI+ -- ^ Identification of the source (e.g. clock id) generating the + -- execution date time.+ }+ 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+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , indepAmount_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , indepAmount_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , indepAmount_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , indepAmount_paymentDetail :: [PaymentDetail]+ -- ^ A container element allowing a schedule of payments + -- associated with the Independent Amount.+ }+ 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+ ]+ +-- | The economics of a trade of a multiply traded instrument.+data InstrumentTradeDetails = InstrumentTradeDetails+ { instrTradeDetails_ID :: Maybe Xsd.ID+ , instrTradeDetails_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , instrTradeDetails_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , instrTradeDetails_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , instrTradeDetails_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , instrTradeDetails_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , instrTradeDetails_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , instrTradeDetails_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , instrTradeDetails_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , instrTradeDetails_underlyingAsset :: Maybe Asset+ -- ^ Define the underlying asset, either a listed security or + -- other instrument.+ , instrTradeDetails_quantity :: Maybe InstrumentTradeQuantity+ -- ^ A description of how much of the instrument was traded.+ , instrTradeDetails_pricing :: Maybe InstrumentTradePricing+ -- ^ The price paid for the instrument.+ , instrTradeDetails_principal :: Maybe InstrumentTradePrincipal+ -- ^ The value, in instrument currency, of the amount of the + -- instrument that was traded.+ }+ 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+ +-- | A structure describing the amount of an instrument that was +-- traded.+data InstrumentTradeQuantity = InstrumentTradeQuantity+ { instrTradeQuant_choice0 :: (Maybe (OneOf2 Xsd.Decimal Money))+ -- ^ Choice between:+ -- + -- (1) The (absolute) number of units of the underlying + -- instrument that were traded.+ -- + -- (2) The monetary value of the security (eg. fixed income + -- security) that was traded).+ }+ 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+ ]+ +-- | A structure describing the price paid for the instrument.+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+ ]+ +-- | A structure describing the value in "native" currency of an +-- instrument that was traded.+data InstrumentTradePrincipal = InstrumentTradePrincipal+ { instrTradePrinc_principalAmount :: Maybe NetAndGross+ -- ^ The net and/or gross value of the amount traded in native + -- currency.+ }+ 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+ ]+ +-- | The data type used for link identifiers.+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+ +-- | A structure including a net and/or a gross amount and +-- possibly fees and commissions.+data NetAndGross = NetAndGross+ { netAndGross_choice0 :: OneOf2 Xsd.Decimal (Xsd.Decimal,(Maybe (Xsd.Decimal)))+ -- ^ Choice between:+ -- + -- (1) Value including fees and commissions.+ -- + -- (2) Sequence of:+ -- + -- * Value excluding fees and commissions.+ -- + -- * Value including fees and commissions.+ }+ 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+ ]+ +-- | A type to represent a portfolio name for a particular +-- party.+data PartyPortfolioName = PartyPortfolioName+ { partyPortfName_ID :: Maybe Xsd.ID+ , partyPortfName_partyReference :: Maybe PartyReference+ -- ^ A pointer style reference to a party identifier defined + -- elsewhere in the document. The party referenced has + -- allocated the trade identifier.+ , 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+ ]+ +-- | A type defining one or more trade identifiers allocated to +-- the trade by a party. A link identifier allows the trade to +-- be associated with other related trades, e.g. trades +-- forming part of a larger structured transaction. It is +-- expected that for external communication of trade there +-- will be only one tradeId sent in the document per party.+data PartyTradeIdentifier = PartyTradeIdentifier+ { partyTradeIdent_ID :: Maybe Xsd.ID+ , partyTradeIdent_choice0 :: OneOf2 (IssuerId,TradeId) (PartyReference,(Maybe (AccountReference)),([OneOf2 TradeId VersionedTradeId]))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * issuer+ -- + -- * tradeId+ -- + -- (2) Sequence of:+ -- + -- * Reference to a party.+ -- + -- * Reference to an account.+ -- + -- * unknown+ , partyTradeIdent_linkId :: [LinkId]+ -- ^ A link identifier allowing the trade to be associated with + -- other related trades, e.g. the linkId may contain a tradeId + -- for an associated trade or several related trades may be + -- given the same linkId. FpML does not define the domain + -- values associated with this element. Note that the domain + -- values for this element are not strictly an enumerated + -- list.+ , partyTradeIdent_allocationTradeId :: [TradeIdentifier]+ -- ^ The trade id of the allocated trade. This is used by the + -- block trade to reference the allocated trade.+ , partyTradeIdent_blockTradeId :: Maybe TradeIdentifier+ -- ^ The trade id of the block trade. This is used by each one + -- of the allocated trades to reference the block trade. This + -- element can also represent the trade id of the parent trade + -- for N-level allocations. In the case, this element is only + -- used to model N-level allocations in which the trade acts + -- as block and allocated trade at the same time. This + -- basically means the ability to allocate a block trade to + -- multiple allocation trades, and then allocate these in turn + -- to other allocation trades (and so on if desired).+ , partyTradeIdent_originatingTradeId :: Maybe TradeIdentifier+ -- ^ The trade id of the trade upon which this was based, for + -- example the ID of the trade that was submitted for clearing + -- if this is a cleared trade, or of the original trade if + -- this was novated or cancelled and rebooked. The + -- originatingEvent will explain why the trade was created.+ }+ 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+ +-- | A type containing multiple partyTradeIdentifier.+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+ ]+ +-- | A type defining additional information that may be recorded +-- against a trade.+data PartyTradeInformation = PartyTradeInformation+ { partyTradeInfo_partyReference :: PartyReference+ -- ^ Reference to a party.+ , partyTradeInfo_accountReference :: Maybe AccountReference+ -- ^ Reference to an account.+ , partyTradeInfo_relatedParty :: [RelatedParty]+ -- ^ Identifies a related party performing a role within the + -- transaction.+ , partyTradeInfo_reportingRole :: Maybe ReportingRole+ -- ^ Identifies the role of this party in reporting this trade + -- (e.g. originator, counterparty).+ , partyTradeInfo_relatedBusinessUnit :: [RelatedBusinessUnit]+ -- ^ Provides information about a unit/division/desk etc. that + -- executed or supports this trade+ , partyTradeInfo_relatedPerson :: [RelatedPerson]+ -- ^ Provides information about a person that executed or + -- supports this trade+ , partyTradeInfo_isAccountingHedge :: Maybe Xsd.Boolean+ -- ^ Specifies whether the trade used to hedge a risk for + -- accounting purposes for the specified party. (TODO: do we + -- need to distinguish between asset and liability hedges?)+ , partyTradeInfo_category :: [TradeCategory]+ -- ^ Used to categorize trades into user-defined categories, + -- such as house trades vs. customer trades.+ , partyTradeInfo_executionDateTime :: Maybe ExecutionDateTime+ -- ^ Trade execution date time provided by a central execution + -- facility.+ , partyTradeInfo_timestamps :: Maybe TradeProcessingTimestamps+ -- ^ Allows timing information about a trade to be recorded.+ , partyTradeInfo_intentToAllocate :: Maybe Xsd.Boolean+ -- ^ Specifies whether the trade is anticipated to be allocated.+ , partyTradeInfo_allocationStatus :: Maybe AllocationReportingStatus+ -- ^ Specifies whether the trade is anticipated to be allocated, + -- has been allocated, or will not be allocated.+ , partyTradeInfo_intentToClear :: Maybe Xsd.Boolean+ -- ^ Specifies whether the trade is anticipated to be cleared + -- via a derivative clearing organization+ , partyTradeInfo_clearingStatus :: Maybe ClearingStatusValue+ -- ^ Describes the status with respect to clearing (e.g. + -- Submitted, Pending, Cleared, RejectedForClearing, etc.)+ , partyTradeInfo_collateralizationType :: Maybe CollateralizationType+ -- ^ Specifies whether this party posts collateral. For + -- Recordkeeping, the collateralization type refers to + -- collateral that is posted by this firm, and One-Way is not + -- meaningful. In other words, if the collateralization type + -- is Full, this trade is fully collateralized by this party. + -- For Transparency view, the options include Full, Partial, + -- Uncollateralized, and One-Way.+ , partyTradeInfo_reportingRegime :: [ReportingRegime]+ -- ^ Allows the organization to specify which if any relevant + -- regulators or other supervisory bodies this is relevant + -- for, and what reporting rules apply.+ , partyTradeInfo_choice16 :: (Maybe (OneOf2 Xsd.Boolean EndUserExceptionDeclaration))+ -- ^ Choice between:+ -- + -- (1) Specifies whether the trade is not obligated to be + -- cleared via a derivative clearing organization because + -- the "End User Exception" was invoked.+ -- + -- (2) Claims an end user exception and provides supporting + -- evidence.+ , partyTradeInfo_nonStandardTerms :: Maybe Xsd.Boolean+ -- ^ Indicates that the trade has price-affecting + -- characteristics in addition to the standard real-time + -- reportable terms. The flag indicates that the price for + -- this trade is not to be construed as being indicative of + -- the market for standardised trades with otherwise identical + -- reportable terms.+ , partyTradeInfo_offMarketPrice :: Maybe Xsd.Boolean+ -- ^ Indicates that the price does not reflect the current + -- market. For example, in a credit trade where the two + -- counterparties are not of equal credit standing, there is + -- no initial margin and one party pays collateral to the + -- other in the form of an add-on to the price (say a price + -- that would otherwise be 100 at the market is struck at 105 + -- to include the collateral, resulting in a very off-market + -- looking price.)+ , partyTradeInfo_largeSizeTrade :: Maybe Xsd.Boolean+ -- ^ Specifies whether the sender of this trade considers it to + -- be a large notional trade or block trade for reporting + -- purposes, and thus eligible for delayed public reporting. + -- Normally this will only be applicable for off-facility + -- trades.+ , partyTradeInfo_executionType :: Maybe ExecutionType+ -- ^ Used to describe how the trade was executed, e.g. via voice + -- or electronically.+ , partyTradeInfo_executionVenueType :: Maybe ExecutionVenueType+ -- ^ Used to describe the type of venue where trade was + -- executed, e.g via an execution facility or privately.+ , partyTradeInfo_verificationMethod :: Maybe ConfirmationMethod+ -- ^ Used to describe how the trade was or will be verified, e.g + -- via a confirmation facility, via private electronic + -- service, or via written documentation. This affect the + -- timing of real-time reporting requirements. This field is + -- provisional pending detailed confirmation of the data + -- requirements, and may not be included in subsequent working + -- drafts.+ , partyTradeInfo_confirmationMethod :: Maybe ConfirmationMethod+ -- ^ Used to describe how the trade was confirmed, e.g via a + -- confirmation facility, via private electronic service, or + -- via written documentation. This affects the process flow + -- for confirmation messages. This field is provisional + -- pending detailed confirmation of the data requirements, and + -- may not be included in subsequent working drafts.+ }+ 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+ ]+ +-- | Code that describes what type of allocation applies to the +-- trade. Options include Unallocated, ToBeAllocated, +-- Allocated.+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+ +-- | The current status value of a clearing request.+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+ +-- | Code that describes what type of collateral is posted by a +-- party to a transaction. Options include Uncollateralized, +-- Partial, Full, One-Way.+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+ +-- | Records supporting information justifying an end user +-- exception under 17 CFR part 39.+data EndUserExceptionDeclaration = EndUserExceptionDeclaration+ { endUserExceptDeclar_creditDocument :: [CreditDocument]+ -- ^ What arrangements will be made to provide credit? (e.g. + -- CSA, collateral pledge, guaranty, available resources, + -- financing).+ , endUserExceptDeclar_organizationCharacteristic :: [OrganizationCharacteristic]+ -- ^ Allows the organization to specify which categories or + -- characteristics apply to it for end-user exception + -- determination. Examples include "FinancialEntity", + -- "CaptiveFinanceUnit", "BoardOfDirectorsApproval".+ , endUserExceptDeclar_transactionCharacteristic :: [TransactionCharacteristic]+ -- ^ Allows the relevant transaction level categories or + -- characteristics to be recorded for end-user exception + -- determination. Examples include "BoardOfDirectorsApproval", + -- "HedgesCommercialRisk".+ , endUserExceptDeclar_supervisorRegistration :: [SupervisorRegistration]+ -- ^ Allows the organization to specify which if any relevant + -- regulators it is registered with, and if so their + -- identification number. For example, it could specify that + -- it is SEC registered and provide its Central Index Key.+ }+ 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+ ]+ +-- | A credit arrangement used in support of swaps trading.+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+ +-- | A characteristic of an organization used in declaring an +-- end-user exception.+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+ +-- | A characteristic of a transaction used in declaring an +-- end-user exception.+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+ +-- | A value that explains the reason or purpose that +-- information is being reported. Examples might include +-- RealTimePublic reporting, PrimaryEconomicTerms reporting, +-- Confirmation reporting, or Snapshot reporting.+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+ +-- | Provides information about a regulator or other supervisory +-- body that an organization is registered with.+data SupervisorRegistration = SupervisorRegistration+ { supervRegist_supervisoryBody :: SupervisoryBody+ -- ^ The regulator or other supervisory body the organization is + -- registered with (e.g. SEC).+ , supervRegist_registrationNumber :: Maybe RegulatorId+ -- ^ The ID assigned by the regulator (e.g. SEC's Central Index + -- Key).+ }+ 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+ ]+ + +-- | Provides information about how the information in this +-- message is applicable to a regulatory reporting process.+data ReportingRegime = ReportingRegime+ { reportRegime_choice0 :: OneOf2 (ReportingRegimeName,[SupervisorRegistration]) [SupervisorRegistration]+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * Identifies the reporting regime under which this + -- data is reported. For example, Dodd-Frank, MiFID, + -- HongKongOTCDRepository, ODRF+ -- + -- * Identifies the specific regulator or other + -- supervisory body for which this data is produced. + -- For example, CFTC, SEC, UKFSA, ODRF, SFC, ESMA.+ -- + -- (2) Identifies the specific regulator or other supervisory + -- body for which this data is produced. For example, + -- CFTC, SEC, UKFSA, ODRF, SFC, ESMA.+ , reportRegime_reportingRole :: Maybe ReportingRole+ -- ^ Identifies the role of this party in reporting this trade + -- for this regulator; roles could include ReportingParty and + -- Voluntary reporting.+ , reportRegime_reportingPurpose :: [ReportingPurpose]+ -- ^ The reason this message is being sent, for example + -- Snapshot, PET, Confirmation, RealTimePublic.+ , reportRegime_mandatorilyClearable :: Maybe Xsd.Boolean+ -- ^ Whether the particular trade type in question is required + -- by this regulator to be cleared.+ }+ 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+ ]+ +-- | An ID assigned by a regulator to an organization registered +-- with it. (NOTE: should this just by represented by an +-- alternate party ID?)+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+ +-- | Allows timing information about when a trade was processed +-- and reported to be recorded.+data TradeProcessingTimestamps = TradeProcessingTimestamps+ { tradeProcesTimest_orderEntered :: Maybe Xsd.DateTime+ -- ^ When an order was first generated, as recorded for the + -- first time when it was first entered by a person or + -- generated by a trading algorithm (i.e., the first record of + -- the order).+ , tradeProcesTimest_orderSubmitted :: Maybe Xsd.DateTime+ -- ^ The time when an order is submitted by a market participant + -- to an execution facility, as recorded based on the + -- timestamp of the message that was sent by the participant. + -- If the participant records this time (i.e. it is in the + -- participant's party trade information), it will be the time + -- the message was sent. If the execution facility records + -- this time (i.e. it is in the facility's party trade + -- information), it will be the time the message was received.+ , tradeProcesTimest_publiclyReported :: Maybe Xsd.DateTime+ -- ^ When the public report of this was created or received by + -- this party. If the participant records this time (i.e. it + -- is in the participant's party trade information), it will + -- be the time the message was sent. If the execution records + -- this time (i.e. it is in the facility's party trade + -- information), it will be the time the message was received.+ , tradeProcesTimest_publicReportUpdated :: Maybe Xsd.DateTime+ -- ^ When the public report of this was most recently corrected + -- or corrections were sent or received by this party.+ , tradeProcesTimest_nonpubliclyReported :: Maybe Xsd.DateTime+ -- ^ When the non-public report of this was created or received + -- by this party.+ , tradeProcesTimest_nonpublicReportUpdated :: Maybe Xsd.DateTime+ -- ^ When the non-public report of this was most recently + -- corrected or corrections were received by this party.+ , tradeProcesTimest_submittedForConfirmation :: Maybe Xsd.DateTime+ -- ^ When this trade was supplied to a confirmation service or + -- counterparty for confirmation.+ , tradeProcesTimest_updatedForConfirmation :: Maybe Xsd.DateTime+ -- ^ When the most recent correction to this trade was supplied + -- to a confirmation service or counterparty for confirmation.+ , tradeProcesTimest_confirmed :: Maybe Xsd.DateTime+ -- ^ When this trade was confirmed.+ , tradeProcesTimest_submittedForClearing :: Maybe Xsd.DateTime+ -- ^ When this trade was supplied to a clearing service for + -- clearing.+ , tradeProcesTimest_updatedForClearing :: Maybe Xsd.DateTime+ -- ^ When the most recent correction to this trade was supplied + -- to a clearing service for clearing.+ , tradeProcesTimest_cleared :: Maybe Xsd.DateTime+ -- ^ When this trade was cleared.+ , tradeProcesTimest_allocationsSubmitted :: Maybe Xsd.DateTime+ -- ^ When allocations for this trade were submitted or received + -- by this party.+ , tradeProcesTimest_allocationsUpdated :: Maybe Xsd.DateTime+ -- ^ When allocations for this trade were most recently + -- corrected.+ , tradeProcesTimest_allocationsCompleted :: Maybe Xsd.DateTime+ -- ^ When allocations for this trade were completely processed.+ , tradeProcesTimest_timestamp :: [TradeTimestamp]+ -- ^ Other timestamps for this trade. This is provisional in + -- Recordkeeping and Transparency view and may be reviewed in + -- a subsequent draft.+ }+ 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+ ]+ +-- | A generic trade timestamp+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+ ]+ +-- | The type or meaning of a timestamp.+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+ +-- | An identifier of an reporting regime or format used for +-- regulatory reporting, for example DoddFrankAct, MiFID, +-- HongKongOTCDRepository, etc.+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+ +-- | An identifier of an organization that supervises or +-- regulates trading activity, e.g. CFTC, SEC, FSA, ODRF, etc.+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+ +-- | A type used to represent the type of market where a trade +-- can be executed.+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+ +-- | A type used to represent the type of market where a trade +-- can be executed.+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+ +-- | A type used to represent the type of mechanism that can be +-- used to confirm a trade.+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+ -- ^ Payment date.+ , paymentDetail_paymentRule :: Maybe PaymentRule+ -- ^ A type defining the calculation rule.+ , paymentDetail_paymentAmount :: Maybe Money+ -- ^ A fixed payment amount.+ }+ 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+ +-- | The abstract base type from which all calculation rules of +-- the independent amount must be derived.+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+ +-- | A type defining a content model for a calculation rule +-- defined as percentage of the notional amount.+data PercentageRule = PercentageRule+ { percenRule_paymentPercent :: Maybe Xsd.Decimal+ -- ^ A percentage of the notional amount.+ , percenRule_notionalAmountReference :: Maybe NotionalAmountReference+ -- ^ A reference to the notional amount.+ }+ 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+ +-- | A type representing an arbitary grouping of trade +-- references.+data Portfolio = Portfolio+ { portfolio_ID :: Maybe Xsd.ID+ , portfolio_partyPortfolioName :: Maybe PartyPortfolioName+ -- ^ The name of the portfolio together with the party that gave + -- the name.+ , portfolio_choice1 :: (Maybe (OneOf2 [TradeId] [PartyTradeIdentifier]))+ -- ^ Choice between:+ -- + -- (1) tradeId+ -- + -- (2) partyTradeIdentifier+ , portfolio :: [Portfolio]+ -- ^ An arbitary grouping of trade references (and possibly + -- other portfolios).+ }+ 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+ ]+ +-- | The data type used for portfolio names.+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+ +-- | A type representing criteria for defining a query +-- portfolio. The criteria are made up of a QueryParameterId, +-- QueryParameterValue and QueryParameterOperator.+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+ ]+ +-- | A type representing an identifier for a parameter +-- describing a query portfolio. An identifier can be anything +-- from a product name like swap to a termination date.+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+ +-- | A type representing an operator describing the relationship +-- of a value to its corresponding identifier for a parameter +-- describing a query portfolio. Possible relationships +-- include equals, not equals, less than, greater than. +-- Possible operators are listed in the +-- queryParameterOperatorScheme.+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+ +-- | A type representing a portfolio obtained by querying the +-- set of trades held in a repository. It contains trades +-- matching the intersection of all criteria specified using +-- one or more queryParameters or trades matching the union of +-- two or more child queryPortfolios.+data QueryPortfolio = QueryPortfolio+ { queryPortf_ID :: Maybe Xsd.ID+ , queryPortf_partyPortfolioName :: Maybe PartyPortfolioName+ -- ^ The name of the portfolio together with the party that gave + -- the name.+ , queryPortf_choice1 :: (Maybe (OneOf2 [TradeId] [PartyTradeIdentifier]))+ -- ^ Choice between:+ -- + -- (1) tradeId+ -- + -- (2) partyTradeIdentifier+ , queryPortf_portfolio :: [Portfolio]+ -- ^ An arbitary grouping of trade references (and possibly + -- other portfolios).+ , 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+ +-- | A type containing a code representing the role of a party +-- in a report, e.g. the originator, the recipient, the +-- counterparty, etc. This is used to clarify which +-- participant's information is being reported.+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+ +-- | A type defining a group of products making up a single +-- trade.+data Strategy = Strategy+ { strategy_ID :: Maybe Xsd.ID+ , strategy_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , strategy_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , strategy_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , strategy_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , strategy_premiumProductReference :: Maybe ProductReference+ -- ^ Indicates which product within a strategy represents the + -- premium payment.+ , strategy_product :: [Product]+ -- ^ An abstract element used as a place holder for the + -- substituting product elements.+ }+ 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+ +-- | A type defining an FpML trade.+data Trade = Trade+ { trade_ID :: Maybe Xsd.ID+ , trade_header :: Maybe TradeHeader+ -- ^ The information on the trade which is not product specific, + -- e.g. trade date.+ , trade_product :: Maybe Product+ -- ^ An abstract element used as a place holder for the + -- substituting product elements.+ , trade_otherPartyPayment :: [Payment]+ -- ^ Other fees or additional payments associated with the + -- trade, e.g. broker commissions, where one or more of the + -- parties involved are not principal parties involved in the + -- trade.+ , trade_brokerPartyReference :: [PartyReference]+ -- ^ Identifies that party (or parties) that brokered this + -- trade.+ , trade_calculationAgent :: Maybe CalculationAgent+ -- ^ The ISDA calculation agent responsible for performing + -- duties as defined in the applicable product definitions.+ , trade_calculationAgentBusinessCenter :: Maybe BusinessCenter+ -- ^ The city in which the office through which ISDA Calculation + -- Agent is acting for purposes of the transaction is located + -- The short-form confirm for a trade that is executed under a + -- Sovereign or Asia Pacific Master Confirmation Agreement ( + -- MCA ), does not need to specify the Calculation Agent. + -- However, the confirm does need to specify the Calculation + -- Agent City. This is due to the fact that the MCA sets the + -- value for Calculation Agent but does not set the value for + -- Calculation Agent City.+ , trade_determiningParty :: [PartyReference]+ -- ^ The party referenced is the ISDA Determination Party that + -- specified in the related Confirmation as Determination + -- Party.+ , trade_hedgingParty :: [PartyReference]+ -- ^ The party referenced is the ISDA Hedging Party that + -- specified in the related Confirmation as Hedging, or if no + -- Hedging Party is specified, either party to the + -- Transaction.+ , trade_collateral :: Maybe Collateral+ -- ^ Defines collateral obiligations of a Party+ , trade_documentation :: Maybe Documentation+ -- ^ Defines the definitions that govern the document and should + -- include the year and type of definitions referenced, along + -- with any relevant documentation (such as master agreement) + -- and the date it was signed.+ , trade_governingLaw :: Maybe GoverningLaw+ -- ^ Identification of the law governing the transaction.+ , trade_allocations :: Maybe Allocations+ -- ^ "Short-form" representation of allocations in which the key + -- block economics are stated once within the trade structure, + -- and the allocation data is contained in this allocations + -- structure.+ }+ 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+ ]+ +-- | A scheme used to categorize positions.+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+ +-- | A type used to record the details of a difference between +-- two business objects/+data TradeDifference = TradeDifference+ { tradeDiffer_differenceType :: Maybe DifferenceTypeEnum+ -- ^ The type of difference that exists.+ , tradeDiffer_differenceSeverity :: Maybe DifferenceSeverityEnum+ -- ^ An indication of the severity of the difference.+ , tradeDiffer_element :: Maybe Xsd.XsdString+ -- ^ The name of the element affected.+ , tradeDiffer_basePath :: Maybe Xsd.XsdString+ -- ^ XPath to the element in the base object.+ , tradeDiffer_baseValue :: Maybe Xsd.XsdString+ -- ^ The value of the element in the base object.+ , tradeDiffer_otherPath :: Maybe Xsd.XsdString+ -- ^ XPath to the element in the other object.+ , tradeDiffer_otherValue :: Maybe Xsd.XsdString+ -- ^ Value of the element in the other trade.+ , tradeDiffer_missingElement :: [Xsd.XsdString]+ -- ^ Element(s) that are missing in the other trade.+ , tradeDiffer_extraElement :: [Xsd.XsdString]+ -- ^ Element(s) that are extraneous in the other object.+ , tradeDiffer_message :: Maybe Xsd.XsdString+ -- ^ A human readable description of the problem.+ }+ 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+ ]+ +-- | A type defining trade related information which is not +-- product specific.+data TradeHeader = TradeHeader+ { tradeHeader_partyTradeIdentifier :: [PartyTradeIdentifier]+ -- ^ The trade reference identifier(s) allocated to the trade by + -- the parties involved.+ , tradeHeader_partyTradeInformation :: [PartyTradeInformation]+ -- ^ Additional trade information that may be provided by each + -- involved party.+ , tradeHeader_tradeDate :: Maybe IdentifiedDate+ -- ^ The trade date. This is the date the trade was originally + -- executed. In the case of a novation, the novated part of + -- the trade should be reported (by both the remaining party + -- and the transferee) using a trade date corresponding to the + -- date the novation was agreed. The remaining part of a trade + -- should be reported (by both the transferor and the + -- remaining party) using a trade date corresponding to the + -- original execution date.+ , tradeHeader_clearedDate :: Maybe IdentifiedDate+ -- ^ If the trade was cleared (novated) through a central + -- counterparty clearing service, this represents the date the + -- trade was cleared (transferred to the central + -- counterparty).+ }+ 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+ ]+ +-- | A trade reference identifier allocated by a party. FpML +-- does not define the domain values associated with this +-- element. Note that the domain values for this element are +-- not strictly an enumerated list.+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+ +-- | A type defining a trade identifier issued by the indicated +-- party.+data TradeIdentifier = TradeIdentifier+ { tradeIdent_ID :: Maybe Xsd.ID+ , tradeIdent_choice0 :: OneOf2 (IssuerId,TradeId) (PartyReference,(Maybe (AccountReference)),([OneOf2 TradeId VersionedTradeId]))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * issuer+ -- + -- * tradeId+ -- + -- (2) Sequence of:+ -- + -- * Reference to a party.+ -- + -- * Reference to an account.+ -- + -- * unknown+ }+ 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+ ]+ +-- | The data type used for issuer identifiers.+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+ +-- | A reference identifying a rule within a validation scheme.+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+ +-- | Contract Id with Version Support+data VersionedContractId = VersionedContractId+ { versiContrId_contractId :: Maybe ContractId+ , versiContrId_version :: Maybe Xsd.NonNegativeInteger+ -- ^ The version number+ , versiContrId_effectiveDate :: Maybe IdentifiedDate+ -- ^ Optionally it is possible to specify a version effective + -- date when a versionId is supplied.+ }+ 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+ ]+ +-- | Trade Id with Version Support+data VersionedTradeId = VersionedTradeId+ { versiTradeId_tradeId :: Maybe TradeId+ , versiTradeId_version :: Maybe Xsd.NonNegativeInteger+ -- ^ The version number+ , versiTradeId_effectiveDate :: Maybe IdentifiedDate+ -- ^ Optionally it is possible to specify a version effective + -- date when a versionId is supplied.+ }+ 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+ ]+ +-- | A type to hold trades of multiply-traded instruments. +-- Typically this will be used to represent the trade +-- resulting from a physically-settled OTC product where the +-- underlying is a security, for example the exercise of a +-- physically-settled option.+elementInstrumentTradeDetails :: XMLParser InstrumentTradeDetails+elementInstrumentTradeDetails = parseSchemaType "instrumentTradeDetails"+elementToXMLInstrumentTradeDetails :: InstrumentTradeDetails -> [Content ()]+elementToXMLInstrumentTradeDetails = schemaTypeToXML "instrumentTradeDetails"+ +-- | A strategy product.+elementStrategy :: XMLParser Strategy+elementStrategy = parseSchemaType "strategy"+elementToXMLStrategy :: Strategy -> [Content ()]+elementToXMLStrategy = schemaTypeToXML "strategy"+ + + + + + + +
+ Data/FpML/V53/Doc.hs-boot view
@@ -0,0 +1,606 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+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 qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Asset+ +-- | A type representing a value corresponding to an identifier +-- for a parameter describing a query portfolio. +newtype QueryParameterValue = QueryParameterValue Xsd.XsdString+instance Eq QueryParameterValue+instance Show QueryParameterValue+instance Restricts QueryParameterValue Xsd.XsdString+instance SchemaType QueryParameterValue+instance SimpleType QueryParameterValue+ +data Allocation+instance Eq Allocation+instance Show Allocation+instance SchemaType Allocation+ +data Allocations+instance Eq Allocations+instance Show Allocations+instance SchemaType Allocations+ +-- | A specific approval state in the workflow. +data Approval+instance Eq Approval+instance Show Approval+instance SchemaType Approval+ +data Approvals+instance Eq Approvals+instance Show Approvals+instance SchemaType Approvals+ +-- | A type used to record the differences between the current +-- trade and another indicated trade. +data BestFitTrade+instance Eq BestFitTrade+instance Show BestFitTrade+instance SchemaType BestFitTrade+ +-- | A type for defining the obligations of the counterparty +-- subject to credit support requirements. +data Collateral+instance Eq Collateral+instance Show Collateral+instance SchemaType Collateral+ +-- | A contact id identifier allocated by a party. FpML does not +-- define the domain values associated with this element. +data ContractId+data ContractIdAttributes+instance Eq ContractId+instance Eq ContractIdAttributes+instance Show ContractId+instance Show ContractIdAttributes+instance SchemaType ContractId+instance Extension ContractId Scheme+ +-- | A type defining a contract identifier issued by the +-- indicated party. +data ContractIdentifier+instance Eq ContractIdentifier+instance Show ContractIdentifier+instance SchemaType ContractIdentifier+ +data CreditDerivativesNotices+instance Eq CreditDerivativesNotices+instance Show CreditDerivativesNotices+instance SchemaType CreditDerivativesNotices+ +-- | A type defining a content model that is backwards +-- compatible with older FpML releases and which can be used +-- to contain sets of data without expressing any processing +-- intention. +data DataDocument+instance Eq DataDocument+instance Show DataDocument+instance SchemaType DataDocument+instance Extension DataDocument Document+ +-- | The abstract base type from which all FpML compliant +-- messages and documents must be derived. +data Document+instance Eq Document+instance Show Document+instance SchemaType Document+ +-- | A type defining the trade execution date time and the +-- source of it. For use inside containing types which already +-- have a Reference to a Party that has assigned this trade +-- execution date time. +data ExecutionDateTime+data ExecutionDateTimeAttributes+instance Eq ExecutionDateTime+instance Eq ExecutionDateTimeAttributes+instance Show ExecutionDateTime+instance Show ExecutionDateTimeAttributes+instance SchemaType ExecutionDateTime+instance Extension ExecutionDateTime Xsd.DateTime+ +data FirstPeriodStartDate+data FirstPeriodStartDateAttributes+instance Eq FirstPeriodStartDate+instance Eq FirstPeriodStartDateAttributes+instance Show FirstPeriodStartDate+instance Show FirstPeriodStartDateAttributes+instance SchemaType FirstPeriodStartDate+instance Extension FirstPeriodStartDate Xsd.Date+ +data IndependentAmount+instance Eq IndependentAmount+instance Show IndependentAmount+instance SchemaType IndependentAmount+ +-- | The economics of a trade of a multiply traded instrument. +data InstrumentTradeDetails+instance Eq InstrumentTradeDetails+instance Show InstrumentTradeDetails+instance SchemaType InstrumentTradeDetails+instance Extension InstrumentTradeDetails Product+ +-- | A structure describing the amount of an instrument that was +-- traded. +data InstrumentTradeQuantity+instance Eq InstrumentTradeQuantity+instance Show InstrumentTradeQuantity+instance SchemaType InstrumentTradeQuantity+ +-- | A structure describing the price paid for the instrument. +data InstrumentTradePricing+instance Eq InstrumentTradePricing+instance Show InstrumentTradePricing+instance SchemaType InstrumentTradePricing+ +-- | A structure describing the value in "native" currency of an +-- instrument that was traded. +data InstrumentTradePrincipal+instance Eq InstrumentTradePrincipal+instance Show InstrumentTradePrincipal+instance SchemaType InstrumentTradePrincipal+ +-- | The data type used for link identifiers. +data LinkId+data LinkIdAttributes+instance Eq LinkId+instance Eq LinkIdAttributes+instance Show LinkId+instance Show LinkIdAttributes+instance SchemaType LinkId+instance Extension LinkId Scheme+ +-- | A structure including a net and/or a gross amount and +-- possibly fees and commissions. +data NetAndGross+instance Eq NetAndGross+instance Show NetAndGross+instance SchemaType NetAndGross+ +-- | A type to represent a portfolio name for a particular +-- party. +data PartyPortfolioName+instance Eq PartyPortfolioName+instance Show PartyPortfolioName+instance SchemaType PartyPortfolioName+ +-- | A type defining one or more trade identifiers allocated to +-- the trade by a party. A link identifier allows the trade to +-- be associated with other related trades, e.g. trades +-- forming part of a larger structured transaction. It is +-- expected that for external communication of trade there +-- will be only one tradeId sent in the document per party. +data PartyTradeIdentifier+instance Eq PartyTradeIdentifier+instance Show PartyTradeIdentifier+instance SchemaType PartyTradeIdentifier+instance Extension PartyTradeIdentifier TradeIdentifier+ +-- | A type containing multiple partyTradeIdentifier. +data PartyTradeIdentifiers+instance Eq PartyTradeIdentifiers+instance Show PartyTradeIdentifiers+instance SchemaType PartyTradeIdentifiers+ +-- | A type defining additional information that may be recorded +-- against a trade. +data PartyTradeInformation+instance Eq PartyTradeInformation+instance Show PartyTradeInformation+instance SchemaType PartyTradeInformation+ +-- | Code that describes what type of allocation applies to the +-- trade. Options include Unallocated, ToBeAllocated, +-- Allocated. +data AllocationReportingStatus+data AllocationReportingStatusAttributes+instance Eq AllocationReportingStatus+instance Eq AllocationReportingStatusAttributes+instance Show AllocationReportingStatus+instance Show AllocationReportingStatusAttributes+instance SchemaType AllocationReportingStatus+instance Extension AllocationReportingStatus Scheme+ +-- | The current status value of a clearing request. +data ClearingStatusValue+data ClearingStatusValueAttributes+instance Eq ClearingStatusValue+instance Eq ClearingStatusValueAttributes+instance Show ClearingStatusValue+instance Show ClearingStatusValueAttributes+instance SchemaType ClearingStatusValue+instance Extension ClearingStatusValue Scheme+ +-- | Code that describes what type of collateral is posted by a +-- party to a transaction. Options include Uncollateralized, +-- Partial, Full, One-Way. +data CollateralizationType+data CollateralizationTypeAttributes+instance Eq CollateralizationType+instance Eq CollateralizationTypeAttributes+instance Show CollateralizationType+instance Show CollateralizationTypeAttributes+instance SchemaType CollateralizationType+instance Extension CollateralizationType Scheme+ +-- | Records supporting information justifying an end user +-- exception under 17 CFR part 39. +data EndUserExceptionDeclaration+instance Eq EndUserExceptionDeclaration+instance Show EndUserExceptionDeclaration+instance SchemaType EndUserExceptionDeclaration+ +-- | A credit arrangement used in support of swaps trading. +data CreditDocument+data CreditDocumentAttributes+instance Eq CreditDocument+instance Eq CreditDocumentAttributes+instance Show CreditDocument+instance Show CreditDocumentAttributes+instance SchemaType CreditDocument+instance Extension CreditDocument Scheme+ +-- | A characteristic of an organization used in declaring an +-- end-user exception. +data OrganizationCharacteristic+data OrganizationCharacteristicAttributes+instance Eq OrganizationCharacteristic+instance Eq OrganizationCharacteristicAttributes+instance Show OrganizationCharacteristic+instance Show OrganizationCharacteristicAttributes+instance SchemaType OrganizationCharacteristic+instance Extension OrganizationCharacteristic Scheme+ +-- | A characteristic of a transaction used in declaring an +-- end-user exception. +data TransactionCharacteristic+data TransactionCharacteristicAttributes+instance Eq TransactionCharacteristic+instance Eq TransactionCharacteristicAttributes+instance Show TransactionCharacteristic+instance Show TransactionCharacteristicAttributes+instance SchemaType TransactionCharacteristic+instance Extension TransactionCharacteristic Scheme+ +-- | A value that explains the reason or purpose that +-- information is being reported. Examples might include +-- RealTimePublic reporting, PrimaryEconomicTerms reporting, +-- Confirmation reporting, or Snapshot reporting. +data ReportingPurpose+data ReportingPurposeAttributes+instance Eq ReportingPurpose+instance Eq ReportingPurposeAttributes+instance Show ReportingPurpose+instance Show ReportingPurposeAttributes+instance SchemaType ReportingPurpose+instance Extension ReportingPurpose Scheme+ +-- | Provides information about a regulator or other supervisory +-- body that an organization is registered with. +data SupervisorRegistration+instance Eq SupervisorRegistration+instance Show SupervisorRegistration+instance SchemaType SupervisorRegistration+ + +-- | Provides information about how the information in this +-- message is applicable to a regulatory reporting process. +data ReportingRegime+instance Eq ReportingRegime+instance Show ReportingRegime+instance SchemaType ReportingRegime+ +-- | An ID assigned by a regulator to an organization registered +-- with it. (NOTE: should this just by represented by an +-- alternate party ID?) +data RegulatorId+data RegulatorIdAttributes+instance Eq RegulatorId+instance Eq RegulatorIdAttributes+instance Show RegulatorId+instance Show RegulatorIdAttributes+instance SchemaType RegulatorId+instance Extension RegulatorId Scheme+ +-- | Allows timing information about when a trade was processed +-- and reported to be recorded. +data TradeProcessingTimestamps+instance Eq TradeProcessingTimestamps+instance Show TradeProcessingTimestamps+instance SchemaType TradeProcessingTimestamps+ +-- | A generic trade timestamp +data TradeTimestamp+instance Eq TradeTimestamp+instance Show TradeTimestamp+instance SchemaType TradeTimestamp+ +-- | The type or meaning of a timestamp. +data TimestampTypeScheme+data TimestampTypeSchemeAttributes+instance Eq TimestampTypeScheme+instance Eq TimestampTypeSchemeAttributes+instance Show TimestampTypeScheme+instance Show TimestampTypeSchemeAttributes+instance SchemaType TimestampTypeScheme+instance Extension TimestampTypeScheme Scheme+ +-- | An identifier of an reporting regime or format used for +-- regulatory reporting, for example DoddFrankAct, MiFID, +-- HongKongOTCDRepository, etc. +data ReportingRegimeName+data ReportingRegimeNameAttributes+instance Eq ReportingRegimeName+instance Eq ReportingRegimeNameAttributes+instance Show ReportingRegimeName+instance Show ReportingRegimeNameAttributes+instance SchemaType ReportingRegimeName+instance Extension ReportingRegimeName Scheme+ +-- | An identifier of an organization that supervises or +-- regulates trading activity, e.g. CFTC, SEC, FSA, ODRF, etc. +data SupervisoryBody+data SupervisoryBodyAttributes+instance Eq SupervisoryBody+instance Eq SupervisoryBodyAttributes+instance Show SupervisoryBody+instance Show SupervisoryBodyAttributes+instance SchemaType SupervisoryBody+instance Extension SupervisoryBody Scheme+ +-- | A type used to represent the type of market where a trade +-- can be executed. +data ExecutionVenueType+data ExecutionVenueTypeAttributes+instance Eq ExecutionVenueType+instance Eq ExecutionVenueTypeAttributes+instance Show ExecutionVenueType+instance Show ExecutionVenueTypeAttributes+instance SchemaType ExecutionVenueType+instance Extension ExecutionVenueType Scheme+ +-- | A type used to represent the type of market where a trade +-- can be executed. +data ExecutionType+data ExecutionTypeAttributes+instance Eq ExecutionType+instance Eq ExecutionTypeAttributes+instance Show ExecutionType+instance Show ExecutionTypeAttributes+instance SchemaType ExecutionType+instance Extension ExecutionType Scheme+ +-- | A type used to represent the type of mechanism that can be +-- used to confirm a trade. +data ConfirmationMethod+data ConfirmationMethodAttributes+instance Eq ConfirmationMethod+instance Eq ConfirmationMethodAttributes+instance Show ConfirmationMethod+instance Show ConfirmationMethodAttributes+instance SchemaType ConfirmationMethod+instance Extension ConfirmationMethod Scheme+ +data PaymentDetail+instance Eq PaymentDetail+instance Show PaymentDetail+instance SchemaType PaymentDetail+instance Extension PaymentDetail PaymentBase+ +-- | The abstract base type from which all calculation rules of +-- the independent amount must be derived. +data PaymentRule+instance Eq PaymentRule+instance Show PaymentRule+instance SchemaType PaymentRule+ +-- | A type defining a content model for a calculation rule +-- defined as percentage of the notional amount. +data PercentageRule+instance Eq PercentageRule+instance Show PercentageRule+instance SchemaType PercentageRule+instance Extension PercentageRule PaymentRule+ +-- | A type representing an arbitary grouping of trade +-- references. +data Portfolio+instance Eq Portfolio+instance Show Portfolio+instance SchemaType Portfolio+ +-- | The data type used for portfolio names. +data PortfolioName+data PortfolioNameAttributes+instance Eq PortfolioName+instance Eq PortfolioNameAttributes+instance Show PortfolioName+instance Show PortfolioNameAttributes+instance SchemaType PortfolioName+instance Extension PortfolioName Scheme+ +-- | A type representing criteria for defining a query +-- portfolio. The criteria are made up of a QueryParameterId, +-- QueryParameterValue and QueryParameterOperator. +data QueryParameter+instance Eq QueryParameter+instance Show QueryParameter+instance SchemaType QueryParameter+ +-- | A type representing an identifier for a parameter +-- describing a query portfolio. An identifier can be anything +-- from a product name like swap to a termination date. +data QueryParameterId+data QueryParameterIdAttributes+instance Eq QueryParameterId+instance Eq QueryParameterIdAttributes+instance Show QueryParameterId+instance Show QueryParameterIdAttributes+instance SchemaType QueryParameterId+instance Extension QueryParameterId Scheme+ +-- | A type representing an operator describing the relationship +-- of a value to its corresponding identifier for a parameter +-- describing a query portfolio. Possible relationships +-- include equals, not equals, less than, greater than. +-- Possible operators are listed in the +-- queryParameterOperatorScheme. +data QueryParameterOperator+data QueryParameterOperatorAttributes+instance Eq QueryParameterOperator+instance Eq QueryParameterOperatorAttributes+instance Show QueryParameterOperator+instance Show QueryParameterOperatorAttributes+instance SchemaType QueryParameterOperator+instance Extension QueryParameterOperator Scheme+ +-- | A type representing a portfolio obtained by querying the +-- set of trades held in a repository. It contains trades +-- matching the intersection of all criteria specified using +-- one or more queryParameters or trades matching the union of +-- two or more child queryPortfolios. +data QueryPortfolio+instance Eq QueryPortfolio+instance Show QueryPortfolio+instance SchemaType QueryPortfolio+instance Extension QueryPortfolio Portfolio+ +-- | A type containing a code representing the role of a party +-- in a report, e.g. the originator, the recipient, the +-- counterparty, etc. This is used to clarify which +-- participant's information is being reported. +data ReportingRole+data ReportingRoleAttributes+instance Eq ReportingRole+instance Eq ReportingRoleAttributes+instance Show ReportingRole+instance Show ReportingRoleAttributes+instance SchemaType ReportingRole+instance Extension ReportingRole Scheme+ +-- | A type defining a group of products making up a single +-- trade. +data Strategy+instance Eq Strategy+instance Show Strategy+instance SchemaType Strategy+instance Extension Strategy Product+ +-- | A type defining an FpML trade. +data Trade+instance Eq Trade+instance Show Trade+instance SchemaType Trade+ +-- | A scheme used to categorize positions. +data TradeCategory+data TradeCategoryAttributes+instance Eq TradeCategory+instance Eq TradeCategoryAttributes+instance Show TradeCategory+instance Show TradeCategoryAttributes+instance SchemaType TradeCategory+instance Extension TradeCategory Scheme+ +-- | A type used to record the details of a difference between +-- two business objects/ +data TradeDifference+instance Eq TradeDifference+instance Show TradeDifference+instance SchemaType TradeDifference+ +-- | A type defining trade related information which is not +-- product specific. +data TradeHeader+instance Eq TradeHeader+instance Show TradeHeader+instance SchemaType TradeHeader+ +-- | A trade reference identifier allocated by a party. FpML +-- does not define the domain values associated with this +-- element. Note that the domain values for this element are +-- not strictly an enumerated list. +data TradeId+data TradeIdAttributes+instance Eq TradeId+instance Eq TradeIdAttributes+instance Show TradeId+instance Show TradeIdAttributes+instance SchemaType TradeId+instance Extension TradeId Scheme+ +-- | A type defining a trade identifier issued by the indicated +-- party. +data TradeIdentifier+instance Eq TradeIdentifier+instance Show TradeIdentifier+instance SchemaType TradeIdentifier+ +-- | The data type used for issuer identifiers. +data IssuerId+data IssuerIdAttributes+instance Eq IssuerId+instance Eq IssuerIdAttributes+instance Show IssuerId+instance Show IssuerIdAttributes+instance SchemaType IssuerId+instance Extension IssuerId Scheme+ +data Trader+data TraderAttributes+instance Eq Trader+instance Eq TraderAttributes+instance Show Trader+instance Show TraderAttributes+instance SchemaType Trader+instance Extension Trader Scheme+ +-- | A reference identifying a rule within a validation scheme. +data Validation+data ValidationAttributes+instance Eq Validation+instance Eq ValidationAttributes+instance Show Validation+instance Show ValidationAttributes+instance SchemaType Validation+instance Extension Validation Scheme+ +-- | Contract Id with Version Support +data VersionedContractId+instance Eq VersionedContractId+instance Show VersionedContractId+instance SchemaType VersionedContractId+ +-- | Trade Id with Version Support +data VersionedTradeId+instance Eq VersionedTradeId+instance Show VersionedTradeId+instance SchemaType VersionedTradeId+ +-- | A type to hold trades of multiply-traded instruments. +-- Typically this will be used to represent the trade +-- resulting from a physically-settled OTC product where the +-- underlying is a security, for example the exercise of a +-- physically-settled option. +elementInstrumentTradeDetails :: XMLParser InstrumentTradeDetails+elementToXMLInstrumentTradeDetails :: InstrumentTradeDetails -> [Content ()]+ +-- | A strategy product. +elementStrategy :: XMLParser Strategy+elementToXMLStrategy :: Strategy -> [Content ()]+ + + + + + + +
+ Data/FpML/V53/Enum.hs view
@@ -0,0 +1,3383 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Enum+ ( module Data.FpML.V53.Enum+ ) 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+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | The type of averaging used in an Asian option.+data AveragingInOutEnum+ = AveragingInOutEnum_In+ -- ^ The average price is used to derive the strike price. Also + -- known as "Asian strike" style option.+ | AveragingInOutEnum_Out+ -- ^ The average price is used to derive the expiration price. + -- Also known as "Asian price" style option.+ | AveragingInOutEnum_Both+ -- ^ The average price is used to derive both the strike and the + -- expiration price.+ deriving (Eq,Show,Enum)+instance SchemaType AveragingInOutEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType AveragingInOutEnum where+ acceptingParser = do isWord "In"; return AveragingInOutEnum_In+ `onFail` do isWord "Out"; return AveragingInOutEnum_Out+ `onFail` do isWord "Both"; return AveragingInOutEnum_Both+ + simpleTypeText AveragingInOutEnum_In = "In"+ simpleTypeText AveragingInOutEnum_Out = "Out"+ simpleTypeText AveragingInOutEnum_Both = "Both"+ +-- | The method of calculation to be used when averaging rates. +-- Per ISDA 2000 Definitions, Section 6.2. Certain Definitions +-- Relating to Floating Amounts.+data AveragingMethodEnum+ = AveragingMethodEnum_Unweighted+ -- ^ The arithmetic mean of the relevant rates for each reset + -- date.+ | AveragingMethodEnum_Weighted+ -- ^ The arithmetic mean of the relevant rates in effect for + -- each day in a calculation period calculated by multiplying + -- each relevant rate by the number of days such relevant rate + -- is in effect, determining the sum of such products and + -- dividing such sum by the number of days in the calculation + -- period.+ deriving (Eq,Show,Enum)+instance SchemaType AveragingMethodEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType AveragingMethodEnum where+ acceptingParser = do isWord "Unweighted"; return AveragingMethodEnum_Unweighted+ `onFail` do isWord "Weighted"; return AveragingMethodEnum_Weighted+ + simpleTypeText AveragingMethodEnum_Unweighted = "Unweighted"+ simpleTypeText AveragingMethodEnum_Weighted = "Weighted"+ +-- | When breakage cost is applicable, defines who is +-- calculating it.+data BreakageCostEnum+ = BreakageCostEnum_AgentBank+ -- ^ Breakage cost is calculated by the agent bank.+ | BreakageCostEnum_Lender+ -- ^ Breakage cost is calculated by the lender.+ deriving (Eq,Show,Enum)+instance SchemaType BreakageCostEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType BreakageCostEnum where+ acceptingParser = do isWord "AgentBank"; return BreakageCostEnum_AgentBank+ `onFail` do isWord "Lender"; return BreakageCostEnum_Lender+ + simpleTypeText BreakageCostEnum_AgentBank = "AgentBank"+ simpleTypeText BreakageCostEnum_Lender = "Lender"+ +-- | Defines which type of bullion is applicable for a Bullion +-- Transaction.+data BullionTypeEnum+ = BullionTypeEnum_Gold+ -- ^ Gold. Quality as per the Good Delivery Rules issued by the + -- London Bullion Market Association.+ | BullionTypeEnum_Palladium+ -- ^ Palladium. Quality as per the Good Delivery Rules issued by + -- the London Platinum and Palladium Market.+ | BullionTypeEnum_Platinum+ -- ^ Palladium. Quality as per the Good Delivery Rules issued by + -- the London Platinum and Palladium Market.+ | BullionTypeEnum_Silver+ -- ^ Silver. Quality as per the Good Delivery Rules issued by + -- the London Bullion Market Association.+ | BullionTypeEnum_RhodiumSponge+ -- ^ Quality as per the Good Delivery Rules for Rhodium + -- (Sponge).+ deriving (Eq,Show,Enum)+instance SchemaType BullionTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType BullionTypeEnum where+ acceptingParser = do isWord "Gold"; return BullionTypeEnum_Gold+ `onFail` do isWord "Palladium"; return BullionTypeEnum_Palladium+ `onFail` do isWord "Platinum"; return BullionTypeEnum_Platinum+ `onFail` do isWord "Silver"; return BullionTypeEnum_Silver+ `onFail` do isWord "RhodiumSponge"; return BullionTypeEnum_RhodiumSponge+ + simpleTypeText BullionTypeEnum_Gold = "Gold"+ simpleTypeText BullionTypeEnum_Palladium = "Palladium"+ simpleTypeText BullionTypeEnum_Platinum = "Platinum"+ simpleTypeText BullionTypeEnum_Silver = "Silver"+ simpleTypeText BullionTypeEnum_RhodiumSponge = "RhodiumSponge"+ +-- | The convention for adjusting any relevant date if it would +-- otherwise fall on a day that is not a valid business day. +-- Note that FRN is included here as a type of business day +-- convention although it does not strictly fall within ISDA's +-- definition of a Business Day Convention and does not +-- conform to the simple definition given above.+data BusinessDayConventionEnum+ = BusinessDayConventionEnum_FOLLOWING+ -- ^ The non-business date will be adjusted to the first + -- following day that is a business day+ | BusinessDayConventionEnum_FRN+ -- ^ Per 2000 ISDA Definitions, Section 4.11. FRN Convention; + -- Eurodollar Convention.+ | BusinessDayConventionEnum_MODFOLLOWING+ -- ^ The non-business date will be adjusted to the first + -- following day that is a business day unless that day falls + -- in the next calendar month, in which case that date will be + -- the first preceding day that is a business day.+ | BusinessDayConventionEnum_PRECEDING+ -- ^ The non-business day will be adjusted to the first + -- preceding day that is a business day.+ | BusinessDayConventionEnum_MODPRECEDING+ -- ^ The non-business date will be adjusted to the first + -- preceding day that is a business day unless that day falls + -- in the previous calendar month, in which case that date + -- will be the first following day that us a business day.+ | BusinessDayConventionEnum_NEAREST+ -- ^ The non-business date will be adjusted to the nearest day + -- that is a business day - i.e. if the non-business day falls + -- on any day other than a Sunday or a Monday, it will be the + -- first preceding day that is a business day, and will be the + -- first following business day if it falls on a Sunday or a + -- Monday.+ | BusinessDayConventionEnum_NONE+ -- ^ The date will not be adjusted if it falls on a day that is + -- not a business day.+ | BusinessDayConventionEnum_NotApplicable+ -- ^ The date adjustments conventions are defined elsewhere, so + -- it is not required to specify them here.+ deriving (Eq,Show,Enum)+instance SchemaType BusinessDayConventionEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType BusinessDayConventionEnum where+ acceptingParser = do isWord "FOLLOWING"; return BusinessDayConventionEnum_FOLLOWING+ `onFail` do isWord "FRN"; return BusinessDayConventionEnum_FRN+ `onFail` do isWord "MODFOLLOWING"; return BusinessDayConventionEnum_MODFOLLOWING+ `onFail` do isWord "PRECEDING"; return BusinessDayConventionEnum_PRECEDING+ `onFail` do isWord "MODPRECEDING"; return BusinessDayConventionEnum_MODPRECEDING+ `onFail` do isWord "NEAREST"; return BusinessDayConventionEnum_NEAREST+ `onFail` do isWord "NONE"; return BusinessDayConventionEnum_NONE+ `onFail` do isWord "NotApplicable"; return BusinessDayConventionEnum_NotApplicable+ + simpleTypeText BusinessDayConventionEnum_FOLLOWING = "FOLLOWING"+ simpleTypeText BusinessDayConventionEnum_FRN = "FRN"+ simpleTypeText BusinessDayConventionEnum_MODFOLLOWING = "MODFOLLOWING"+ simpleTypeText BusinessDayConventionEnum_PRECEDING = "PRECEDING"+ simpleTypeText BusinessDayConventionEnum_MODPRECEDING = "MODPRECEDING"+ simpleTypeText BusinessDayConventionEnum_NEAREST = "NEAREST"+ simpleTypeText BusinessDayConventionEnum_NONE = "NONE"+ simpleTypeText BusinessDayConventionEnum_NotApplicable = "NotApplicable"+ +-- | Shows how the transaction is to be settled when it is +-- exercised.+data CashPhysicalEnum+ = CashPhysicalEnum_Cash+ -- ^ The intrinsic value of the option will be delivered by way + -- of a cash settlement amount determined, (i) by reference to + -- the differential between the strike price and the + -- settlement price; or (ii) in accordance with a bilateral + -- agreement between the parties+ | CashPhysicalEnum_Physical+ -- ^ The securities underlying the transaction will be delivered + -- by (i) in the case of a call, the seller to the buyer, or + -- (ii) in the case of a put, the buyer to the seller versus a + -- settlement amount equivalent to the strike price per share+ deriving (Eq,Show,Enum)+instance SchemaType CashPhysicalEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType CashPhysicalEnum where+ acceptingParser = do isWord "Cash"; return CashPhysicalEnum_Cash+ `onFail` do isWord "Physical"; return CashPhysicalEnum_Physical+ + simpleTypeText CashPhysicalEnum_Cash = "Cash"+ simpleTypeText CashPhysicalEnum_Physical = "Physical"+ +-- | The specification of how a calculation agent will be +-- determined.+data CalculationAgentPartyEnum+ = CalculationAgentPartyEnum_ExercisingParty+ -- ^ The party that gives notice of exercise. Per 2000 ISDA + -- Definitions, Section 11.1. Parties, paragraph (d).+ | CalculationAgentPartyEnum_NonExercisingParty+ -- ^ The party that is given notice of exercise. Per 2000 ISDA + -- Definitions, Section 11.1. Parties, paragraph (e).+ | CalculationAgentPartyEnum_AsSpecifiedInMasterAgreement+ -- ^ The Calculation Agent is determined by reference to the + -- relevant master agreement.+ | CalculationAgentPartyEnum_AsSpecifiedInStandardTermsSupplement+ -- ^ The Calculation Agent is determined by reference to the + -- relevant standard terms supplement.+ deriving (Eq,Show,Enum)+instance SchemaType CalculationAgentPartyEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType CalculationAgentPartyEnum where+ acceptingParser = do isWord "ExercisingParty"; return CalculationAgentPartyEnum_ExercisingParty+ `onFail` do isWord "NonExercisingParty"; return CalculationAgentPartyEnum_NonExercisingParty+ `onFail` do isWord "AsSpecifiedInMasterAgreement"; return CalculationAgentPartyEnum_AsSpecifiedInMasterAgreement+ `onFail` do isWord "AsSpecifiedInStandardTermsSupplement"; return CalculationAgentPartyEnum_AsSpecifiedInStandardTermsSupplement+ + simpleTypeText CalculationAgentPartyEnum_ExercisingParty = "ExercisingParty"+ simpleTypeText CalculationAgentPartyEnum_NonExercisingParty = "NonExercisingParty"+ simpleTypeText CalculationAgentPartyEnum_AsSpecifiedInMasterAgreement = "AsSpecifiedInMasterAgreement"+ simpleTypeText CalculationAgentPartyEnum_AsSpecifiedInStandardTermsSupplement = "AsSpecifiedInStandardTermsSupplement"+ +-- | The unit in which a commission is denominated.+data CommissionDenominationEnum+ = CommissionDenominationEnum_BPS+ -- ^ The commission is expressed in basis points, in reference + -- to the price referenced in the document.+ | CommissionDenominationEnum_Percentage+ -- ^ The commission is expressed as a percentage of the gross + -- price referenced in the document.+ | CommissionDenominationEnum_CentsPerShare+ -- ^ The commission is expressed in cents per share.+ | CommissionDenominationEnum_FixedAmount+ -- ^ The commission is expressed as a absolute amount.+ deriving (Eq,Show,Enum)+instance SchemaType CommissionDenominationEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType CommissionDenominationEnum where+ acceptingParser = do isWord "BPS"; return CommissionDenominationEnum_BPS+ `onFail` do isWord "Percentage"; return CommissionDenominationEnum_Percentage+ `onFail` do isWord "CentsPerShare"; return CommissionDenominationEnum_CentsPerShare+ `onFail` do isWord "FixedAmount"; return CommissionDenominationEnum_FixedAmount+ + simpleTypeText CommissionDenominationEnum_BPS = "BPS"+ simpleTypeText CommissionDenominationEnum_Percentage = "Percentage"+ simpleTypeText CommissionDenominationEnum_CentsPerShare = "CentsPerShare"+ simpleTypeText CommissionDenominationEnum_FixedAmount = "FixedAmount"+ +-- | The consequences of Bullion Settlement Disruption Events.+data CommodityBullionSettlementDisruptionEnum+ = CommodityBullionSettlementDisruptionEnum_Negotiation+ -- ^ Negotiation will apply in the event of Bullion Settlement + -- Disruption as per Section 10.5.(d) of the 2005 Commodity + -- Definitions.+ | CommodityBullionSettlementDisruptionEnum_CancellationandPayment+ -- ^ Cancellation and Payment will apply in the event of Bullion + -- Settlement Disruption as per Section 10.5.(d) of the 2005 + -- Commodity Definitions.+ deriving (Eq,Show,Enum)+instance SchemaType CommodityBullionSettlementDisruptionEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType CommodityBullionSettlementDisruptionEnum where+ acceptingParser = do isWord "Negotiation"; return CommodityBullionSettlementDisruptionEnum_Negotiation+ `onFail` do isWord "CancellationandPayment"; return CommodityBullionSettlementDisruptionEnum_CancellationandPayment+ + simpleTypeText CommodityBullionSettlementDisruptionEnum_Negotiation = "Negotiation"+ simpleTypeText CommodityBullionSettlementDisruptionEnum_CancellationandPayment = "CancellationandPayment"+ +-- | A day type classification used in counting the number of +-- days between two dates for a commodity transaction.+data CommodityDayTypeEnum+ = CommodityDayTypeEnum_Business+ -- ^ When calculating the number of days between two dates the + -- count includes only business days.+ | CommodityDayTypeEnum_Calendar+ -- ^ When calculating the number of days between two dates the + -- count includes all calendar days.+ | CommodityDayTypeEnum_CommodityBusiness+ -- ^ When calculating the number of days between two dates the + -- count includes only commodity business days.+ | CommodityDayTypeEnum_CurrencyBusiness+ -- ^ When calculating the number of days between two dates the + -- count includes only currency business days.+ | CommodityDayTypeEnum_ExchangeBusiness+ -- ^ When calculating the number of days between two dates the + -- count includes only stock exchange business days.+ | CommodityDayTypeEnum_ScheduledTradingDay+ -- ^ When calculating the number of days between two dates the + -- count includes only scheduled trading days.+ | CommodityDayTypeEnum_GasFlow+ -- ^ When calculating the number of days between two dates the + -- count includes only gas flow days (dates on which gas is + -- delivered).+ deriving (Eq,Show,Enum)+instance SchemaType CommodityDayTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType CommodityDayTypeEnum where+ acceptingParser = do isWord "Business"; return CommodityDayTypeEnum_Business+ `onFail` do isWord "Calendar"; return CommodityDayTypeEnum_Calendar+ `onFail` do isWord "CommodityBusiness"; return CommodityDayTypeEnum_CommodityBusiness+ `onFail` do isWord "CurrencyBusiness"; return CommodityDayTypeEnum_CurrencyBusiness+ `onFail` do isWord "ExchangeBusiness"; return CommodityDayTypeEnum_ExchangeBusiness+ `onFail` do isWord "ScheduledTradingDay"; return CommodityDayTypeEnum_ScheduledTradingDay+ `onFail` do isWord "GasFlow"; return CommodityDayTypeEnum_GasFlow+ + simpleTypeText CommodityDayTypeEnum_Business = "Business"+ simpleTypeText CommodityDayTypeEnum_Calendar = "Calendar"+ simpleTypeText CommodityDayTypeEnum_CommodityBusiness = "CommodityBusiness"+ simpleTypeText CommodityDayTypeEnum_CurrencyBusiness = "CurrencyBusiness"+ simpleTypeText CommodityDayTypeEnum_ExchangeBusiness = "ExchangeBusiness"+ simpleTypeText CommodityDayTypeEnum_ScheduledTradingDay = "ScheduledTradingDay"+ simpleTypeText CommodityDayTypeEnum_GasFlow = "GasFlow"+ +-- | The compounding calculation method+data CompoundingMethodEnum+ = CompoundingMethodEnum_Flat+ -- ^ Flat compounding. Compounding excludes the spread. Note + -- that the first compounding period has it's interest + -- calculated including any spread then subsequent periods + -- compound this at a rate excluding the spread.+ | CompoundingMethodEnum_None+ -- ^ No compounding is to be applied.+ | CompoundingMethodEnum_Straight+ -- ^ Straight compounding. Compounding includes the spread.+ | CompoundingMethodEnum_SpreadExclusive+ -- ^ Spread Exclusive compounding.+ deriving (Eq,Show,Enum)+instance SchemaType CompoundingMethodEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType CompoundingMethodEnum where+ acceptingParser = do isWord "Flat"; return CompoundingMethodEnum_Flat+ `onFail` do isWord "None"; return CompoundingMethodEnum_None+ `onFail` do isWord "Straight"; return CompoundingMethodEnum_Straight+ `onFail` do isWord "SpreadExclusive"; return CompoundingMethodEnum_SpreadExclusive+ + simpleTypeText CompoundingMethodEnum_Flat = "Flat"+ simpleTypeText CompoundingMethodEnum_None = "None"+ simpleTypeText CompoundingMethodEnum_Straight = "Straight"+ simpleTypeText CompoundingMethodEnum_SpreadExclusive = "SpreadExclusive"+ +-- | A day of the seven-day week.+data DayOfWeekEnum+ = DayOfWeekEnum_MON+ -- ^ Monday+ | DayOfWeekEnum_TUE+ -- ^ Tuesday+ | DayOfWeekEnum_WED+ -- ^ Wednesday+ | DayOfWeekEnum_THU+ -- ^ Thursday+ | DayOfWeekEnum_FRI+ -- ^ Friday+ | DayOfWeekEnum_SAT+ -- ^ Saturday+ | DayOfWeekEnum_SUN+ -- ^ Sunday+ deriving (Eq,Show,Enum)+instance SchemaType DayOfWeekEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DayOfWeekEnum where+ acceptingParser = do isWord "MON"; return DayOfWeekEnum_MON+ `onFail` do isWord "TUE"; return DayOfWeekEnum_TUE+ `onFail` do isWord "WED"; return DayOfWeekEnum_WED+ `onFail` do isWord "THU"; return DayOfWeekEnum_THU+ `onFail` do isWord "FRI"; return DayOfWeekEnum_FRI+ `onFail` do isWord "SAT"; return DayOfWeekEnum_SAT+ `onFail` do isWord "SUN"; return DayOfWeekEnum_SUN+ + simpleTypeText DayOfWeekEnum_MON = "MON"+ simpleTypeText DayOfWeekEnum_TUE = "TUE"+ simpleTypeText DayOfWeekEnum_WED = "WED"+ simpleTypeText DayOfWeekEnum_THU = "THU"+ simpleTypeText DayOfWeekEnum_FRI = "FRI"+ simpleTypeText DayOfWeekEnum_SAT = "SAT"+ simpleTypeText DayOfWeekEnum_SUN = "SUN"+ +-- | A day type classification used in counting the number of +-- days between two dates.+data DayTypeEnum+ = DayTypeEnum_Business+ -- ^ When calculating the number of days between two dates the + -- count includes only business days.+ | DayTypeEnum_Calendar+ -- ^ When calculating the number of days between two dates the + -- count includes all calendar days.+ | DayTypeEnum_CommodityBusiness+ -- ^ When calculating the number of days between two dates the + -- count includes only commodity business days.+ | DayTypeEnum_CurrencyBusiness+ -- ^ When calculating the number of days between two dates the + -- count includes only currency business days.+ | DayTypeEnum_ExchangeBusiness+ -- ^ When calculating the number of days between two dates the + -- count includes only stock exchange business days.+ | DayTypeEnum_ScheduledTradingDay+ -- ^ When calculating the number of days between two dates the + -- count includes only scheduled trading days.+ deriving (Eq,Show,Enum)+instance SchemaType DayTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DayTypeEnum where+ acceptingParser = do isWord "Business"; return DayTypeEnum_Business+ `onFail` do isWord "Calendar"; return DayTypeEnum_Calendar+ `onFail` do isWord "CommodityBusiness"; return DayTypeEnum_CommodityBusiness+ `onFail` do isWord "CurrencyBusiness"; return DayTypeEnum_CurrencyBusiness+ `onFail` do isWord "ExchangeBusiness"; return DayTypeEnum_ExchangeBusiness+ `onFail` do isWord "ScheduledTradingDay"; return DayTypeEnum_ScheduledTradingDay+ + simpleTypeText DayTypeEnum_Business = "Business"+ simpleTypeText DayTypeEnum_Calendar = "Calendar"+ simpleTypeText DayTypeEnum_CommodityBusiness = "CommodityBusiness"+ simpleTypeText DayTypeEnum_CurrencyBusiness = "CurrencyBusiness"+ simpleTypeText DayTypeEnum_ExchangeBusiness = "ExchangeBusiness"+ simpleTypeText DayTypeEnum_ScheduledTradingDay = "ScheduledTradingDay"+ +data DealtCurrencyEnum+ = DealtCurrencyEnum_ExchangedCurrency1+ | DealtCurrencyEnum_ExchangedCurrency2+ deriving (Eq,Show,Enum)+instance SchemaType DealtCurrencyEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DealtCurrencyEnum where+ acceptingParser = do isWord "ExchangedCurrency1"; return DealtCurrencyEnum_ExchangedCurrency1+ `onFail` do isWord "ExchangedCurrency2"; return DealtCurrencyEnum_ExchangedCurrency2+ + simpleTypeText DealtCurrencyEnum_ExchangedCurrency1 = "ExchangedCurrency1"+ simpleTypeText DealtCurrencyEnum_ExchangedCurrency2 = "ExchangedCurrency2"+ +-- | In respect of a Transaction and a Commodity Reference +-- Price, the relevant date or month for delivery of the +-- underlying Commodity.+data DeliveryDatesEnum+ = DeliveryDatesEnum_CalculationPeriod+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the futures contract that + -- corresponds to the month and year of the Calculation + -- Period. e.g. The JAN 09 contract when pricing in January + -- '09 (In the case of contracts like Brent crude, this will + -- mean that the contract expired in DEC 08.)+ | DeliveryDatesEnum_FirstNearby+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the First Nearby Month futures + -- contract.+ | DeliveryDatesEnum_SecondNearby+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the Second Nearby Month futures + -- contract.+ | DeliveryDatesEnum_ThirdNearby+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the Third Nearby Month futures + -- contract.+ | DeliveryDatesEnum_FourthNearby+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the Fourth Nearby Month futures + -- contract.+ | DeliveryDatesEnum_FifthNearby+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the Fifth Nearby Month futures + -- contract.+ | DeliveryDatesEnum_SixthNearby+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the Sixth Nearby Month futures + -- contract.+ | DeliveryDatesEnum_SeventhNearby+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the Seventh Nearby Month futures + -- contract.+ | DeliveryDatesEnum_EighthNearby+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the Eighth Nearby Month futures + -- contract.+ | DeliveryDatesEnum_NinthNearby+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the Ninth Nearby Month futures + -- contract.+ | DeliveryDatesEnum_TenthNearby+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the Tenth Nearby Month futures + -- contract.+ | DeliveryDatesEnum_EleventhNearby+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the Eleventh Nearby Month futures + -- contract.+ | DeliveryDatesEnum_TwelfthNearby+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the Twelfth Nearby Month futures + -- contract.+ | DeliveryDatesEnum_ThirteenthNearby+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the Thirteenth Nearby Month futures + -- contract.+ | DeliveryDatesEnum_FourteenthNearby+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- month of expiration of the Fourteenth Nearby Month futures + -- contract.+ | DeliveryDatesEnum_Spot+ -- ^ The Delivery Date of the underlying Commodity shall be the + -- Spot date.+ | DeliveryDatesEnum_V1stNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the First Nearby Week.+ | DeliveryDatesEnum_V2ndNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Second Nearby Week.+ | DeliveryDatesEnum_V3rdNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Third Nearby Week.+ | DeliveryDatesEnum_V4thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Fourth Nearby Week.+ | DeliveryDatesEnum_V5thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Fifth Nearby Week.+ | DeliveryDatesEnum_V6thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Sixth Nearby Week.+ | DeliveryDatesEnum_V7thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Seventh Nearby Week.+ | DeliveryDatesEnum_V8thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Eighth Nearby Week.+ | DeliveryDatesEnum_V9thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Ninth Nearby Week.+ | DeliveryDatesEnum_V10thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Tenth Nearby Week.+ | DeliveryDatesEnum_V11thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Eleventh Nearby Week.+ | DeliveryDatesEnum_V12thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Twelfth Nearby Week.+ | DeliveryDatesEnum_V13thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Thirteenth Nearby Week.+ | DeliveryDatesEnum_V14thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Fourteenth Nearby Week.+ | DeliveryDatesEnum_V15thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Fifteenth Nearby Week.+ | DeliveryDatesEnum_V16thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Sixteenth Nearby Week.+ | DeliveryDatesEnum_V17thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Seventeenth Nearby Week.+ | DeliveryDatesEnum_V18thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Eighteenth Nearby Week.+ | DeliveryDatesEnum_V19thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Nineteenth Nearby Week.+ | DeliveryDatesEnum_V20thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Twentieth Nearby Week.+ | DeliveryDatesEnum_V21stNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Twenty First Nearby Week.+ | DeliveryDatesEnum_V22ndNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Twenty Second Nearby Week.+ | DeliveryDatesEnum_V23rdNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Twenty Third Nearby Week.+ | DeliveryDatesEnum_V24thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Twenty Fourth Nearby Week.+ | DeliveryDatesEnum_V25thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Twenty Fifth Nearby Week.+ | DeliveryDatesEnum_V26thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Twenty Sixth Nearby Week.+ | DeliveryDatesEnum_V27thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Twenty Seventh Nearby Week.+ | DeliveryDatesEnum_V28thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Twenty Eighth Nearby Week.+ | DeliveryDatesEnum_V29thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Twenty Ninth Nearby Week.+ | DeliveryDatesEnum_V30thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Thirtieth Nearby Week.+ | DeliveryDatesEnum_V31stNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Thirty First Nearby Week.+ | DeliveryDatesEnum_V32ndNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Thirty Second Nearby Week.+ | DeliveryDatesEnum_V33rdNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Thirty Third Nearby Week.+ | DeliveryDatesEnum_V34thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Thirty Fourth Nearby Week.+ | DeliveryDatesEnum_V35thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Thirty Fifth Nearby Week.+ | DeliveryDatesEnum_V36thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Thirty Sixth Nearby Week.+ | DeliveryDatesEnum_V37thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Thirty Seventh Nearby Week.+ | DeliveryDatesEnum_V38thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Thirty Eighth Nearby Week.+ | DeliveryDatesEnum_V39thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Thirty Ninth Nearby Week.+ | DeliveryDatesEnum_V40thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Fortieth Nearby Week.+ | DeliveryDatesEnum_V41stNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Forty First Nearby Week.+ | DeliveryDatesEnum_V42ndNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Forty Second Nearby Week.+ | DeliveryDatesEnum_V43rdNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Forty Third Nearby Week.+ | DeliveryDatesEnum_V44thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Forty Fourth Nearby Week.+ | DeliveryDatesEnum_V45thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Forty Fifth Nearby Week.+ | DeliveryDatesEnum_V46thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Forty Sixth Nearby Week.+ | DeliveryDatesEnum_V47thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Forty Seventh Nearby Week.+ | DeliveryDatesEnum_V48thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Forty Eighth Nearby Week.+ | DeliveryDatesEnum_V49thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Forty Ninth Nearby Week.+ | DeliveryDatesEnum_V50thNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Fiftieth Nearby Week.+ | DeliveryDatesEnum_V51stNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Fifty First Nearby Week.+ | DeliveryDatesEnum_V52ndNearbyWeek+ -- ^ The Delivery Date of the underlying Commodity shall be + -- during the Fifty Second Nearby Week.+ deriving (Eq,Show,Enum)+instance SchemaType DeliveryDatesEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DeliveryDatesEnum where+ acceptingParser = do isWord "CalculationPeriod"; return DeliveryDatesEnum_CalculationPeriod+ `onFail` do isWord "FirstNearby"; return DeliveryDatesEnum_FirstNearby+ `onFail` do isWord "SecondNearby"; return DeliveryDatesEnum_SecondNearby+ `onFail` do isWord "ThirdNearby"; return DeliveryDatesEnum_ThirdNearby+ `onFail` do isWord "FourthNearby"; return DeliveryDatesEnum_FourthNearby+ `onFail` do isWord "FifthNearby"; return DeliveryDatesEnum_FifthNearby+ `onFail` do isWord "SixthNearby"; return DeliveryDatesEnum_SixthNearby+ `onFail` do isWord "SeventhNearby"; return DeliveryDatesEnum_SeventhNearby+ `onFail` do isWord "EighthNearby"; return DeliveryDatesEnum_EighthNearby+ `onFail` do isWord "NinthNearby"; return DeliveryDatesEnum_NinthNearby+ `onFail` do isWord "TenthNearby"; return DeliveryDatesEnum_TenthNearby+ `onFail` do isWord "EleventhNearby"; return DeliveryDatesEnum_EleventhNearby+ `onFail` do isWord "TwelfthNearby"; return DeliveryDatesEnum_TwelfthNearby+ `onFail` do isWord "ThirteenthNearby"; return DeliveryDatesEnum_ThirteenthNearby+ `onFail` do isWord "FourteenthNearby"; return DeliveryDatesEnum_FourteenthNearby+ `onFail` do isWord "Spot"; return DeliveryDatesEnum_Spot+ `onFail` do isWord "1stNearbyWeek"; return DeliveryDatesEnum_V1stNearbyWeek+ `onFail` do isWord "2ndNearbyWeek"; return DeliveryDatesEnum_V2ndNearbyWeek+ `onFail` do isWord "3rdNearbyWeek"; return DeliveryDatesEnum_V3rdNearbyWeek+ `onFail` do isWord "4thNearbyWeek"; return DeliveryDatesEnum_V4thNearbyWeek+ `onFail` do isWord "5thNearbyWeek"; return DeliveryDatesEnum_V5thNearbyWeek+ `onFail` do isWord "6thNearbyWeek"; return DeliveryDatesEnum_V6thNearbyWeek+ `onFail` do isWord "7thNearbyWeek"; return DeliveryDatesEnum_V7thNearbyWeek+ `onFail` do isWord "8thNearbyWeek"; return DeliveryDatesEnum_V8thNearbyWeek+ `onFail` do isWord "9thNearbyWeek"; return DeliveryDatesEnum_V9thNearbyWeek+ `onFail` do isWord "10thNearbyWeek"; return DeliveryDatesEnum_V10thNearbyWeek+ `onFail` do isWord "11thNearbyWeek"; return DeliveryDatesEnum_V11thNearbyWeek+ `onFail` do isWord "12thNearbyWeek"; return DeliveryDatesEnum_V12thNearbyWeek+ `onFail` do isWord "13thNearbyWeek"; return DeliveryDatesEnum_V13thNearbyWeek+ `onFail` do isWord "14thNearbyWeek"; return DeliveryDatesEnum_V14thNearbyWeek+ `onFail` do isWord "15thNearbyWeek"; return DeliveryDatesEnum_V15thNearbyWeek+ `onFail` do isWord "16thNearbyWeek"; return DeliveryDatesEnum_V16thNearbyWeek+ `onFail` do isWord "17thNearbyWeek"; return DeliveryDatesEnum_V17thNearbyWeek+ `onFail` do isWord "18thNearbyWeek"; return DeliveryDatesEnum_V18thNearbyWeek+ `onFail` do isWord "19thNearbyWeek"; return DeliveryDatesEnum_V19thNearbyWeek+ `onFail` do isWord "20thNearbyWeek"; return DeliveryDatesEnum_V20thNearbyWeek+ `onFail` do isWord "21stNearbyWeek"; return DeliveryDatesEnum_V21stNearbyWeek+ `onFail` do isWord "22ndNearbyWeek"; return DeliveryDatesEnum_V22ndNearbyWeek+ `onFail` do isWord "23rdNearbyWeek"; return DeliveryDatesEnum_V23rdNearbyWeek+ `onFail` do isWord "24thNearbyWeek"; return DeliveryDatesEnum_V24thNearbyWeek+ `onFail` do isWord "25thNearbyWeek"; return DeliveryDatesEnum_V25thNearbyWeek+ `onFail` do isWord "26thNearbyWeek"; return DeliveryDatesEnum_V26thNearbyWeek+ `onFail` do isWord "27thNearbyWeek"; return DeliveryDatesEnum_V27thNearbyWeek+ `onFail` do isWord "28thNearbyWeek"; return DeliveryDatesEnum_V28thNearbyWeek+ `onFail` do isWord "29thNearbyWeek"; return DeliveryDatesEnum_V29thNearbyWeek+ `onFail` do isWord "30thNearbyWeek"; return DeliveryDatesEnum_V30thNearbyWeek+ `onFail` do isWord "31stNearbyWeek"; return DeliveryDatesEnum_V31stNearbyWeek+ `onFail` do isWord "32ndNearbyWeek"; return DeliveryDatesEnum_V32ndNearbyWeek+ `onFail` do isWord "33rdNearbyWeek"; return DeliveryDatesEnum_V33rdNearbyWeek+ `onFail` do isWord "34thNearbyWeek"; return DeliveryDatesEnum_V34thNearbyWeek+ `onFail` do isWord "35thNearbyWeek"; return DeliveryDatesEnum_V35thNearbyWeek+ `onFail` do isWord "36thNearbyWeek"; return DeliveryDatesEnum_V36thNearbyWeek+ `onFail` do isWord "37thNearbyWeek"; return DeliveryDatesEnum_V37thNearbyWeek+ `onFail` do isWord "38thNearbyWeek"; return DeliveryDatesEnum_V38thNearbyWeek+ `onFail` do isWord "39thNearbyWeek"; return DeliveryDatesEnum_V39thNearbyWeek+ `onFail` do isWord "40thNearbyWeek"; return DeliveryDatesEnum_V40thNearbyWeek+ `onFail` do isWord "41stNearbyWeek"; return DeliveryDatesEnum_V41stNearbyWeek+ `onFail` do isWord "42ndNearbyWeek"; return DeliveryDatesEnum_V42ndNearbyWeek+ `onFail` do isWord "43rdNearbyWeek"; return DeliveryDatesEnum_V43rdNearbyWeek+ `onFail` do isWord "44thNearbyWeek"; return DeliveryDatesEnum_V44thNearbyWeek+ `onFail` do isWord "45thNearbyWeek"; return DeliveryDatesEnum_V45thNearbyWeek+ `onFail` do isWord "46thNearbyWeek"; return DeliveryDatesEnum_V46thNearbyWeek+ `onFail` do isWord "47thNearbyWeek"; return DeliveryDatesEnum_V47thNearbyWeek+ `onFail` do isWord "48thNearbyWeek"; return DeliveryDatesEnum_V48thNearbyWeek+ `onFail` do isWord "49thNearbyWeek"; return DeliveryDatesEnum_V49thNearbyWeek+ `onFail` do isWord "50thNearbyWeek"; return DeliveryDatesEnum_V50thNearbyWeek+ `onFail` do isWord "51stNearbyWeek"; return DeliveryDatesEnum_V51stNearbyWeek+ `onFail` do isWord "52ndNearbyWeek"; return DeliveryDatesEnum_V52ndNearbyWeek+ + simpleTypeText DeliveryDatesEnum_CalculationPeriod = "CalculationPeriod"+ simpleTypeText DeliveryDatesEnum_FirstNearby = "FirstNearby"+ simpleTypeText DeliveryDatesEnum_SecondNearby = "SecondNearby"+ simpleTypeText DeliveryDatesEnum_ThirdNearby = "ThirdNearby"+ simpleTypeText DeliveryDatesEnum_FourthNearby = "FourthNearby"+ simpleTypeText DeliveryDatesEnum_FifthNearby = "FifthNearby"+ simpleTypeText DeliveryDatesEnum_SixthNearby = "SixthNearby"+ simpleTypeText DeliveryDatesEnum_SeventhNearby = "SeventhNearby"+ simpleTypeText DeliveryDatesEnum_EighthNearby = "EighthNearby"+ simpleTypeText DeliveryDatesEnum_NinthNearby = "NinthNearby"+ simpleTypeText DeliveryDatesEnum_TenthNearby = "TenthNearby"+ simpleTypeText DeliveryDatesEnum_EleventhNearby = "EleventhNearby"+ simpleTypeText DeliveryDatesEnum_TwelfthNearby = "TwelfthNearby"+ simpleTypeText DeliveryDatesEnum_ThirteenthNearby = "ThirteenthNearby"+ simpleTypeText DeliveryDatesEnum_FourteenthNearby = "FourteenthNearby"+ simpleTypeText DeliveryDatesEnum_Spot = "Spot"+ simpleTypeText DeliveryDatesEnum_V1stNearbyWeek = "1stNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V2ndNearbyWeek = "2ndNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V3rdNearbyWeek = "3rdNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V4thNearbyWeek = "4thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V5thNearbyWeek = "5thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V6thNearbyWeek = "6thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V7thNearbyWeek = "7thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V8thNearbyWeek = "8thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V9thNearbyWeek = "9thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V10thNearbyWeek = "10thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V11thNearbyWeek = "11thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V12thNearbyWeek = "12thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V13thNearbyWeek = "13thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V14thNearbyWeek = "14thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V15thNearbyWeek = "15thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V16thNearbyWeek = "16thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V17thNearbyWeek = "17thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V18thNearbyWeek = "18thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V19thNearbyWeek = "19thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V20thNearbyWeek = "20thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V21stNearbyWeek = "21stNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V22ndNearbyWeek = "22ndNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V23rdNearbyWeek = "23rdNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V24thNearbyWeek = "24thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V25thNearbyWeek = "25thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V26thNearbyWeek = "26thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V27thNearbyWeek = "27thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V28thNearbyWeek = "28thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V29thNearbyWeek = "29thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V30thNearbyWeek = "30thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V31stNearbyWeek = "31stNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V32ndNearbyWeek = "32ndNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V33rdNearbyWeek = "33rdNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V34thNearbyWeek = "34thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V35thNearbyWeek = "35thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V36thNearbyWeek = "36thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V37thNearbyWeek = "37thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V38thNearbyWeek = "38thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V39thNearbyWeek = "39thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V40thNearbyWeek = "40thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V41stNearbyWeek = "41stNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V42ndNearbyWeek = "42ndNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V43rdNearbyWeek = "43rdNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V44thNearbyWeek = "44thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V45thNearbyWeek = "45thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V46thNearbyWeek = "46thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V47thNearbyWeek = "47thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V48thNearbyWeek = "48thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V49thNearbyWeek = "49thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V50thNearbyWeek = "50thNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V51stNearbyWeek = "51stNearbyWeek"+ simpleTypeText DeliveryDatesEnum_V52ndNearbyWeek = "52ndNearbyWeek"+ +data DeliveryTypeEnum+ = DeliveryTypeEnum_Firm+ | DeliveryTypeEnum_Interruptible+ deriving (Eq,Show,Enum)+instance SchemaType DeliveryTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DeliveryTypeEnum where+ acceptingParser = do isWord "Firm"; return DeliveryTypeEnum_Firm+ `onFail` do isWord "Interruptible"; return DeliveryTypeEnum_Interruptible+ + simpleTypeText DeliveryTypeEnum_Firm = "Firm"+ simpleTypeText DeliveryTypeEnum_Interruptible = "Interruptible"+ +-- | The ISDA defined value indicating the severity of a +-- difference.+data DifferenceSeverityEnum+ = DifferenceSeverityEnum_Warning+ | DifferenceSeverityEnum_Error+ deriving (Eq,Show,Enum)+instance SchemaType DifferenceSeverityEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DifferenceSeverityEnum where+ acceptingParser = do isWord "Warning"; return DifferenceSeverityEnum_Warning+ `onFail` do isWord "Error"; return DifferenceSeverityEnum_Error+ + simpleTypeText DifferenceSeverityEnum_Warning = "Warning"+ simpleTypeText DifferenceSeverityEnum_Error = "Error"+ +-- | The ISDA defined value indicating the nature of a +-- difference.+data DifferenceTypeEnum+ = DifferenceTypeEnum_Value+ | DifferenceTypeEnum_Reference+ | DifferenceTypeEnum_Structure+ | DifferenceTypeEnum_Scheme+ deriving (Eq,Show,Enum)+instance SchemaType DifferenceTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DifferenceTypeEnum where+ acceptingParser = do isWord "Value"; return DifferenceTypeEnum_Value+ `onFail` do isWord "Reference"; return DifferenceTypeEnum_Reference+ `onFail` do isWord "Structure"; return DifferenceTypeEnum_Structure+ `onFail` do isWord "Scheme"; return DifferenceTypeEnum_Scheme+ + simpleTypeText DifferenceTypeEnum_Value = "Value"+ simpleTypeText DifferenceTypeEnum_Reference = "Reference"+ simpleTypeText DifferenceTypeEnum_Structure = "Structure"+ simpleTypeText DifferenceTypeEnum_Scheme = "Scheme"+ +-- | The method of calculating discounted payment amounts+data DiscountingTypeEnum+ = DiscountingTypeEnum_Standard+ -- ^ Per ISDA 2000 Definitions, Section 8.4. Discounting, + -- paragraph (a)+ | DiscountingTypeEnum_FRA+ -- ^ Per ISDA 2000 Definitions, Section 8.4. Discounting, + -- paragraph (b)+ deriving (Eq,Show,Enum)+instance SchemaType DiscountingTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DiscountingTypeEnum where+ acceptingParser = do isWord "Standard"; return DiscountingTypeEnum_Standard+ `onFail` do isWord "FRA"; return DiscountingTypeEnum_FRA+ + simpleTypeText DiscountingTypeEnum_Standard = "Standard"+ simpleTypeText DiscountingTypeEnum_FRA = "FRA"+ +-- | The specification of how disruption fallbacks will be +-- represented.+data DisruptionFallbacksEnum+ = DisruptionFallbacksEnum_AsSpecifiedInMasterAgreement+ -- ^ The Disruption Fallback(s) are determined by reference to + -- the relevant Master Agreement.+ | DisruptionFallbacksEnum_AsSpecifiedInConfirmation+ -- ^ The Disruption Fallback(s) are determined by reference to + -- the relevant Confirmation.+ deriving (Eq,Show,Enum)+instance SchemaType DisruptionFallbacksEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DisruptionFallbacksEnum where+ acceptingParser = do isWord "AsSpecifiedInMasterAgreement"; return DisruptionFallbacksEnum_AsSpecifiedInMasterAgreement+ `onFail` do isWord "AsSpecifiedInConfirmation"; return DisruptionFallbacksEnum_AsSpecifiedInConfirmation+ + simpleTypeText DisruptionFallbacksEnum_AsSpecifiedInMasterAgreement = "AsSpecifiedInMasterAgreement"+ simpleTypeText DisruptionFallbacksEnum_AsSpecifiedInConfirmation = "AsSpecifiedInConfirmation"+ +-- | Refers to one on the 3 Amounts+data DividendAmountTypeEnum+ = DividendAmountTypeEnum_RecordAmount+ -- ^ 100% of the gross cash dividend per Share paid over record + -- date during relevant Dividend Period+ | DividendAmountTypeEnum_ExAmount+ -- ^ 100% of gross cash dividend per Share paid after the Ex Div + -- date during relevant Dividend Period.+ | DividendAmountTypeEnum_PaidAmount+ -- ^ 100% of gross cash dividend per Share paid during relevant + -- Dividend Period.+ | DividendAmountTypeEnum_AsSpecifiedInMasterConfirmation+ -- ^ The Amount is determined as provided in the relevant Master + -- Confirmation.+ deriving (Eq,Show,Enum)+instance SchemaType DividendAmountTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DividendAmountTypeEnum where+ acceptingParser = do isWord "RecordAmount"; return DividendAmountTypeEnum_RecordAmount+ `onFail` do isWord "ExAmount"; return DividendAmountTypeEnum_ExAmount+ `onFail` do isWord "PaidAmount"; return DividendAmountTypeEnum_PaidAmount+ `onFail` do isWord "AsSpecifiedInMasterConfirmation"; return DividendAmountTypeEnum_AsSpecifiedInMasterConfirmation+ + simpleTypeText DividendAmountTypeEnum_RecordAmount = "RecordAmount"+ simpleTypeText DividendAmountTypeEnum_ExAmount = "ExAmount"+ simpleTypeText DividendAmountTypeEnum_PaidAmount = "PaidAmount"+ simpleTypeText DividendAmountTypeEnum_AsSpecifiedInMasterConfirmation = "AsSpecifiedInMasterConfirmation"+ +-- | Defines how the composition of dividends is to be +-- determined.+data DividendCompositionEnum+ = DividendCompositionEnum_EquityAmountReceiverElection+ -- ^ The Equity Amount Receiver determines the composition of + -- dividends (subject to conditions).+ | DividendCompositionEnum_CalculationAgentElection+ -- ^ The Calculation Agent determines the composition of + -- dividends (subject to conditions).+ deriving (Eq,Show,Enum)+instance SchemaType DividendCompositionEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DividendCompositionEnum where+ acceptingParser = do isWord "EquityAmountReceiverElection"; return DividendCompositionEnum_EquityAmountReceiverElection+ `onFail` do isWord "CalculationAgentElection"; return DividendCompositionEnum_CalculationAgentElection+ + simpleTypeText DividendCompositionEnum_EquityAmountReceiverElection = "EquityAmountReceiverElection"+ simpleTypeText DividendCompositionEnum_CalculationAgentElection = "CalculationAgentElection"+ +-- | The reference to a dividend date.+data DividendDateReferenceEnum+ = DividendDateReferenceEnum_ExDate+ -- ^ Date on which a holder of the security is entitled to the + -- dividend.+ | DividendDateReferenceEnum_DividendPaymentDate+ -- ^ Date on which the dividend will be paid by the issuer.+ | DividendDateReferenceEnum_DividendValuationDate+ -- ^ In respect of each Dividend Period, number of days offset + -- from the relevant Dividend Valuation Date.+ | DividendDateReferenceEnum_RecordDate+ -- ^ Date on which the dividend will be recorded in the books of + -- the paying agent.+ | DividendDateReferenceEnum_TerminationDate+ -- ^ Termination date of the swap.+ | DividendDateReferenceEnum_EquityPaymentDate+ -- ^ Equity payment date of the swap.+ | DividendDateReferenceEnum_FollowingPaymentDate+ -- ^ The next payment date of the swap.+ | DividendDateReferenceEnum_AdHocDate+ -- ^ The dividend date will be specified ad hoc by the parties, + -- typically on the dividend ex-date+ | DividendDateReferenceEnum_CumulativeEquityPaid+ -- ^ Total of paid dividends, paid on next following Cash + -- Settlement Payment Date, which is immediately following the + -- Dividend Period during which the dividend is paid by the + -- Issuer to the holders of record of a Share.+ | DividendDateReferenceEnum_CumulativeLiborPaid+ -- ^ Total of paid dividends, paid on next following Payment + -- Date, which is immediately following the Dividend Period + -- during which the dividend is paid by the Issuer to the + -- holders of record of a Share.+ | DividendDateReferenceEnum_CumulativeEquityExDiv+ -- ^ Total of dividends which go ex, paid on next following Cash + -- Settlement Payment Date, which is immediately following the + -- Dividend Period during which the Shares commence trading + -- ex-dividend on the Exchange+ | DividendDateReferenceEnum_CumulativeLiborExDiv+ -- ^ Total of dividends which go ex, paid on next following + -- Payment Date, which is immediately following the Dividend + -- Period during which the Shares commence trading ex-dividend + -- on the Exchange, or where the date on which the Shares + -- commence trading ex-dividend is a Payment Date, such + -- Payment Date.+ | DividendDateReferenceEnum_SharePayment+ -- ^ If "Dividend Payment Date(s)" is specified in the + -- Transaction Supplement as "Share Payment", then the + -- Dividend Payment Date in respect of a Dividend Amount shall + -- fall on a date on or before the date that is two (or any + -- other number that is specified in the Transaction + -- Supplement) Currency Business Days following the day on + -- which the Issuer of the Shares pays the relevant dividend + -- to holders of record of the Shares+ | DividendDateReferenceEnum_CashSettlementPaymentDate+ -- ^ If "Dividend Payment Date(s)" is specified in the + -- Transaction Supplement as "Cash Settlement Payment Date", + -- then the Dividend Payment Date in respect of a Dividend + -- Amount shall be the Cash Settlement Payment Date relating + -- to the end of the Dividend Period during which the Shares + -- commenced trading "ex" the relevant dividend on the + -- Exchange+ | DividendDateReferenceEnum_FloatingAmountPaymentDate+ -- ^ If "Dividend Payment Date(s)" is specified in the + -- Transaction Supplement as "Floating Amount Payment Date", + -- then the Dividend Payment Date in respect of a Dividend + -- Amount shall be the first Payment Date falling at least one + -- Settlement Cycle after the date that the Shares have + -- commenced trading "ex" the relevant dividend on the + -- Exchange.+ | DividendDateReferenceEnum_CashSettlePaymentDateExDiv+ -- ^ If "Dividend Payment Date(s)" is specified in the + -- Transaction Supplement as "Cash Settlement Payment Date – + -- Ex Dividend", then the Dividend Payment Date in respect of + -- a Dividend Amount shall be the Cash Settlement Payment Date + -- relating to the end of the Dividend Period during which the + -- Shares commenced trading “ex” the relevant dividend on + -- the Exchange.+ | DividendDateReferenceEnum_CashSettlePaymentDateIssuerPayment+ -- ^ If "Dividend Payment Date(s)" is specified in the + -- Transaction Supplement as "Cash Settlement Payment Date – + -- Issuer Payment", then the Dividend Payment Date in respect + -- of a Dividend Amount shall be the Cash Settlement Payment + -- Date relating to the end of the Dividend Period during + -- which the issuer pays the relevant dividend to a holder of + -- record provided that in the case where the Equity Amount + -- Payer is the party specified to be the sole Hedging Party + -- and the Hedging Party has not received the Dividend Amount + -- by such date, then the date falling a number of Currency + -- Business Days as specified in the Cash Settlement Payment + -- Date after actual receipt by the Hedging Party of the + -- Received Ex Amount or Paid Ex Amount (as applicable).+ | DividendDateReferenceEnum_ExDividendPaymentDate+ -- ^ If "Dividend Payment Date(s)" is specified in the + -- Transaction Supplement as "Ex-dividend Payment Date", then + -- the Dividend Payment Date in respect of a Dividend Amount + -- shall be the number of Currency Business Days as provided + -- in the Transaction Supplement following the day on which + -- the Shares commence trading ‘ex’ on the Exchange.+ deriving (Eq,Show,Enum)+instance SchemaType DividendDateReferenceEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DividendDateReferenceEnum where+ acceptingParser = do isWord "ExDate"; return DividendDateReferenceEnum_ExDate+ `onFail` do isWord "DividendPaymentDate"; return DividendDateReferenceEnum_DividendPaymentDate+ `onFail` do isWord "DividendValuationDate"; return DividendDateReferenceEnum_DividendValuationDate+ `onFail` do isWord "RecordDate"; return DividendDateReferenceEnum_RecordDate+ `onFail` do isWord "TerminationDate"; return DividendDateReferenceEnum_TerminationDate+ `onFail` do isWord "EquityPaymentDate"; return DividendDateReferenceEnum_EquityPaymentDate+ `onFail` do isWord "FollowingPaymentDate"; return DividendDateReferenceEnum_FollowingPaymentDate+ `onFail` do isWord "AdHocDate"; return DividendDateReferenceEnum_AdHocDate+ `onFail` do isWord "CumulativeEquityPaid"; return DividendDateReferenceEnum_CumulativeEquityPaid+ `onFail` do isWord "CumulativeLiborPaid"; return DividendDateReferenceEnum_CumulativeLiborPaid+ `onFail` do isWord "CumulativeEquityExDiv"; return DividendDateReferenceEnum_CumulativeEquityExDiv+ `onFail` do isWord "CumulativeLiborExDiv"; return DividendDateReferenceEnum_CumulativeLiborExDiv+ `onFail` do isWord "SharePayment"; return DividendDateReferenceEnum_SharePayment+ `onFail` do isWord "CashSettlementPaymentDate"; return DividendDateReferenceEnum_CashSettlementPaymentDate+ `onFail` do isWord "FloatingAmountPaymentDate"; return DividendDateReferenceEnum_FloatingAmountPaymentDate+ `onFail` do isWord "CashSettlePaymentDateExDiv"; return DividendDateReferenceEnum_CashSettlePaymentDateExDiv+ `onFail` do isWord "CashSettlePaymentDateIssuerPayment"; return DividendDateReferenceEnum_CashSettlePaymentDateIssuerPayment+ `onFail` do isWord "ExDividendPaymentDate"; return DividendDateReferenceEnum_ExDividendPaymentDate+ + simpleTypeText DividendDateReferenceEnum_ExDate = "ExDate"+ simpleTypeText DividendDateReferenceEnum_DividendPaymentDate = "DividendPaymentDate"+ simpleTypeText DividendDateReferenceEnum_DividendValuationDate = "DividendValuationDate"+ simpleTypeText DividendDateReferenceEnum_RecordDate = "RecordDate"+ simpleTypeText DividendDateReferenceEnum_TerminationDate = "TerminationDate"+ simpleTypeText DividendDateReferenceEnum_EquityPaymentDate = "EquityPaymentDate"+ simpleTypeText DividendDateReferenceEnum_FollowingPaymentDate = "FollowingPaymentDate"+ simpleTypeText DividendDateReferenceEnum_AdHocDate = "AdHocDate"+ simpleTypeText DividendDateReferenceEnum_CumulativeEquityPaid = "CumulativeEquityPaid"+ simpleTypeText DividendDateReferenceEnum_CumulativeLiborPaid = "CumulativeLiborPaid"+ simpleTypeText DividendDateReferenceEnum_CumulativeEquityExDiv = "CumulativeEquityExDiv"+ simpleTypeText DividendDateReferenceEnum_CumulativeLiborExDiv = "CumulativeLiborExDiv"+ simpleTypeText DividendDateReferenceEnum_SharePayment = "SharePayment"+ simpleTypeText DividendDateReferenceEnum_CashSettlementPaymentDate = "CashSettlementPaymentDate"+ simpleTypeText DividendDateReferenceEnum_FloatingAmountPaymentDate = "FloatingAmountPaymentDate"+ simpleTypeText DividendDateReferenceEnum_CashSettlePaymentDateExDiv = "CashSettlePaymentDateExDiv"+ simpleTypeText DividendDateReferenceEnum_CashSettlePaymentDateIssuerPayment = "CashSettlePaymentDateIssuerPayment"+ simpleTypeText DividendDateReferenceEnum_ExDividendPaymentDate = "ExDividendPaymentDate"+ +-- | The date on which the receiver of the equity return is +-- entitled to the dividend.+data DividendEntitlementEnum+ = DividendEntitlementEnum_ExDate+ -- ^ Dividend entitlement is on the dividend ex-date.+ | DividendEntitlementEnum_RecordDate+ -- ^ Dividend entitlement is on the dividend record date.+ deriving (Eq,Show,Enum)+instance SchemaType DividendEntitlementEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DividendEntitlementEnum where+ acceptingParser = do isWord "ExDate"; return DividendEntitlementEnum_ExDate+ `onFail` do isWord "RecordDate"; return DividendEntitlementEnum_RecordDate+ + simpleTypeText DividendEntitlementEnum_ExDate = "ExDate"+ simpleTypeText DividendEntitlementEnum_RecordDate = "RecordDate"+ +-- | Defines the First Period or the Second Period, as specified +-- in the 2002 ISDA Equity Derivatives Definitions.+data DividendPeriodEnum+ = DividendPeriodEnum_FirstPeriod+ -- ^ "First Period" per the 2002 ISDA Equity Derivatives + -- Definitions will apply.+ | DividendPeriodEnum_SecondPeriod+ -- ^ "Second Period" per the 2002 ISDA Equity Derivatives + -- Definitions will apply.+ deriving (Eq,Show,Enum)+instance SchemaType DividendPeriodEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DividendPeriodEnum where+ acceptingParser = do isWord "FirstPeriod"; return DividendPeriodEnum_FirstPeriod+ `onFail` do isWord "SecondPeriod"; return DividendPeriodEnum_SecondPeriod+ + simpleTypeText DividendPeriodEnum_FirstPeriod = "FirstPeriod"+ simpleTypeText DividendPeriodEnum_SecondPeriod = "SecondPeriod"+ +-- | A type which permits the Dual Currency strike quote basis +-- to be expressed in terms of the deposit and alternate +-- currencies.+data DualCurrencyStrikeQuoteBasisEnum+ = DualCurrencyStrikeQuoteBasisEnum_DepositCurrencyPerAlternateCurrency+ | DualCurrencyStrikeQuoteBasisEnum_AlternateCurrencyPerDepositCurrency+ deriving (Eq,Show,Enum)+instance SchemaType DualCurrencyStrikeQuoteBasisEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DualCurrencyStrikeQuoteBasisEnum where+ acceptingParser = do isWord "DepositCurrencyPerAlternateCurrency"; return DualCurrencyStrikeQuoteBasisEnum_DepositCurrencyPerAlternateCurrency+ `onFail` do isWord "AlternateCurrencyPerDepositCurrency"; return DualCurrencyStrikeQuoteBasisEnum_AlternateCurrencyPerDepositCurrency+ + simpleTypeText DualCurrencyStrikeQuoteBasisEnum_DepositCurrencyPerAlternateCurrency = "DepositCurrencyPerAlternateCurrency"+ simpleTypeText DualCurrencyStrikeQuoteBasisEnum_AlternateCurrencyPerDepositCurrency = "AlternateCurrencyPerDepositCurrency"+ +-- | The type of electricity product.+data ElectricityProductTypeEnum+ = ElectricityProductTypeEnum_Electricity+ deriving (Eq,Show,Enum)+instance SchemaType ElectricityProductTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType ElectricityProductTypeEnum where+ acceptingParser = do isWord "Electricity"; return ElectricityProductTypeEnum_Electricity+ + simpleTypeText ElectricityProductTypeEnum_Electricity = "Electricity"+ +-- | Specifies an additional Forward type.+data EquityOptionTypeEnum+ = EquityOptionTypeEnum_Put+ -- ^ A put option gives the holder the right to sell the + -- underlying asset by a certain date for a certain price.+ | EquityOptionTypeEnum_Call+ -- ^ A call option gives the holder the right to buy the + -- underlying asset by a certain date for a certain price.+ | EquityOptionTypeEnum_Forward+ -- ^ DEPRECATED value which will be removed in FpML-5-0 onwards + -- A forward contract is an agreement to buy or sell the + -- underlying asset at a certain future time for a certain + -- price.+ deriving (Eq,Show,Enum)+instance SchemaType EquityOptionTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType EquityOptionTypeEnum where+ acceptingParser = do isWord "Put"; return EquityOptionTypeEnum_Put+ `onFail` do isWord "Call"; return EquityOptionTypeEnum_Call+ `onFail` do isWord "Forward"; return EquityOptionTypeEnum_Forward+ + simpleTypeText EquityOptionTypeEnum_Put = "Put"+ simpleTypeText EquityOptionTypeEnum_Call = "Call"+ simpleTypeText EquityOptionTypeEnum_Forward = "Forward"+ +-- | The specification of how an OTC option will be exercised.+data ExerciseStyleEnum+ = ExerciseStyleEnum_American+ -- ^ Option can be exercised on any date up to the expiry date.+ | ExerciseStyleEnum_Bermuda+ -- ^ Option can be exercised on specified dates up to the expiry + -- date.+ | ExerciseStyleEnum_European+ -- ^ Option can only be exercised on the expiry date.+ deriving (Eq,Show,Enum)+instance SchemaType ExerciseStyleEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType ExerciseStyleEnum where+ acceptingParser = do isWord "American"; return ExerciseStyleEnum_American+ `onFail` do isWord "Bermuda"; return ExerciseStyleEnum_Bermuda+ `onFail` do isWord "European"; return ExerciseStyleEnum_European+ + simpleTypeText ExerciseStyleEnum_American = "American"+ simpleTypeText ExerciseStyleEnum_Bermuda = "Bermuda"+ simpleTypeText ExerciseStyleEnum_European = "European"+ +-- | Defines the fee type.+data FeeElectionEnum+ = FeeElectionEnum_FlatFee+ -- ^ The product of (i) the Break Fee Rate multiplied by (ii) + -- the Equity Notional Amount corresponding to the Early + -- Termination Portion.+ | FeeElectionEnum_AmortizedFee+ -- ^ The product of (i) the Break Fee Rate multiplied by (ii) + -- the Equity Notional Amount corresponding to the Early + -- Termination Portion multiplied by (iii) the number of days + -- from the Early Termination Date to the later of the + -- Termination Date or the Cash Settlement Payment Date + -- corresponding to the latest Valuation Date.+ | FeeElectionEnum_FundingFee+ -- ^ The product of (i) the Equity Notional Amount corresponding + -- to the Early Termination Portion multiplied by (ii) the + -- Break Funding Rate multiplied by (iii) the number of days + -- from the Early Termination Date to the next scheduled Reset + -- Date divided by (iv) a number equivalent to the denominator + -- of the Day Count Fraction applicable to the Floating Rate + -- Option.+ | FeeElectionEnum_FlatFeeAndFundingFee+ -- ^ Both Flat Fee and Funding Fee are applicable.+ | FeeElectionEnum_AmortizedFeeAndFundingFee+ -- ^ Amortized Fee and Funding Fee are applicable.+ deriving (Eq,Show,Enum)+instance SchemaType FeeElectionEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType FeeElectionEnum where+ acceptingParser = do isWord "FlatFee"; return FeeElectionEnum_FlatFee+ `onFail` do isWord "AmortizedFee"; return FeeElectionEnum_AmortizedFee+ `onFail` do isWord "FundingFee"; return FeeElectionEnum_FundingFee+ `onFail` do isWord "FlatFeeAndFundingFee"; return FeeElectionEnum_FlatFeeAndFundingFee+ `onFail` do isWord "AmortizedFeeAndFundingFee"; return FeeElectionEnum_AmortizedFeeAndFundingFee+ + simpleTypeText FeeElectionEnum_FlatFee = "FlatFee"+ simpleTypeText FeeElectionEnum_AmortizedFee = "AmortizedFee"+ simpleTypeText FeeElectionEnum_FundingFee = "FundingFee"+ simpleTypeText FeeElectionEnum_FlatFeeAndFundingFee = "FlatFeeAndFundingFee"+ simpleTypeText FeeElectionEnum_AmortizedFeeAndFundingFee = "AmortizedFeeAndFundingFee"+ +-- | The method by which the Flat Rate is calculated for a +-- commodity freight transaction.+data FlatRateEnum+ = FlatRateEnum_Fixed+ -- ^ The Flat Rate will be the New Worldwide Tanker Nominal + -- Freight Scale for the Freight Index Route for the Trade + -- Date for the transaction.+ | FlatRateEnum_Floating+ -- ^ The Flat Rate for each Pricing Date will be the New + -- Worldwide Tanker Nominal Freight Scale for the Freight + -- Index Route for the Pricing Date..+ deriving (Eq,Show,Enum)+instance SchemaType FlatRateEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType FlatRateEnum where+ acceptingParser = do isWord "Fixed"; return FlatRateEnum_Fixed+ `onFail` do isWord "Floating"; return FlatRateEnum_Floating+ + simpleTypeText FlatRateEnum_Fixed = "Fixed"+ simpleTypeText FlatRateEnum_Floating = "Floating"+ +-- | Specifies the fallback provisions in respect to the +-- applicable Futures Price Valuation.+data FPVFinalPriceElectionFallbackEnum+ = FPVFinalPriceElectionFallbackEnum_FPVClose+ -- ^ In respect of the Early Final Valuation Date, the + -- provisions for FPV Close shall apply.+ | FPVFinalPriceElectionFallbackEnum_FPVHedgeExecution+ -- ^ In respect of the Early Final Valuation Date, the + -- provisions for FPV Hedge Execution shall apply.+ deriving (Eq,Show,Enum)+instance SchemaType FPVFinalPriceElectionFallbackEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType FPVFinalPriceElectionFallbackEnum where+ acceptingParser = do isWord "FPVClose"; return FPVFinalPriceElectionFallbackEnum_FPVClose+ `onFail` do isWord "FPVHedgeExecution"; return FPVFinalPriceElectionFallbackEnum_FPVHedgeExecution+ + simpleTypeText FPVFinalPriceElectionFallbackEnum_FPVClose = "FPVClose"+ simpleTypeText FPVFinalPriceElectionFallbackEnum_FPVHedgeExecution = "FPVHedgeExecution"+ +-- | The method of FRA discounting, if any, that will apply.+data FraDiscountingEnum+ = FraDiscountingEnum_ISDA+ -- ^ "FRA Discounting" per the ISDA Definitions will apply.+ | FraDiscountingEnum_AFMA+ -- ^ FRA discounting per the Australian Financial Markets + -- Association (AFMA) OTC Financial Product Conventions will + -- apply.+ | FraDiscountingEnum_NONE+ -- ^ No discounting will apply.+ deriving (Eq,Show,Enum)+instance SchemaType FraDiscountingEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType FraDiscountingEnum where+ acceptingParser = do isWord "ISDA"; return FraDiscountingEnum_ISDA+ `onFail` do isWord "AFMA"; return FraDiscountingEnum_AFMA+ `onFail` do isWord "NONE"; return FraDiscountingEnum_NONE+ + simpleTypeText FraDiscountingEnum_ISDA = "ISDA"+ simpleTypeText FraDiscountingEnum_AFMA = "AFMA"+ simpleTypeText FraDiscountingEnum_NONE = "NONE"+ +-- | The schedule frequency type+data FrequencyTypeEnum+ = FrequencyTypeEnum_Day+ -- ^ Day is the unit of frequency.+ | FrequencyTypeEnum_Business+ -- ^ TBD+ deriving (Eq,Show,Enum)+instance SchemaType FrequencyTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType FrequencyTypeEnum where+ acceptingParser = do isWord "Day"; return FrequencyTypeEnum_Day+ `onFail` do isWord "Business"; return FrequencyTypeEnum_Business+ + simpleTypeText FrequencyTypeEnum_Day = "Day"+ simpleTypeText FrequencyTypeEnum_Business = "Business"+ +-- | The specification of whether a barrier within an FX OTC +-- option is a knockin or knockout, as well as whether it is a +-- standard barrier or a reverse barrier.+data FxBarrierTypeEnum+ = FxBarrierTypeEnum_Knockin+ -- ^ Option exists once the barrier is hit. The trigger rate is + -- out-of-the money in relation to the strike rate.+ | FxBarrierTypeEnum_Knockout+ -- ^ Option ceases to exist once the barrier is hit. The trigger + -- rate is out-of the-money in relation to the strike rate.+ | FxBarrierTypeEnum_ReverseKnockin+ -- ^ Option exists once the barrier is hit. The trigger rate is + -- in-the money in relation to the strike rate.+ | FxBarrierTypeEnum_ReverseKnockout+ -- ^ Option ceases to exist once the barrier is hit. The trigger + -- rate is in-the money in relation to the strike rate.+ deriving (Eq,Show,Enum)+instance SchemaType FxBarrierTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType FxBarrierTypeEnum where+ acceptingParser = do isWord "Knockin"; return FxBarrierTypeEnum_Knockin+ `onFail` do isWord "Knockout"; return FxBarrierTypeEnum_Knockout+ `onFail` do isWord "ReverseKnockin"; return FxBarrierTypeEnum_ReverseKnockin+ `onFail` do isWord "ReverseKnockout"; return FxBarrierTypeEnum_ReverseKnockout+ + simpleTypeText FxBarrierTypeEnum_Knockin = "Knockin"+ simpleTypeText FxBarrierTypeEnum_Knockout = "Knockout"+ simpleTypeText FxBarrierTypeEnum_ReverseKnockin = "ReverseKnockin"+ simpleTypeText FxBarrierTypeEnum_ReverseKnockout = "ReverseKnockout"+ +-- | The specification of a time period containing values such +-- as Today, Tomorrow etc.+data FxTenorPeriodEnum+ = FxTenorPeriodEnum_Broken+ -- ^ Broken/non conventional Tenor Period.+ | FxTenorPeriodEnum_Today+ -- ^ Today Tenor Period.+ | FxTenorPeriodEnum_Tomorrow+ -- ^ Tomorrow Tenor Period.+ | FxTenorPeriodEnum_TomorrowNext+ -- ^ Day after Tomorrow Tenor Period.+ | FxTenorPeriodEnum_Spot+ -- ^ Spot Tenor Period.+ | FxTenorPeriodEnum_SpotNext+ -- ^ Day after Spot Tenor period.+ deriving (Eq,Show,Enum)+instance SchemaType FxTenorPeriodEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType FxTenorPeriodEnum where+ acceptingParser = do isWord "Broken"; return FxTenorPeriodEnum_Broken+ `onFail` do isWord "Today"; return FxTenorPeriodEnum_Today+ `onFail` do isWord "Tomorrow"; return FxTenorPeriodEnum_Tomorrow+ `onFail` do isWord "TomorrowNext"; return FxTenorPeriodEnum_TomorrowNext+ `onFail` do isWord "Spot"; return FxTenorPeriodEnum_Spot+ `onFail` do isWord "SpotNext"; return FxTenorPeriodEnum_SpotNext+ + simpleTypeText FxTenorPeriodEnum_Broken = "Broken"+ simpleTypeText FxTenorPeriodEnum_Today = "Today"+ simpleTypeText FxTenorPeriodEnum_Tomorrow = "Tomorrow"+ simpleTypeText FxTenorPeriodEnum_TomorrowNext = "TomorrowNext"+ simpleTypeText FxTenorPeriodEnum_Spot = "Spot"+ simpleTypeText FxTenorPeriodEnum_SpotNext = "SpotNext"+ +-- | The type of gas product.+data GasProductTypeEnum+ = GasProductTypeEnum_NaturalGas+ deriving (Eq,Show,Enum)+instance SchemaType GasProductTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType GasProductTypeEnum where+ acceptingParser = do isWord "NaturalGas"; return GasProductTypeEnum_NaturalGas+ + simpleTypeText GasProductTypeEnum_NaturalGas = "NaturalGas"+ +-- | The type of independent amount convention.+data IndependentAmountConventionEnum+ = IndependentAmountConventionEnum_NettedAfterThreshold+ | IndependentAmountConventionEnum_NettedBeforeThreshold+ | IndependentAmountConventionEnum_Segregated+ deriving (Eq,Show,Enum)+instance SchemaType IndependentAmountConventionEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType IndependentAmountConventionEnum where+ acceptingParser = do isWord "NettedAfterThreshold"; return IndependentAmountConventionEnum_NettedAfterThreshold+ `onFail` do isWord "NettedBeforeThreshold"; return IndependentAmountConventionEnum_NettedBeforeThreshold+ `onFail` do isWord "Segregated"; return IndependentAmountConventionEnum_Segregated+ + simpleTypeText IndependentAmountConventionEnum_NettedAfterThreshold = "NettedAfterThreshold"+ simpleTypeText IndependentAmountConventionEnum_NettedBeforeThreshold = "NettedBeforeThreshold"+ simpleTypeText IndependentAmountConventionEnum_Segregated = "Segregated"+ +-- | The specification of the consequences of Index Events.+data IndexEventConsequenceEnum+ = IndexEventConsequenceEnum_CalculationAgentAdjustment+ -- ^ Calculation Agent Adjustment+ | IndexEventConsequenceEnum_NegotiatedCloseOut+ -- ^ Negotiated Close Out+ | IndexEventConsequenceEnum_CancellationAndPayment+ -- ^ Cancellation and Payment+ | IndexEventConsequenceEnum_RelatedExchange+ -- ^ Related Exchange Adjustment+ deriving (Eq,Show,Enum)+instance SchemaType IndexEventConsequenceEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType IndexEventConsequenceEnum where+ acceptingParser = do isWord "CalculationAgentAdjustment"; return IndexEventConsequenceEnum_CalculationAgentAdjustment+ `onFail` do isWord "NegotiatedCloseOut"; return IndexEventConsequenceEnum_NegotiatedCloseOut+ `onFail` do isWord "CancellationAndPayment"; return IndexEventConsequenceEnum_CancellationAndPayment+ `onFail` do isWord "RelatedExchange"; return IndexEventConsequenceEnum_RelatedExchange+ + simpleTypeText IndexEventConsequenceEnum_CalculationAgentAdjustment = "CalculationAgentAdjustment"+ simpleTypeText IndexEventConsequenceEnum_NegotiatedCloseOut = "NegotiatedCloseOut"+ simpleTypeText IndexEventConsequenceEnum_CancellationAndPayment = "CancellationAndPayment"+ simpleTypeText IndexEventConsequenceEnum_RelatedExchange = "RelatedExchange"+ +-- | >Defines whether agent bank is making an interest +-- payment based on the lender pro-rata share at the end of +-- the period or based on the lender position throughout the +-- period. Agent Banks decide which way to calculate the +-- interest for a deal.+data InterestCalculationMethodEnum+ = InterestCalculationMethodEnum_ProRataShare+ -- ^ Agent bank is making an interest payment based on the + -- lender pro-rata share.+ | InterestCalculationMethodEnum_FacilityPosition+ -- ^ Agent bank is making an interest payment based on the + -- lender position throughout the period.+ deriving (Eq,Show,Enum)+instance SchemaType InterestCalculationMethodEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType InterestCalculationMethodEnum where+ acceptingParser = do isWord "ProRataShare"; return InterestCalculationMethodEnum_ProRataShare+ `onFail` do isWord "FacilityPosition"; return InterestCalculationMethodEnum_FacilityPosition+ + simpleTypeText InterestCalculationMethodEnum_ProRataShare = "ProRataShare"+ simpleTypeText InterestCalculationMethodEnum_FacilityPosition = "FacilityPosition"+ +-- | The type of calculation.+data InterestCalculationTypeEnum+ = InterestCalculationTypeEnum_Simple+ | InterestCalculationTypeEnum_Compounding+ deriving (Eq,Show,Enum)+instance SchemaType InterestCalculationTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType InterestCalculationTypeEnum where+ acceptingParser = do isWord "Simple"; return InterestCalculationTypeEnum_Simple+ `onFail` do isWord "Compounding"; return InterestCalculationTypeEnum_Compounding+ + simpleTypeText InterestCalculationTypeEnum_Simple = "Simple"+ simpleTypeText InterestCalculationTypeEnum_Compounding = "Compounding"+ +-- | The type of method.+data InterestMethodEnum+ = InterestMethodEnum_PhysicalSettlement+ | InterestMethodEnum_RollIn+ deriving (Eq,Show,Enum)+instance SchemaType InterestMethodEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType InterestMethodEnum where+ acceptingParser = do isWord "PhysicalSettlement"; return InterestMethodEnum_PhysicalSettlement+ `onFail` do isWord "RollIn"; return InterestMethodEnum_RollIn+ + simpleTypeText InterestMethodEnum_PhysicalSettlement = "PhysicalSettlement"+ simpleTypeText InterestMethodEnum_RollIn = "RollIn"+ +-- | The specification of the interest shortfall cap, applicable +-- to mortgage derivatives.+data InterestShortfallCapEnum+ = InterestShortfallCapEnum_Fixed+ | InterestShortfallCapEnum_Variable+ deriving (Eq,Show,Enum)+instance SchemaType InterestShortfallCapEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType InterestShortfallCapEnum where+ acceptingParser = do isWord "Fixed"; return InterestShortfallCapEnum_Fixed+ `onFail` do isWord "Variable"; return InterestShortfallCapEnum_Variable+ + simpleTypeText InterestShortfallCapEnum_Fixed = "Fixed"+ simpleTypeText InterestShortfallCapEnum_Variable = "Variable"+ +-- | Defines applicable periods for interpolation.+data InterpolationPeriodEnum+ = InterpolationPeriodEnum_Initial+ -- ^ Interpolation is applicable to the initial period only.+ | InterpolationPeriodEnum_InitialAndFinal+ -- ^ Interpolation is applicable to the initial and final + -- periods only.+ | InterpolationPeriodEnum_Final+ -- ^ Interpolation is applicable to the final period only.+ | InterpolationPeriodEnum_AnyPeriod+ -- ^ Interpolation is applicable to any non-standard period.+ deriving (Eq,Show,Enum)+instance SchemaType InterpolationPeriodEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType InterpolationPeriodEnum where+ acceptingParser = do isWord "Initial"; return InterpolationPeriodEnum_Initial+ `onFail` do isWord "InitialAndFinal"; return InterpolationPeriodEnum_InitialAndFinal+ `onFail` do isWord "Final"; return InterpolationPeriodEnum_Final+ `onFail` do isWord "AnyPeriod"; return InterpolationPeriodEnum_AnyPeriod+ + simpleTypeText InterpolationPeriodEnum_Initial = "Initial"+ simpleTypeText InterpolationPeriodEnum_InitialAndFinal = "InitialAndFinal"+ simpleTypeText InterpolationPeriodEnum_Final = "Final"+ simpleTypeText InterpolationPeriodEnum_AnyPeriod = "AnyPeriod"+ +-- | Used for indicating the length unit in the Resource type.+data LengthUnitEnum+ = LengthUnitEnum_Pages+ | LengthUnitEnum_TimeUnit+ deriving (Eq,Show,Enum)+instance SchemaType LengthUnitEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType LengthUnitEnum where+ acceptingParser = do isWord "Pages"; return LengthUnitEnum_Pages+ `onFail` do isWord "TimeUnit"; return LengthUnitEnum_TimeUnit+ + simpleTypeText LengthUnitEnum_Pages = "Pages"+ simpleTypeText LengthUnitEnum_TimeUnit = "TimeUnit"+ +-- | The specification of how market disruption events will be +-- represented.+data MarketDisruptionEventsEnum+ = MarketDisruptionEventsEnum_Applicable+ -- ^ Market Disruption Events are applicable.+ | MarketDisruptionEventsEnum_NotApplicable+ -- ^ Market Disruption Events are not applicable.+ | MarketDisruptionEventsEnum_AsSpecifiedInMasterAgreement+ -- ^ The Market Disruption Event(s) are determined by reference + -- to the relevant Master Agreement.+ | MarketDisruptionEventsEnum_AsSpecifiedInConfirmation+ -- ^ The Market Disruption Event(s) are determined by reference + -- to the relevant Confirmation.+ deriving (Eq,Show,Enum)+instance SchemaType MarketDisruptionEventsEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType MarketDisruptionEventsEnum where+ acceptingParser = do isWord "Applicable"; return MarketDisruptionEventsEnum_Applicable+ `onFail` do isWord "NotApplicable"; return MarketDisruptionEventsEnum_NotApplicable+ `onFail` do isWord "AsSpecifiedInMasterAgreement"; return MarketDisruptionEventsEnum_AsSpecifiedInMasterAgreement+ `onFail` do isWord "AsSpecifiedInConfirmation"; return MarketDisruptionEventsEnum_AsSpecifiedInConfirmation+ + simpleTypeText MarketDisruptionEventsEnum_Applicable = "Applicable"+ simpleTypeText MarketDisruptionEventsEnum_NotApplicable = "NotApplicable"+ simpleTypeText MarketDisruptionEventsEnum_AsSpecifiedInMasterAgreement = "AsSpecifiedInMasterAgreement"+ simpleTypeText MarketDisruptionEventsEnum_AsSpecifiedInConfirmation = "AsSpecifiedInConfirmation"+ +-- | The type of mark to market convention.+data MarkToMarketConventionEnum+ = MarkToMarketConventionEnum_Gross+ | MarkToMarketConventionEnum_Netted+ deriving (Eq,Show,Enum)+instance SchemaType MarkToMarketConventionEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType MarkToMarketConventionEnum where+ acceptingParser = do isWord "Gross"; return MarkToMarketConventionEnum_Gross+ `onFail` do isWord "Netted"; return MarkToMarketConventionEnum_Netted+ + simpleTypeText MarkToMarketConventionEnum_Gross = "Gross"+ simpleTypeText MarkToMarketConventionEnum_Netted = "Netted"+ +-- | Defines how adjustments will be made to the contract should +-- one or more of the extraordinary events occur.+data MethodOfAdjustmentEnum+ = MethodOfAdjustmentEnum_CalculationAgent+ -- ^ The Calculation Agent has the right to adjust the terms of + -- the trade following a corporate action.+ | MethodOfAdjustmentEnum_OptionsExchange+ -- ^ The trade will be adjusted in accordance with any + -- adjustment made by the exchange on which options on the + -- underlying are listed.+ deriving (Eq,Show,Enum)+instance SchemaType MethodOfAdjustmentEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType MethodOfAdjustmentEnum where+ acceptingParser = do isWord "CalculationAgent"; return MethodOfAdjustmentEnum_CalculationAgent+ `onFail` do isWord "OptionsExchange"; return MethodOfAdjustmentEnum_OptionsExchange+ + simpleTypeText MethodOfAdjustmentEnum_CalculationAgent = "CalculationAgent"+ simpleTypeText MethodOfAdjustmentEnum_OptionsExchange = "OptionsExchange"+ +-- | Defines the consequences of nationalisation, insolvency and +-- delisting events relating to the underlying.+data NationalisationOrInsolvencyOrDelistingEventEnum+ = NationalisationOrInsolvencyOrDelistingEventEnum_NegotiatedCloseout+ -- ^ The parties may, but are not obliged, to terminate the + -- transaction on mutually acceptable terms and if the terms + -- are not agreed then the transaction continues.+ | NationalisationOrInsolvencyOrDelistingEventEnum_CancellationAndPayment+ -- ^ The trade is terminated.+ deriving (Eq,Show,Enum)+instance SchemaType NationalisationOrInsolvencyOrDelistingEventEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType NationalisationOrInsolvencyOrDelistingEventEnum where+ acceptingParser = do isWord "NegotiatedCloseout"; return NationalisationOrInsolvencyOrDelistingEventEnum_NegotiatedCloseout+ `onFail` do isWord "CancellationAndPayment"; return NationalisationOrInsolvencyOrDelistingEventEnum_CancellationAndPayment+ + simpleTypeText NationalisationOrInsolvencyOrDelistingEventEnum_NegotiatedCloseout = "NegotiatedCloseout"+ simpleTypeText NationalisationOrInsolvencyOrDelistingEventEnum_CancellationAndPayment = "CancellationAndPayment"+ +-- | The method of calculating payment obligations when a +-- floating rate is negative (either due to a quoted negative +-- floating rate or by operation of a spread that is +-- subtracted from the floating rate).+data NegativeInterestRateTreatmentEnum+ = NegativeInterestRateTreatmentEnum_NegativeInterestRateMethod+ -- ^ Negative Interest Rate Method. Per 2000 ISDA Definitions, + -- Section 6.4 Negative Interest Rates, paragraphs (b) and + -- (c).+ | NegativeInterestRateTreatmentEnum_ZeroInterestRateMethod+ -- ^ Zero Interest Rate Method. Per 2000 ISDA Definitions, + -- Section 6.4. Negative Interest Rates, paragraphs (d) and + -- (e).+ deriving (Eq,Show,Enum)+instance SchemaType NegativeInterestRateTreatmentEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType NegativeInterestRateTreatmentEnum where+ acceptingParser = do isWord "NegativeInterestRateMethod"; return NegativeInterestRateTreatmentEnum_NegativeInterestRateMethod+ `onFail` do isWord "ZeroInterestRateMethod"; return NegativeInterestRateTreatmentEnum_ZeroInterestRateMethod+ + simpleTypeText NegativeInterestRateTreatmentEnum_NegativeInterestRateMethod = "NegativeInterestRateMethod"+ simpleTypeText NegativeInterestRateTreatmentEnum_ZeroInterestRateMethod = "ZeroInterestRateMethod"+ +-- | Defines treatment of non-cash dividends.+data NonCashDividendTreatmentEnum+ = NonCashDividendTreatmentEnum_PotentialAdjustmentEvent+ -- ^ The treatment of any non-cash dividend shall be determined + -- in accordance with the Potential Adjustment Event + -- provisions.+ | NonCashDividendTreatmentEnum_CashEquivalent+ -- ^ Any non-cash dividend shall be treated as a Declared Cash + -- Equivalent Dividend.+ deriving (Eq,Show,Enum)+instance SchemaType NonCashDividendTreatmentEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType NonCashDividendTreatmentEnum where+ acceptingParser = do isWord "PotentialAdjustmentEvent"; return NonCashDividendTreatmentEnum_PotentialAdjustmentEvent+ `onFail` do isWord "CashEquivalent"; return NonCashDividendTreatmentEnum_CashEquivalent+ + simpleTypeText NonCashDividendTreatmentEnum_PotentialAdjustmentEvent = "PotentialAdjustmentEvent"+ simpleTypeText NonCashDividendTreatmentEnum_CashEquivalent = "CashEquivalent"+ +-- | The conditions that govern the adjustment to the number of +-- units of the equity swap.+data NotionalAdjustmentEnum+ = NotionalAdjustmentEnum_Execution+ -- ^ The adjustments to the number of units are governed by an + -- execution clause.+ | NotionalAdjustmentEnum_PortfolioRebalancing+ -- ^ The adjustments to the number of units are governed by a + -- portfolio rebalancing clause.+ | NotionalAdjustmentEnum_Standard+ -- ^ The adjustments to the number of units are not governed by + -- any specific clause.+ deriving (Eq,Show,Enum)+instance SchemaType NotionalAdjustmentEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType NotionalAdjustmentEnum where+ acceptingParser = do isWord "Execution"; return NotionalAdjustmentEnum_Execution+ `onFail` do isWord "PortfolioRebalancing"; return NotionalAdjustmentEnum_PortfolioRebalancing+ `onFail` do isWord "Standard"; return NotionalAdjustmentEnum_Standard+ + simpleTypeText NotionalAdjustmentEnum_Execution = "Execution"+ simpleTypeText NotionalAdjustmentEnum_PortfolioRebalancing = "PortfolioRebalancing"+ simpleTypeText NotionalAdjustmentEnum_Standard = "Standard"+ +-- | Used in both the obligations and deliverable obligations of +-- the credit default swap to represent a class or type of +-- securities which apply.+data ObligationCategoryEnum+ = ObligationCategoryEnum_Payment+ -- ^ ISDA term "Payment".+ | ObligationCategoryEnum_BorrowedMoney+ -- ^ ISDA term "Borrowed Money".+ | ObligationCategoryEnum_ReferenceObligationsOnly+ -- ^ ISDA term "Reference Obligations Only".+ | ObligationCategoryEnum_Bond+ -- ^ ISDA term "Bond".+ | ObligationCategoryEnum_Loan+ -- ^ ISDA term "Loan".+ | ObligationCategoryEnum_BondOrLoan+ -- ^ ISDA term "Bond or Loan".+ deriving (Eq,Show,Enum)+instance SchemaType ObligationCategoryEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType ObligationCategoryEnum where+ acceptingParser = do isWord "Payment"; return ObligationCategoryEnum_Payment+ `onFail` do isWord "BorrowedMoney"; return ObligationCategoryEnum_BorrowedMoney+ `onFail` do isWord "ReferenceObligationsOnly"; return ObligationCategoryEnum_ReferenceObligationsOnly+ `onFail` do isWord "Bond"; return ObligationCategoryEnum_Bond+ `onFail` do isWord "Loan"; return ObligationCategoryEnum_Loan+ `onFail` do isWord "BondOrLoan"; return ObligationCategoryEnum_BondOrLoan+ + simpleTypeText ObligationCategoryEnum_Payment = "Payment"+ simpleTypeText ObligationCategoryEnum_BorrowedMoney = "BorrowedMoney"+ simpleTypeText ObligationCategoryEnum_ReferenceObligationsOnly = "ReferenceObligationsOnly"+ simpleTypeText ObligationCategoryEnum_Bond = "Bond"+ simpleTypeText ObligationCategoryEnum_Loan = "Loan"+ simpleTypeText ObligationCategoryEnum_BondOrLoan = "BondOrLoan"+ +-- | Specifies the type of the option.+data OptionTypeEnum+ = OptionTypeEnum_Put+ -- ^ A put option gives the holder the right to sell the + -- underlying asset by a certain date for a certain price.+ | OptionTypeEnum_Call+ -- ^ A call option gives the holder the right to buy the + -- underlying asset by a certain date for a certain price.+ | OptionTypeEnum_Payer+ -- ^ A "payer" option: If you buy a "payer" option you have the + -- right but not the obligation to enter into the underlying + -- swap transaction as the "fixed" rate/price payer and + -- receive float.+ | OptionTypeEnum_Receiver+ -- ^ A receiver option: If you buy a "receiver" option you have + -- the right but not the obligation to enter into the + -- underlying swap transaction as the "fixed" rate/price + -- receiver and pay float.+ | OptionTypeEnum_Straddle+ -- ^ A straddle strategy.+ deriving (Eq,Show,Enum)+instance SchemaType OptionTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType OptionTypeEnum where+ acceptingParser = do isWord "Put"; return OptionTypeEnum_Put+ `onFail` do isWord "Call"; return OptionTypeEnum_Call+ `onFail` do isWord "Payer"; return OptionTypeEnum_Payer+ `onFail` do isWord "Receiver"; return OptionTypeEnum_Receiver+ `onFail` do isWord "Straddle"; return OptionTypeEnum_Straddle+ + simpleTypeText OptionTypeEnum_Put = "Put"+ simpleTypeText OptionTypeEnum_Call = "Call"+ simpleTypeText OptionTypeEnum_Payer = "Payer"+ simpleTypeText OptionTypeEnum_Receiver = "Receiver"+ simpleTypeText OptionTypeEnum_Straddle = "Straddle"+ +-- | The specification of an interest rate stream payer or +-- receiver party.+data PayerReceiverEnum+ = PayerReceiverEnum_Payer+ -- ^ The party identified as the stream payer.+ | PayerReceiverEnum_Receiver+ -- ^ The party identified as the stream receiver.+ deriving (Eq,Show,Enum)+instance SchemaType PayerReceiverEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType PayerReceiverEnum where+ acceptingParser = do isWord "Payer"; return PayerReceiverEnum_Payer+ `onFail` do isWord "Receiver"; return PayerReceiverEnum_Receiver+ + simpleTypeText PayerReceiverEnum_Payer = "Payer"+ simpleTypeText PayerReceiverEnum_Receiver = "Receiver"+ +-- | The specification of how an FX OTC option with a trigger +-- payout will be paid if the trigger condition is met. The +-- contract will specify whether the payout will occur +-- immediately or on the original value date of the option.+data PayoutEnum+ = PayoutEnum_Deferred+ -- ^ If the trigger is hit, the option payout will not be paid + -- now but will be paid on the value date of the original + -- option.+ | PayoutEnum_Immediate+ -- ^ If the trigger is hit, the option payout will be paid + -- immediately (i.e., spot from the payout date).+ deriving (Eq,Show,Enum)+instance SchemaType PayoutEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType PayoutEnum where+ acceptingParser = do isWord "Deferred"; return PayoutEnum_Deferred+ `onFail` do isWord "Immediate"; return PayoutEnum_Immediate+ + simpleTypeText PayoutEnum_Deferred = "Deferred"+ simpleTypeText PayoutEnum_Immediate = "Immediate"+ +-- | The specification of whether payments occur relative to the +-- calculation period start or end date, or the reset date.+data PayRelativeToEnum+ = PayRelativeToEnum_CalculationPeriodStartDate+ -- ^ Payments will occur relative to the first day of each + -- calculation period.+ | PayRelativeToEnum_CalculationPeriodEndDate+ -- ^ Payments will occur relative to the last day of each + -- calculation period.+ | PayRelativeToEnum_LastPricingDate+ -- ^ Payments will occur relative to the last Pricing Date of + -- each Calculation Period.+ | PayRelativeToEnum_ResetDate+ -- ^ Payments will occur relative to the reset date.+ | PayRelativeToEnum_ValuationDate+ -- ^ Payments will occur relative to the valuation date.+ deriving (Eq,Show,Enum)+instance SchemaType PayRelativeToEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType PayRelativeToEnum where+ acceptingParser = do isWord "CalculationPeriodStartDate"; return PayRelativeToEnum_CalculationPeriodStartDate+ `onFail` do isWord "CalculationPeriodEndDate"; return PayRelativeToEnum_CalculationPeriodEndDate+ `onFail` do isWord "LastPricingDate"; return PayRelativeToEnum_LastPricingDate+ `onFail` do isWord "ResetDate"; return PayRelativeToEnum_ResetDate+ `onFail` do isWord "ValuationDate"; return PayRelativeToEnum_ValuationDate+ + simpleTypeText PayRelativeToEnum_CalculationPeriodStartDate = "CalculationPeriodStartDate"+ simpleTypeText PayRelativeToEnum_CalculationPeriodEndDate = "CalculationPeriodEndDate"+ simpleTypeText PayRelativeToEnum_LastPricingDate = "LastPricingDate"+ simpleTypeText PayRelativeToEnum_ResetDate = "ResetDate"+ simpleTypeText PayRelativeToEnum_ValuationDate = "ValuationDate"+ +-- | The specification of a time period+data PeriodEnum+ = PeriodEnum_D+ -- ^ Day.+ | PeriodEnum_W+ -- ^ Week.+ | PeriodEnum_M+ -- ^ Month.+ | PeriodEnum_Y+ -- ^ Year.+ deriving (Eq,Show,Enum)+instance SchemaType PeriodEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType PeriodEnum where+ acceptingParser = do isWord "D"; return PeriodEnum_D+ `onFail` do isWord "W"; return PeriodEnum_W+ `onFail` do isWord "M"; return PeriodEnum_M+ `onFail` do isWord "Y"; return PeriodEnum_Y+ + simpleTypeText PeriodEnum_D = "D"+ simpleTypeText PeriodEnum_W = "W"+ simpleTypeText PeriodEnum_M = "M"+ simpleTypeText PeriodEnum_Y = "Y"+ +-- | The specification of a time period containing additional +-- values such as Term.+data PeriodExtendedEnum+ = PeriodExtendedEnum_D+ -- ^ Day.+ | PeriodExtendedEnum_W+ -- ^ Week.+ | PeriodExtendedEnum_M+ -- ^ Month.+ | PeriodExtendedEnum_Y+ -- ^ Year.+ | PeriodExtendedEnum_T+ -- ^ Term. The period commencing on the effective date and + -- ending on the termination date. The T period always appears + -- in association with periodMultiplier = 1, and the notation + -- is intended for use in contexts where the interval thus + -- qualified (e.g. accrual period, payment period, reset + -- period, ...) spans the entire term of the trade.+ deriving (Eq,Show,Enum)+instance SchemaType PeriodExtendedEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType PeriodExtendedEnum where+ acceptingParser = do isWord "D"; return PeriodExtendedEnum_D+ `onFail` do isWord "W"; return PeriodExtendedEnum_W+ `onFail` do isWord "M"; return PeriodExtendedEnum_M+ `onFail` do isWord "Y"; return PeriodExtendedEnum_Y+ `onFail` do isWord "T"; return PeriodExtendedEnum_T+ + simpleTypeText PeriodExtendedEnum_D = "D"+ simpleTypeText PeriodExtendedEnum_W = "W"+ simpleTypeText PeriodExtendedEnum_M = "M"+ simpleTypeText PeriodExtendedEnum_Y = "Y"+ simpleTypeText PeriodExtendedEnum_T = "T"+ +-- | A type used to report how a position originated.+data PositionOriginEnum+ = PositionOriginEnum_Trade+ -- ^ The position originated directly from a trade.+ | PositionOriginEnum_Allocation+ -- ^ The position originated from an allocation of a block + -- trade.+ | PositionOriginEnum_Novation+ -- ^ The position originated from a novation or post-trade + -- transfer.+ | PositionOriginEnum_Netting+ -- ^ The position originated from netting or portfolio + -- compression.+ | PositionOriginEnum_Exercise+ -- ^ The position originated from an exercise of a + -- physically-settled option.+ deriving (Eq,Show,Enum)+instance SchemaType PositionOriginEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType PositionOriginEnum where+ acceptingParser = do isWord "Trade"; return PositionOriginEnum_Trade+ `onFail` do isWord "Allocation"; return PositionOriginEnum_Allocation+ `onFail` do isWord "Novation"; return PositionOriginEnum_Novation+ `onFail` do isWord "Netting"; return PositionOriginEnum_Netting+ `onFail` do isWord "Exercise"; return PositionOriginEnum_Exercise+ + simpleTypeText PositionOriginEnum_Trade = "Trade"+ simpleTypeText PositionOriginEnum_Allocation = "Allocation"+ simpleTypeText PositionOriginEnum_Novation = "Novation"+ simpleTypeText PositionOriginEnum_Netting = "Netting"+ simpleTypeText PositionOriginEnum_Exercise = "Exercise"+ +data PositionStatusEnum+ = PositionStatusEnum_New+ -- ^ The position is open and has been newly added since the + -- last position report.+ | PositionStatusEnum_Existing+ -- ^ The position is open and was present in the last position + -- report.+ | PositionStatusEnum_Closed+ -- ^ The position is no longer open, for example because it has + -- matured, was assigned, or was terminated.+ deriving (Eq,Show,Enum)+instance SchemaType PositionStatusEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType PositionStatusEnum where+ acceptingParser = do isWord "New"; return PositionStatusEnum_New+ `onFail` do isWord "Existing"; return PositionStatusEnum_Existing+ `onFail` do isWord "Closed"; return PositionStatusEnum_Closed+ + simpleTypeText PositionStatusEnum_New = "New"+ simpleTypeText PositionStatusEnum_Existing = "Existing"+ simpleTypeText PositionStatusEnum_Closed = "Closed"+ +-- | The specification of how the premium for an FX OTC option +-- is quoted.+data PremiumQuoteBasisEnum+ = PremiumQuoteBasisEnum_PercentageOfCallCurrencyAmount+ -- ^ Premium is quoted as a percentage of the + -- callCurrencyAmount.+ | PremiumQuoteBasisEnum_PercentageOfPutCurrencyAmount+ -- ^ Premium is quoted as a percentage of the putCurrencyAmount.+ | PremiumQuoteBasisEnum_CallCurrencyPerPutCurrency+ -- ^ Premium is quoted in the call currency as a percentage of + -- the put currency.+ | PremiumQuoteBasisEnum_PutCurrencyPerCallCurrency+ -- ^ Premium is quoted in the put currency as a percentage of + -- the call currency.+ | PremiumQuoteBasisEnum_Explicit+ -- ^ Premium is quoted as an explicit amount.+ deriving (Eq,Show,Enum)+instance SchemaType PremiumQuoteBasisEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType PremiumQuoteBasisEnum where+ acceptingParser = do isWord "PercentageOfCallCurrencyAmount"; return PremiumQuoteBasisEnum_PercentageOfCallCurrencyAmount+ `onFail` do isWord "PercentageOfPutCurrencyAmount"; return PremiumQuoteBasisEnum_PercentageOfPutCurrencyAmount+ `onFail` do isWord "CallCurrencyPerPutCurrency"; return PremiumQuoteBasisEnum_CallCurrencyPerPutCurrency+ `onFail` do isWord "PutCurrencyPerCallCurrency"; return PremiumQuoteBasisEnum_PutCurrencyPerCallCurrency+ `onFail` do isWord "Explicit"; return PremiumQuoteBasisEnum_Explicit+ + simpleTypeText PremiumQuoteBasisEnum_PercentageOfCallCurrencyAmount = "PercentageOfCallCurrencyAmount"+ simpleTypeText PremiumQuoteBasisEnum_PercentageOfPutCurrencyAmount = "PercentageOfPutCurrencyAmount"+ simpleTypeText PremiumQuoteBasisEnum_CallCurrencyPerPutCurrency = "CallCurrencyPerPutCurrency"+ simpleTypeText PremiumQuoteBasisEnum_PutCurrencyPerCallCurrency = "PutCurrencyPerCallCurrency"+ simpleTypeText PremiumQuoteBasisEnum_Explicit = "Explicit"+ +-- | Premium Type for Forward Start Equity Option+data PremiumTypeEnum+ = PremiumTypeEnum_PrePaid+ -- ^ TODO+ | PremiumTypeEnum_PostPaid+ -- ^ TODO+ | PremiumTypeEnum_Variable+ -- ^ TODO+ | PremiumTypeEnum_Fixed+ -- ^ TODO+ deriving (Eq,Show,Enum)+instance SchemaType PremiumTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType PremiumTypeEnum where+ acceptingParser = do isWord "PrePaid"; return PremiumTypeEnum_PrePaid+ `onFail` do isWord "PostPaid"; return PremiumTypeEnum_PostPaid+ `onFail` do isWord "Variable"; return PremiumTypeEnum_Variable+ `onFail` do isWord "Fixed"; return PremiumTypeEnum_Fixed+ + simpleTypeText PremiumTypeEnum_PrePaid = "PrePaid"+ simpleTypeText PremiumTypeEnum_PostPaid = "PostPaid"+ simpleTypeText PremiumTypeEnum_Variable = "Variable"+ simpleTypeText PremiumTypeEnum_Fixed = "Fixed"+ +-- | The mode of expression of a price.+data PriceExpressionEnum+ = PriceExpressionEnum_AbsoluteTerms+ -- ^ The price is expressed as an absolute amount.>+ | PriceExpressionEnum_PercentageOfNotional+ -- ^ The price is expressed in percentage of the notional + -- amount.+ deriving (Eq,Show,Enum)+instance SchemaType PriceExpressionEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType PriceExpressionEnum where+ acceptingParser = do isWord "AbsoluteTerms"; return PriceExpressionEnum_AbsoluteTerms+ `onFail` do isWord "PercentageOfNotional"; return PriceExpressionEnum_PercentageOfNotional+ + simpleTypeText PriceExpressionEnum_AbsoluteTerms = "AbsoluteTerms"+ simpleTypeText PriceExpressionEnum_PercentageOfNotional = "PercentageOfNotional"+ +-- | Specifies whether the option is a call or a put.+data PutCallEnum+ = PutCallEnum_Put+ -- ^ A put option gives the holder the right to sell the + -- underlying asset by a certain date for a certain price.+ | PutCallEnum_Call+ -- ^ A call option gives the holder the right to buy the + -- underlying asset by a certain date for a certain price.+ deriving (Eq,Show,Enum)+instance SchemaType PutCallEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType PutCallEnum where+ acceptingParser = do isWord "Put"; return PutCallEnum_Put+ `onFail` do isWord "Call"; return PutCallEnum_Call+ + simpleTypeText PutCallEnum_Put = "Put"+ simpleTypeText PutCallEnum_Call = "Call"+ +-- | The specification of the type of quotation rate to be +-- obtained from each cash settlement reference bank.+data QuotationRateTypeEnum+ = QuotationRateTypeEnum_Bid+ -- ^ A bid rate.+ | QuotationRateTypeEnum_Ask+ -- ^ An ask rate.+ | QuotationRateTypeEnum_Mid+ -- ^ A mid-market rate.+ | QuotationRateTypeEnum_ExercisingPartyPays+ -- ^ If optional early termination is applicable to a swap + -- transaction, the rate, which may be a bid or ask rate, + -- which would result, if seller is in-the-money, in the + -- higher absolute value of the cash settlement amount, or, is + -- seller is out-of-the-money, in the lower absolute value of + -- the cash settlement amount.+ deriving (Eq,Show,Enum)+instance SchemaType QuotationRateTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType QuotationRateTypeEnum where+ acceptingParser = do isWord "Bid"; return QuotationRateTypeEnum_Bid+ `onFail` do isWord "Ask"; return QuotationRateTypeEnum_Ask+ `onFail` do isWord "Mid"; return QuotationRateTypeEnum_Mid+ `onFail` do isWord "ExercisingPartyPays"; return QuotationRateTypeEnum_ExercisingPartyPays+ + simpleTypeText QuotationRateTypeEnum_Bid = "Bid"+ simpleTypeText QuotationRateTypeEnum_Ask = "Ask"+ simpleTypeText QuotationRateTypeEnum_Mid = "Mid"+ simpleTypeText QuotationRateTypeEnum_ExercisingPartyPays = "ExercisingPartyPays"+ +-- | The side from which perspective a value is quoted.+data QuotationSideEnum+ = QuotationSideEnum_Bid+ -- ^ A value "bid" by a buyer for an asset, i.e. the value a + -- buyer is willing to pay.+ | QuotationSideEnum_Ask+ -- ^ A value "asked" by a seller for an asset, i.e. the value at + -- which a seller is willing to sell.+ | QuotationSideEnum_Mid+ -- ^ A value midway between the bid and the ask value.+ deriving (Eq,Show,Enum)+instance SchemaType QuotationSideEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType QuotationSideEnum where+ acceptingParser = do isWord "Bid"; return QuotationSideEnum_Bid+ `onFail` do isWord "Ask"; return QuotationSideEnum_Ask+ `onFail` do isWord "Mid"; return QuotationSideEnum_Mid+ + simpleTypeText QuotationSideEnum_Bid = "Bid"+ simpleTypeText QuotationSideEnum_Ask = "Ask"+ simpleTypeText QuotationSideEnum_Mid = "Mid"+ +-- | Indicates the actual quotation style of of PointsUpFront or +-- TradedSpread that was used to quote this trade.+data QuotationStyleEnum+ = QuotationStyleEnum_PointsUpFront+ -- ^ When quotation style is "PointsUpFront", the initialPoints + -- element of the feeLeg should be populated.+ | QuotationStyleEnum_TradedSpread+ -- ^ When quotation style is "TradedSpread", the marketFixedRate + -- element of the feeLeg should be populated.+ deriving (Eq,Show,Enum)+instance SchemaType QuotationStyleEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType QuotationStyleEnum where+ acceptingParser = do isWord "PointsUpFront"; return QuotationStyleEnum_PointsUpFront+ `onFail` do isWord "TradedSpread"; return QuotationStyleEnum_TradedSpread+ + simpleTypeText QuotationStyleEnum_PointsUpFront = "PointsUpFront"+ simpleTypeText QuotationStyleEnum_TradedSpread = "TradedSpread"+ +-- | How an exchange rate is quoted.+data QuoteBasisEnum+ = QuoteBasisEnum_Currency1PerCurrency2+ -- ^ The amount of currency1 for one unit of currency2+ | QuoteBasisEnum_Currency2PerCurrency1+ -- ^ The amount of currency2 for one unit of currency1+ deriving (Eq,Show,Enum)+instance SchemaType QuoteBasisEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType QuoteBasisEnum where+ acceptingParser = do isWord "Currency1PerCurrency2"; return QuoteBasisEnum_Currency1PerCurrency2+ `onFail` do isWord "Currency2PerCurrency1"; return QuoteBasisEnum_Currency2PerCurrency1+ + simpleTypeText QuoteBasisEnum_Currency1PerCurrency2 = "Currency1PerCurrency2"+ simpleTypeText QuoteBasisEnum_Currency2PerCurrency1 = "Currency2PerCurrency1"+ +-- | The specification of methods for converting rates from one +-- basis to another.+data RateTreatmentEnum+ = RateTreatmentEnum_BondEquivalentYield+ -- ^ Bond Equivalent Yield. Per Annex to the 2000 ISDA + -- Definitions (June 2000 Version), Section 7.3. Certain + -- General Definitions Relating to Floating Rate Options, + -- paragraph (g).+ | RateTreatmentEnum_MoneyMarketYield+ -- ^ Money Market Yield. Per Annex to the 2000 ISDA Definitions + -- (June 2000 Version), Section 7.3. Certain General + -- Definitions Relating to Floating Rate Options, paragraph + -- (h).+ deriving (Eq,Show,Enum)+instance SchemaType RateTreatmentEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType RateTreatmentEnum where+ acceptingParser = do isWord "BondEquivalentYield"; return RateTreatmentEnum_BondEquivalentYield+ `onFail` do isWord "MoneyMarketYield"; return RateTreatmentEnum_MoneyMarketYield+ + simpleTypeText RateTreatmentEnum_BondEquivalentYield = "BondEquivalentYield"+ simpleTypeText RateTreatmentEnum_MoneyMarketYield = "MoneyMarketYield"+ +-- | The contract specifies whether which price must satisfy the +-- boundary condition.+data RealisedVarianceMethodEnum+ = RealisedVarianceMethodEnum_Previous+ -- ^ For a return on day T, the observed price on T-1 must be in + -- range.+ | RealisedVarianceMethodEnum_Last+ -- ^ For a return on day T, the observed price on T must be in + -- range.+ | RealisedVarianceMethodEnum_Both+ -- ^ For a return on day T, the observed prices on both T and + -- T-1 must be in range+ deriving (Eq,Show,Enum)+instance SchemaType RealisedVarianceMethodEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType RealisedVarianceMethodEnum where+ acceptingParser = do isWord "Previous"; return RealisedVarianceMethodEnum_Previous+ `onFail` do isWord "Last"; return RealisedVarianceMethodEnum_Last+ `onFail` do isWord "Both"; return RealisedVarianceMethodEnum_Both+ + simpleTypeText RealisedVarianceMethodEnum_Previous = "Previous"+ simpleTypeText RealisedVarianceMethodEnum_Last = "Last"+ simpleTypeText RealisedVarianceMethodEnum_Both = "Both"+ +-- | The specification of whether resets occur relative to the +-- first or last day of a calculation period.+data ResetRelativeToEnum+ = ResetRelativeToEnum_CalculationPeriodStartDate+ -- ^ Resets will occur relative to the first day of each + -- calculation period.+ | ResetRelativeToEnum_CalculationPeriodEndDate+ -- ^ Resets will occur relative to the last day of each + -- calculation period.+ deriving (Eq,Show,Enum)+instance SchemaType ResetRelativeToEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType ResetRelativeToEnum where+ acceptingParser = do isWord "CalculationPeriodStartDate"; return ResetRelativeToEnum_CalculationPeriodStartDate+ `onFail` do isWord "CalculationPeriodEndDate"; return ResetRelativeToEnum_CalculationPeriodEndDate+ + simpleTypeText ResetRelativeToEnum_CalculationPeriodStartDate = "CalculationPeriodStartDate"+ simpleTypeText ResetRelativeToEnum_CalculationPeriodEndDate = "CalculationPeriodEndDate"+ +-- | The type of return associated with the equity swap.+data ReturnTypeEnum+ = ReturnTypeEnum_Dividend+ -- ^ Dividend return swap.+ | ReturnTypeEnum_Price+ -- ^ Price return swap.+ | ReturnTypeEnum_Total+ -- ^ Total return swap.+ deriving (Eq,Show,Enum)+instance SchemaType ReturnTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType ReturnTypeEnum where+ acceptingParser = do isWord "Dividend"; return ReturnTypeEnum_Dividend+ `onFail` do isWord "Price"; return ReturnTypeEnum_Price+ `onFail` do isWord "Total"; return ReturnTypeEnum_Total+ + simpleTypeText ReturnTypeEnum_Dividend = "Dividend"+ simpleTypeText ReturnTypeEnum_Price = "Price"+ simpleTypeText ReturnTypeEnum_Total = "Total"+ +-- | The convention for determining the sequence of calculation +-- period end dates. It is used in conjunction with a +-- specified frequency and the regular period start date of a +-- calculation period, e.g. semi-annual IMM roll dates.+data RollConventionEnum+ = RollConventionEnum_EOM+ -- ^ Rolls on month end dates irrespective of the length of the + -- month and the previous roll day.+ | RollConventionEnum_FRN+ -- ^ Roll days are determined according to the FRN Convention or + -- Eurodollar Convention as described in ISDA 2000 + -- definitions.+ | RollConventionEnum_IMM+ -- ^ IMM Settlement Dates. The third Wednesday of the (delivery) + -- month.+ | RollConventionEnum_IMMCAD+ -- ^ The last trading day/expiration day of the Canadian + -- Derivatives Exchange (Bourse de Montreal Inc) Three-month + -- Canadian Bankers' Acceptance Futures (Ticker Symbol BAX). + -- The second London banking day prior to the third Wednesday + -- of the contract month. If the determined day is a Bourse or + -- bank holiday in Montreal or Toronto, the last trading day + -- shall be the previous bank business day. Per Canadian + -- Derivatives Exchange BAX contract specification.+ | RollConventionEnum_IMMAUD+ -- ^ The last trading day of the Sydney Futures Exchange 90 Day + -- Bank Accepted Bills Futures contract (see + -- http://www.sfe.com.au/content/sfe/trading/con_specs.pdf). + -- One Sydney business day preceding the second Friday of the + -- relevant settlement month.+ | RollConventionEnum_IMMNZD+ -- ^ The last trading day of the Sydney Futures Exchange NZ 90 + -- Day Bank Bill Futures contract (see + -- http://www.sfe.com.au/content/sfe/trading/con_specs.pdf). + -- The first Wednesday after the ninth day of the relevant + -- settlement month.+ | RollConventionEnum_SFE+ -- ^ Sydney Futures Exchange 90-Day Bank Accepted Bill Futures + -- Settlement Dates. The second Friday of the (delivery) + -- month.+ | RollConventionEnum_NONE+ -- ^ The roll convention is not required. For example, in the + -- case of a daily calculation frequency.+ | RollConventionEnum_TBILL+ -- ^ 13-week and 26-week U.S. Treasury Bill Auction Dates. Each + -- Monday except for U.S. (New York) holidays when it will + -- occur on a Tuesday.+ | RollConventionEnum_V1+ -- ^ Rolls on the 1st day of the month.+ | RollConventionEnum_V2+ -- ^ Rolls on the 2nd day of the month.+ | RollConventionEnum_V3+ -- ^ Rolls on the 3rd day of the month.+ | RollConventionEnum_V4+ -- ^ Rolls on the 4th day of the month.+ | RollConventionEnum_V5+ -- ^ Rolls on the 4th day of the month.+ | RollConventionEnum_V6+ -- ^ Rolls on the 6th day of the month.+ | RollConventionEnum_V7+ -- ^ Rolls on the 7th day of the month.+ | RollConventionEnum_V8+ -- ^ Rolls on the 8th day of the month.+ | RollConventionEnum_V9+ -- ^ Rolls on the 9th day of the month.+ | RollConventionEnum_V10+ -- ^ Rolls on the 10th day of the month.+ | RollConventionEnum_V11+ -- ^ Rolls on the 11th day of the month.+ | RollConventionEnum_V12+ -- ^ Rolls on the 12th day of the month.+ | RollConventionEnum_V13+ -- ^ Rolls on the 13th day of the month.+ | RollConventionEnum_V14+ -- ^ Rolls on the 14th day of the month.+ | RollConventionEnum_V15+ -- ^ Rolls on the 15th day of the month.+ | RollConventionEnum_V16+ -- ^ Rolls on the 16th day of the month.+ | RollConventionEnum_V17+ -- ^ Rolls on the 17th day of the month.+ | RollConventionEnum_V18+ -- ^ Rolls on the 18th day of the month.+ | RollConventionEnum_V19+ -- ^ Rolls on the 19th day of the month.+ | RollConventionEnum_V20+ -- ^ Rolls on the 20th day of the month.+ | RollConventionEnum_V21+ -- ^ Rolls on the 21st day of the month.+ | RollConventionEnum_V22+ -- ^ Rolls on the 22nd day of the month.+ | RollConventionEnum_V23+ -- ^ Rolls on the 23rd day of the month.+ | RollConventionEnum_V24+ -- ^ Rolls on the 24th day of the month.+ | RollConventionEnum_V25+ -- ^ Rolls on the 25th day of the month.+ | RollConventionEnum_V26+ -- ^ Rolls on the 26th day of the month.+ | RollConventionEnum_V27+ -- ^ Rolls on the 27th day of the month.+ | RollConventionEnum_V28+ -- ^ Rolls on the 28th day of the month.+ | RollConventionEnum_V29+ -- ^ Rolls on the 29th day of the month.+ | RollConventionEnum_V30+ -- ^ Rolls on the 30th day of the month.+ | RollConventionEnum_MON+ -- ^ Rolling weekly on a Monday.+ | RollConventionEnum_TUE+ -- ^ Rolling weekly on a Tuesday.+ | RollConventionEnum_WED+ -- ^ Rolling weekly on a Wednesday.+ | RollConventionEnum_THU+ -- ^ Rolling weekly on a Thursday.+ | RollConventionEnum_FRI+ -- ^ Rolling weekly on a Friday.+ | RollConventionEnum_SAT+ -- ^ Rolling weekly on a Saturday.+ | RollConventionEnum_SUN+ -- ^ Rolling weekly on a Sunday.+ deriving (Eq,Show,Enum)+instance SchemaType RollConventionEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType RollConventionEnum where+ acceptingParser = do isWord "EOM"; return RollConventionEnum_EOM+ `onFail` do isWord "FRN"; return RollConventionEnum_FRN+ `onFail` do isWord "IMM"; return RollConventionEnum_IMM+ `onFail` do isWord "IMMCAD"; return RollConventionEnum_IMMCAD+ `onFail` do isWord "IMMAUD"; return RollConventionEnum_IMMAUD+ `onFail` do isWord "IMMNZD"; return RollConventionEnum_IMMNZD+ `onFail` do isWord "SFE"; return RollConventionEnum_SFE+ `onFail` do isWord "NONE"; return RollConventionEnum_NONE+ `onFail` do isWord "TBILL"; return RollConventionEnum_TBILL+ `onFail` do isWord "1"; return RollConventionEnum_V1+ `onFail` do isWord "2"; return RollConventionEnum_V2+ `onFail` do isWord "3"; return RollConventionEnum_V3+ `onFail` do isWord "4"; return RollConventionEnum_V4+ `onFail` do isWord "5"; return RollConventionEnum_V5+ `onFail` do isWord "6"; return RollConventionEnum_V6+ `onFail` do isWord "7"; return RollConventionEnum_V7+ `onFail` do isWord "8"; return RollConventionEnum_V8+ `onFail` do isWord "9"; return RollConventionEnum_V9+ `onFail` do isWord "10"; return RollConventionEnum_V10+ `onFail` do isWord "11"; return RollConventionEnum_V11+ `onFail` do isWord "12"; return RollConventionEnum_V12+ `onFail` do isWord "13"; return RollConventionEnum_V13+ `onFail` do isWord "14"; return RollConventionEnum_V14+ `onFail` do isWord "15"; return RollConventionEnum_V15+ `onFail` do isWord "16"; return RollConventionEnum_V16+ `onFail` do isWord "17"; return RollConventionEnum_V17+ `onFail` do isWord "18"; return RollConventionEnum_V18+ `onFail` do isWord "19"; return RollConventionEnum_V19+ `onFail` do isWord "20"; return RollConventionEnum_V20+ `onFail` do isWord "21"; return RollConventionEnum_V21+ `onFail` do isWord "22"; return RollConventionEnum_V22+ `onFail` do isWord "23"; return RollConventionEnum_V23+ `onFail` do isWord "24"; return RollConventionEnum_V24+ `onFail` do isWord "25"; return RollConventionEnum_V25+ `onFail` do isWord "26"; return RollConventionEnum_V26+ `onFail` do isWord "27"; return RollConventionEnum_V27+ `onFail` do isWord "28"; return RollConventionEnum_V28+ `onFail` do isWord "29"; return RollConventionEnum_V29+ `onFail` do isWord "30"; return RollConventionEnum_V30+ `onFail` do isWord "MON"; return RollConventionEnum_MON+ `onFail` do isWord "TUE"; return RollConventionEnum_TUE+ `onFail` do isWord "WED"; return RollConventionEnum_WED+ `onFail` do isWord "THU"; return RollConventionEnum_THU+ `onFail` do isWord "FRI"; return RollConventionEnum_FRI+ `onFail` do isWord "SAT"; return RollConventionEnum_SAT+ `onFail` do isWord "SUN"; return RollConventionEnum_SUN+ + simpleTypeText RollConventionEnum_EOM = "EOM"+ simpleTypeText RollConventionEnum_FRN = "FRN"+ simpleTypeText RollConventionEnum_IMM = "IMM"+ simpleTypeText RollConventionEnum_IMMCAD = "IMMCAD"+ simpleTypeText RollConventionEnum_IMMAUD = "IMMAUD"+ simpleTypeText RollConventionEnum_IMMNZD = "IMMNZD"+ simpleTypeText RollConventionEnum_SFE = "SFE"+ simpleTypeText RollConventionEnum_NONE = "NONE"+ simpleTypeText RollConventionEnum_TBILL = "TBILL"+ simpleTypeText RollConventionEnum_V1 = "1"+ simpleTypeText RollConventionEnum_V2 = "2"+ simpleTypeText RollConventionEnum_V3 = "3"+ simpleTypeText RollConventionEnum_V4 = "4"+ simpleTypeText RollConventionEnum_V5 = "5"+ simpleTypeText RollConventionEnum_V6 = "6"+ simpleTypeText RollConventionEnum_V7 = "7"+ simpleTypeText RollConventionEnum_V8 = "8"+ simpleTypeText RollConventionEnum_V9 = "9"+ simpleTypeText RollConventionEnum_V10 = "10"+ simpleTypeText RollConventionEnum_V11 = "11"+ simpleTypeText RollConventionEnum_V12 = "12"+ simpleTypeText RollConventionEnum_V13 = "13"+ simpleTypeText RollConventionEnum_V14 = "14"+ simpleTypeText RollConventionEnum_V15 = "15"+ simpleTypeText RollConventionEnum_V16 = "16"+ simpleTypeText RollConventionEnum_V17 = "17"+ simpleTypeText RollConventionEnum_V18 = "18"+ simpleTypeText RollConventionEnum_V19 = "19"+ simpleTypeText RollConventionEnum_V20 = "20"+ simpleTypeText RollConventionEnum_V21 = "21"+ simpleTypeText RollConventionEnum_V22 = "22"+ simpleTypeText RollConventionEnum_V23 = "23"+ simpleTypeText RollConventionEnum_V24 = "24"+ simpleTypeText RollConventionEnum_V25 = "25"+ simpleTypeText RollConventionEnum_V26 = "26"+ simpleTypeText RollConventionEnum_V27 = "27"+ simpleTypeText RollConventionEnum_V28 = "28"+ simpleTypeText RollConventionEnum_V29 = "29"+ simpleTypeText RollConventionEnum_V30 = "30"+ simpleTypeText RollConventionEnum_MON = "MON"+ simpleTypeText RollConventionEnum_TUE = "TUE"+ simpleTypeText RollConventionEnum_WED = "WED"+ simpleTypeText RollConventionEnum_THU = "THU"+ simpleTypeText RollConventionEnum_FRI = "FRI"+ simpleTypeText RollConventionEnum_SAT = "SAT"+ simpleTypeText RollConventionEnum_SUN = "SUN"+ +-- | The method of rounding a fractional number.+data RoundingDirectionEnum+ = RoundingDirectionEnum_Up+ -- ^ A fractional number will be rounded up to the specified + -- number of decimal places (the precision). For example, 5.21 + -- and 5.25 rounded up to 1 decimal place are 5.3 and 5.3 + -- respectively.+ | RoundingDirectionEnum_Down+ -- ^ A fractional number will be rounded down to the specified + -- number of decimal places (the precision). For example, 5.29 + -- and 5.25 rounded down to 1 decimal place are 5.2 and 5.2 + -- respectively.+ | RoundingDirectionEnum_Nearest+ -- ^ A fractional number will be rounded either up or down to + -- the specified number of decimal places (the precision) + -- depending on its value. For example, 5.24 would be rounded + -- down to 5.2 and 5.25 would be rounded up to 5.3 if a + -- precision of 1 decimal place were specified.+ deriving (Eq,Show,Enum)+instance SchemaType RoundingDirectionEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType RoundingDirectionEnum where+ acceptingParser = do isWord "Up"; return RoundingDirectionEnum_Up+ `onFail` do isWord "Down"; return RoundingDirectionEnum_Down+ `onFail` do isWord "Nearest"; return RoundingDirectionEnum_Nearest+ + simpleTypeText RoundingDirectionEnum_Up = "Up"+ simpleTypeText RoundingDirectionEnum_Down = "Down"+ simpleTypeText RoundingDirectionEnum_Nearest = "Nearest"+ +-- | Defines the Settlement Period Duration for an Electricity +-- Transaction.+data SettlementPeriodDurationEnum+ = SettlementPeriodDurationEnum_V2Hours+ -- ^ Two-hourly duration applies.+ | SettlementPeriodDurationEnum_V1Hour+ -- ^ Hourly duration applies.+ | SettlementPeriodDurationEnum_V30Minutes+ -- ^ Half-hourly duration applies.+ | SettlementPeriodDurationEnum_V15Minutes+ -- ^ Quarter-hourly duration applies.+ deriving (Eq,Show,Enum)+instance SchemaType SettlementPeriodDurationEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType SettlementPeriodDurationEnum where+ acceptingParser = do isWord "2Hours"; return SettlementPeriodDurationEnum_V2Hours+ `onFail` do isWord "1Hour"; return SettlementPeriodDurationEnum_V1Hour+ `onFail` do isWord "30Minutes"; return SettlementPeriodDurationEnum_V30Minutes+ `onFail` do isWord "15Minutes"; return SettlementPeriodDurationEnum_V15Minutes+ + simpleTypeText SettlementPeriodDurationEnum_V2Hours = "2Hours"+ simpleTypeText SettlementPeriodDurationEnum_V1Hour = "1Hour"+ simpleTypeText SettlementPeriodDurationEnum_V30Minutes = "30Minutes"+ simpleTypeText SettlementPeriodDurationEnum_V15Minutes = "15Minutes"+ +-- | Shows how the transaction is to be settled when it is +-- exercised.+data SettlementTypeEnum+ = SettlementTypeEnum_Cash+ -- ^ The intrinsic value of the option will be delivered by way + -- of a cash settlement amount determined, (i) by reference to + -- the differential between the strike price and the + -- settlement price; or (ii) in accordance with a bilateral + -- agreement between the parties+ | SettlementTypeEnum_Physical+ -- ^ The securities underlying the transaction will be delivered + -- by (i) in the case of a call, the seller to the buyer, or + -- (ii) in the case of a put, the buyer to the seller versus a + -- settlement amount equivalent to the strike price per share+ | SettlementTypeEnum_Election+ -- ^ Allow Election of either Cash or Physical settlement+ deriving (Eq,Show,Enum)+instance SchemaType SettlementTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType SettlementTypeEnum where+ acceptingParser = do isWord "Cash"; return SettlementTypeEnum_Cash+ `onFail` do isWord "Physical"; return SettlementTypeEnum_Physical+ `onFail` do isWord "Election"; return SettlementTypeEnum_Election+ + simpleTypeText SettlementTypeEnum_Cash = "Cash"+ simpleTypeText SettlementTypeEnum_Physical = "Physical"+ simpleTypeText SettlementTypeEnum_Election = "Election"+ +-- | Defines the consequences of extraordinary events relating +-- to the underlying.+data ShareExtraordinaryEventEnum+ = ShareExtraordinaryEventEnum_AlternativeObligation+ -- ^ The trade continues such that the underlying now consists + -- of the New Shares and/or the Other Consideration, if any, + -- and the proceeds of any redemption, if any, that the holder + -- of the underlying Shares would have been entitled to.+ | ShareExtraordinaryEventEnum_CancellationAndPayment+ -- ^ The trade is cancelled and a cancellation fee will be paid + -- by one party to the other.+ | ShareExtraordinaryEventEnum_OptionsExchange+ -- ^ The trade will be adjusted by the Calculation Agent in + -- accordance with the adjustments made by any exchange on + -- which options on the underlying are listed.+ | ShareExtraordinaryEventEnum_CalculationAgent+ -- ^ The Calculation Agent will determine what adjustment is + -- required to offset any change to the economics of the + -- trade. If the Calculation Agent cannot achieve this, the + -- trade goes to Cancellation and Payment with the Calculation + -- Agent deciding on the value of the cancellation fee. + -- Adjustments may not be made to account solely for changes + -- in volatility, expected dividends, stock loan rate or + -- liquidity.+ | ShareExtraordinaryEventEnum_ModifiedCalculationAgent+ -- ^ The Calculation Agent will determine what adjustment is + -- required to offset any change to the economics of the + -- trade. If the Calculation Agent cannot achieve this, the + -- trade goes to Cancellation and Payment with the Calculation + -- Agent deciding on the value of the cancellation fee. + -- Adjustments to account for changes in volatility, expected + -- dividends, stock loan rate or liquidity are allowed.+ | ShareExtraordinaryEventEnum_PartialCancellationAndPayment+ -- ^ Applies to Basket Transactions. The portion of the Basket + -- made up by the affected Share will be cancelled and a + -- cancellation fee will be paid from one party to the other. + -- The remainder of the trade continues.+ | ShareExtraordinaryEventEnum_Component+ -- ^ If this is a Share-for-Combined merger event (Shares are + -- replaced with New Shares and Other Consideration), then + -- different treatment can be applied to each component if the + -- parties have specified this.+ deriving (Eq,Show,Enum)+instance SchemaType ShareExtraordinaryEventEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType ShareExtraordinaryEventEnum where+ acceptingParser = do isWord "AlternativeObligation"; return ShareExtraordinaryEventEnum_AlternativeObligation+ `onFail` do isWord "CancellationAndPayment"; return ShareExtraordinaryEventEnum_CancellationAndPayment+ `onFail` do isWord "OptionsExchange"; return ShareExtraordinaryEventEnum_OptionsExchange+ `onFail` do isWord "CalculationAgent"; return ShareExtraordinaryEventEnum_CalculationAgent+ `onFail` do isWord "ModifiedCalculationAgent"; return ShareExtraordinaryEventEnum_ModifiedCalculationAgent+ `onFail` do isWord "PartialCancellationAndPayment"; return ShareExtraordinaryEventEnum_PartialCancellationAndPayment+ `onFail` do isWord "Component"; return ShareExtraordinaryEventEnum_Component+ + simpleTypeText ShareExtraordinaryEventEnum_AlternativeObligation = "AlternativeObligation"+ simpleTypeText ShareExtraordinaryEventEnum_CancellationAndPayment = "CancellationAndPayment"+ simpleTypeText ShareExtraordinaryEventEnum_OptionsExchange = "OptionsExchange"+ simpleTypeText ShareExtraordinaryEventEnum_CalculationAgent = "CalculationAgent"+ simpleTypeText ShareExtraordinaryEventEnum_ModifiedCalculationAgent = "ModifiedCalculationAgent"+ simpleTypeText ShareExtraordinaryEventEnum_PartialCancellationAndPayment = "PartialCancellationAndPayment"+ simpleTypeText ShareExtraordinaryEventEnum_Component = "Component"+ +-- | The Specified Price in respect of a Transaction and a +-- Commodity Reference Price.+data SpecifiedPriceEnum+ = SpecifiedPriceEnum_Afternoon+ -- ^ The Specified Price shall be the Afternoon fixing reported + -- in or by the relevant Price Source as specified in the + -- relevant Confirmation.+ | SpecifiedPriceEnum_Ask+ -- ^ The Specified Price shall be the Ask price reported in or + -- by the relevant Price Source as specified in the relevant + -- Confirmation.+ | SpecifiedPriceEnum_Bid+ -- ^ The Specified Price shall be the Bid price reported in or + -- by the relevant Price Source as specified in the relevant + -- Confirmation.+ | SpecifiedPriceEnum_Closing+ -- ^ The Specified Price shall be the Closing price reported in + -- or by the relevant Price Source as specified in the + -- relevant Confirmation.+ | SpecifiedPriceEnum_High+ -- ^ The Specified Price shall be the High price reported in or + -- by the relevant Price Source as specified in the relevant + -- Confirmation.+ | SpecifiedPriceEnum_Index+ -- ^ The Specified Price shall be the Index price reported in or + -- by the relevant Price Source as specified in the relevant + -- Confirmation.+ | SpecifiedPriceEnum_MeanOfBidAndAsk+ -- ^ The Specified Price shall be the Average of the Bid and Ask + -- prices reported in or by the relevant Price Source as + -- specified in the relevant Confirmation.+ | SpecifiedPriceEnum_Low+ -- ^ The Specified Price shall be the Low price reported in or + -- by the relevant Price Source as specified in the relevant + -- Confirmation.+ | SpecifiedPriceEnum_MeanOfHighAndLow+ -- ^ The Specified Price shall be the Average of the High and + -- Low prices reported in or by the relevant Price Source as + -- specified in the relevant Confirmation.+ | SpecifiedPriceEnum_Morning+ -- ^ The Specified Price shall be the Morning fixing reported in + -- or by the relevant Price Source as specified in the + -- relevant Confirmation.+ | SpecifiedPriceEnum_Official+ -- ^ The Specified Price shall be the Official price reported in + -- or by the relevant Price Source as specified in the + -- relevant Confirmation.+ | SpecifiedPriceEnum_Opening+ -- ^ The Specified Price shall be the Opening price reported in + -- or by the relevant Price Source as specified in the + -- relevant Confirmation.+ | SpecifiedPriceEnum_OSP+ -- ^ The Specified Price shall be the Official Settlement Price + -- reported in or by the relevant Price Source as specified in + -- the relevant Confirmation.+ | SpecifiedPriceEnum_Settlement+ -- ^ The Specified Price shall be the Settlement price reported + -- in or by the relevant Price Source as specified in the + -- relevant Confirmation.+ | SpecifiedPriceEnum_Spot+ -- ^ The Specified Price shall be the Spot price reported in or + -- by the relevant Price Source as specified in the relevant + -- Confirmation.+ | SpecifiedPriceEnum_Midpoint+ -- ^ The Specified Price shall be the Average of the Midpoint of + -- prices reported in or by the relevant Price Source as + -- specified in the relevant Confirmation.+ | SpecifiedPriceEnum_WeightedAverage+ -- ^ The Specified Price shall be the volume Weighted Average of + -- prices effective on the Pricing Date reported in or by the + -- relevant Price Source as specified.+ deriving (Eq,Show,Enum)+instance SchemaType SpecifiedPriceEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType SpecifiedPriceEnum where+ acceptingParser = do isWord "Afternoon"; return SpecifiedPriceEnum_Afternoon+ `onFail` do isWord "Ask"; return SpecifiedPriceEnum_Ask+ `onFail` do isWord "Bid"; return SpecifiedPriceEnum_Bid+ `onFail` do isWord "Closing"; return SpecifiedPriceEnum_Closing+ `onFail` do isWord "High"; return SpecifiedPriceEnum_High+ `onFail` do isWord "Index"; return SpecifiedPriceEnum_Index+ `onFail` do isWord "MeanOfBidAndAsk"; return SpecifiedPriceEnum_MeanOfBidAndAsk+ `onFail` do isWord "Low"; return SpecifiedPriceEnum_Low+ `onFail` do isWord "MeanOfHighAndLow"; return SpecifiedPriceEnum_MeanOfHighAndLow+ `onFail` do isWord "Morning"; return SpecifiedPriceEnum_Morning+ `onFail` do isWord "Official"; return SpecifiedPriceEnum_Official+ `onFail` do isWord "Opening"; return SpecifiedPriceEnum_Opening+ `onFail` do isWord "OSP"; return SpecifiedPriceEnum_OSP+ `onFail` do isWord "Settlement"; return SpecifiedPriceEnum_Settlement+ `onFail` do isWord "Spot"; return SpecifiedPriceEnum_Spot+ `onFail` do isWord "Midpoint"; return SpecifiedPriceEnum_Midpoint+ `onFail` do isWord "WeightedAverage"; return SpecifiedPriceEnum_WeightedAverage+ + simpleTypeText SpecifiedPriceEnum_Afternoon = "Afternoon"+ simpleTypeText SpecifiedPriceEnum_Ask = "Ask"+ simpleTypeText SpecifiedPriceEnum_Bid = "Bid"+ simpleTypeText SpecifiedPriceEnum_Closing = "Closing"+ simpleTypeText SpecifiedPriceEnum_High = "High"+ simpleTypeText SpecifiedPriceEnum_Index = "Index"+ simpleTypeText SpecifiedPriceEnum_MeanOfBidAndAsk = "MeanOfBidAndAsk"+ simpleTypeText SpecifiedPriceEnum_Low = "Low"+ simpleTypeText SpecifiedPriceEnum_MeanOfHighAndLow = "MeanOfHighAndLow"+ simpleTypeText SpecifiedPriceEnum_Morning = "Morning"+ simpleTypeText SpecifiedPriceEnum_Official = "Official"+ simpleTypeText SpecifiedPriceEnum_Opening = "Opening"+ simpleTypeText SpecifiedPriceEnum_OSP = "OSP"+ simpleTypeText SpecifiedPriceEnum_Settlement = "Settlement"+ simpleTypeText SpecifiedPriceEnum_Spot = "Spot"+ simpleTypeText SpecifiedPriceEnum_Midpoint = "Midpoint"+ simpleTypeText SpecifiedPriceEnum_WeightedAverage = "WeightedAverage"+ +-- | The code specification of whether a trade is settling using +-- standard settlement instructions as well as whether it is a +-- candidate for settlement netting.+data StandardSettlementStyleEnum+ = StandardSettlementStyleEnum_Standard+ -- ^ This trade will settle using standard pre-determined funds + -- settlement instructions.+ | StandardSettlementStyleEnum_Net+ -- ^ This trade is a candidate for settlement netting.+ | StandardSettlementStyleEnum_StandardAndNet+ -- ^ This trade will settle using standard pre-determined funds + -- settlement instructions and is a candidate for settlement + -- netting.+ deriving (Eq,Show,Enum)+instance SchemaType StandardSettlementStyleEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType StandardSettlementStyleEnum where+ acceptingParser = do isWord "Standard"; return StandardSettlementStyleEnum_Standard+ `onFail` do isWord "Net"; return StandardSettlementStyleEnum_Net+ `onFail` do isWord "StandardAndNet"; return StandardSettlementStyleEnum_StandardAndNet+ + simpleTypeText StandardSettlementStyleEnum_Standard = "Standard"+ simpleTypeText StandardSettlementStyleEnum_Net = "Net"+ simpleTypeText StandardSettlementStyleEnum_StandardAndNet = "StandardAndNet"+ +-- | The specification of whether a percentage rate change, used +-- to calculate a change in notional outstanding, is expressed +-- as a percentage of the initial notional amount or the +-- previously outstanding notional amount.+data StepRelativeToEnum+ = StepRelativeToEnum_Initial+ -- ^ Change in notional to be applied is calculated by + -- multiplying the percentage rate by the initial notional + -- amount.+ | StepRelativeToEnum_Previous+ -- ^ Change in notional to be applied is calculated by + -- multiplying the percentage rate by the previously + -- outstanding notional amount.+ deriving (Eq,Show,Enum)+instance SchemaType StepRelativeToEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType StepRelativeToEnum where+ acceptingParser = do isWord "Initial"; return StepRelativeToEnum_Initial+ `onFail` do isWord "Previous"; return StepRelativeToEnum_Previous+ + simpleTypeText StepRelativeToEnum_Initial = "Initial"+ simpleTypeText StepRelativeToEnum_Previous = "Previous"+ +-- | Element to define how to deal with a none standard +-- calculation period within a swap stream.+data StubPeriodTypeEnum+ = StubPeriodTypeEnum_ShortInitial+ -- ^ If there is a non regular period remaining it is left + -- shorter than the streams calculation period frequency and + -- placed at the start of the stream+ | StubPeriodTypeEnum_ShortFinal+ -- ^ If there is a non regular period remaining it is left + -- shorter than the streams calculation period frequency and + -- placed at the end of the stream+ | StubPeriodTypeEnum_LongInitial+ -- ^ If there is a non regular period remaining it is placed at + -- the start of the stream and combined with the adjacent + -- calculation period to give a long first calculation period+ | StubPeriodTypeEnum_LongFinal+ -- ^ If there is a non regular period remaining it is placed at + -- the end of the stream and combined with the adjacent + -- calculation period to give a long last calculation period+ deriving (Eq,Show,Enum)+instance SchemaType StubPeriodTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType StubPeriodTypeEnum where+ acceptingParser = do isWord "ShortInitial"; return StubPeriodTypeEnum_ShortInitial+ `onFail` do isWord "ShortFinal"; return StubPeriodTypeEnum_ShortFinal+ `onFail` do isWord "LongInitial"; return StubPeriodTypeEnum_LongInitial+ `onFail` do isWord "LongFinal"; return StubPeriodTypeEnum_LongFinal+ + simpleTypeText StubPeriodTypeEnum_ShortInitial = "ShortInitial"+ simpleTypeText StubPeriodTypeEnum_ShortFinal = "ShortFinal"+ simpleTypeText StubPeriodTypeEnum_LongInitial = "LongInitial"+ simpleTypeText StubPeriodTypeEnum_LongFinal = "LongFinal"+ +-- | The specification of how an FX OTC option strike price is +-- quoted.+data StrikeQuoteBasisEnum+ = StrikeQuoteBasisEnum_PutCurrencyPerCallCurrency+ -- ^ The strike price is an amount of putCurrency per one unit + -- of callCurrency.+ | StrikeQuoteBasisEnum_CallCurrencyPerPutCurrency+ -- ^ The strike price is an amount of callCurrency per one unit + -- of putCurrency.+ deriving (Eq,Show,Enum)+instance SchemaType StrikeQuoteBasisEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType StrikeQuoteBasisEnum where+ acceptingParser = do isWord "PutCurrencyPerCallCurrency"; return StrikeQuoteBasisEnum_PutCurrencyPerCallCurrency+ `onFail` do isWord "CallCurrencyPerPutCurrency"; return StrikeQuoteBasisEnum_CallCurrencyPerPutCurrency+ + simpleTypeText StrikeQuoteBasisEnum_PutCurrencyPerCallCurrency = "PutCurrencyPerCallCurrency"+ simpleTypeText StrikeQuoteBasisEnum_CallCurrencyPerPutCurrency = "CallCurrencyPerPutCurrency"+ +-- | The type of threshold.+data ThresholdTypeEnum+ = ThresholdTypeEnum_Secured+ | ThresholdTypeEnum_Unsecured+ deriving (Eq,Show,Enum)+instance SchemaType ThresholdTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType ThresholdTypeEnum where+ acceptingParser = do isWord "Secured"; return ThresholdTypeEnum_Secured+ `onFail` do isWord "Unsecured"; return ThresholdTypeEnum_Unsecured+ + simpleTypeText ThresholdTypeEnum_Secured = "Secured"+ simpleTypeText ThresholdTypeEnum_Unsecured = "Unsecured"+ +-- | Defines points in the day when equity option exercise and +-- valuation can occur.+data TimeTypeEnum+ = TimeTypeEnum_Close+ -- ^ The official closing time of the exchange on the valuation + -- date.+ | TimeTypeEnum_Open+ -- ^ The official opening time of the exchange on the valuation + -- date.+ | TimeTypeEnum_OSP+ -- ^ The time at which the official settlement price is + -- determined.+ | TimeTypeEnum_SpecificTime+ -- ^ The time specified in the element equityExpirationTime or + -- valuationTime (as appropriate)+ | TimeTypeEnum_XETRA+ -- ^ The time at which the official settlement price (following + -- the auction by the exchange) is determined by the exchange.+ | TimeTypeEnum_DerivativesClose+ -- ^ The official closing time of the derivatives exchange on + -- which a derivative contract is listed on that security + -- underlyer.+ | TimeTypeEnum_AsSpecifiedInMasterConfirmation+ -- ^ The time is determined as provided in the relevant Master + -- Confirmation.+ deriving (Eq,Show,Enum)+instance SchemaType TimeTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType TimeTypeEnum where+ acceptingParser = do isWord "Close"; return TimeTypeEnum_Close+ `onFail` do isWord "Open"; return TimeTypeEnum_Open+ `onFail` do isWord "OSP"; return TimeTypeEnum_OSP+ `onFail` do isWord "SpecificTime"; return TimeTypeEnum_SpecificTime+ `onFail` do isWord "XETRA"; return TimeTypeEnum_XETRA+ `onFail` do isWord "DerivativesClose"; return TimeTypeEnum_DerivativesClose+ `onFail` do isWord "AsSpecifiedInMasterConfirmation"; return TimeTypeEnum_AsSpecifiedInMasterConfirmation+ + simpleTypeText TimeTypeEnum_Close = "Close"+ simpleTypeText TimeTypeEnum_Open = "Open"+ simpleTypeText TimeTypeEnum_OSP = "OSP"+ simpleTypeText TimeTypeEnum_SpecificTime = "SpecificTime"+ simpleTypeText TimeTypeEnum_XETRA = "XETRA"+ simpleTypeText TimeTypeEnum_DerivativesClose = "DerivativesClose"+ simpleTypeText TimeTypeEnum_AsSpecifiedInMasterConfirmation = "AsSpecifiedInMasterConfirmation"+ +-- | The time of day which would be considered for valuing the +-- knock event.+data TriggerTimeTypeEnum+ = TriggerTimeTypeEnum_Closing+ -- ^ The close of trading on a day would be considered for + -- valuation.+ | TriggerTimeTypeEnum_Anytime+ -- ^ At any time during the Knock Determination period + -- (continuous barrier).+ deriving (Eq,Show,Enum)+instance SchemaType TriggerTimeTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType TriggerTimeTypeEnum where+ acceptingParser = do isWord "Closing"; return TriggerTimeTypeEnum_Closing+ `onFail` do isWord "Anytime"; return TriggerTimeTypeEnum_Anytime+ + simpleTypeText TriggerTimeTypeEnum_Closing = "Closing"+ simpleTypeText TriggerTimeTypeEnum_Anytime = "Anytime"+ +-- | The specification of whether an option would trigger or +-- expire depending upon whether the spot rate is above or +-- below the barrier rate.+data TriggerTypeEnum+ = TriggerTypeEnum_EqualOrLess+ -- ^ The underlyer price must be equal to or less than the + -- Trigger level.+ | TriggerTypeEnum_EqualOrGreater+ -- ^ The underlyer price must be equal to or greater than the + -- Trigger level.+ | TriggerTypeEnum_Equal+ -- ^ The underlyer price must be equal to the Trigger level.+ | TriggerTypeEnum_Less+ -- ^ The underlyer price must be less than the Trigger level.+ | TriggerTypeEnum_Greater+ -- ^ The underlyer price must be greater than the Trigger level.+ deriving (Eq,Show,Enum)+instance SchemaType TriggerTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType TriggerTypeEnum where+ acceptingParser = do isWord "EqualOrLess"; return TriggerTypeEnum_EqualOrLess+ `onFail` do isWord "EqualOrGreater"; return TriggerTypeEnum_EqualOrGreater+ `onFail` do isWord "Equal"; return TriggerTypeEnum_Equal+ `onFail` do isWord "Less"; return TriggerTypeEnum_Less+ `onFail` do isWord "Greater"; return TriggerTypeEnum_Greater+ + simpleTypeText TriggerTypeEnum_EqualOrLess = "EqualOrLess"+ simpleTypeText TriggerTypeEnum_EqualOrGreater = "EqualOrGreater"+ simpleTypeText TriggerTypeEnum_Equal = "Equal"+ simpleTypeText TriggerTypeEnum_Less = "Less"+ simpleTypeText TriggerTypeEnum_Greater = "Greater"+ +-- | The specification of, for American-style digitals, whether +-- the trigger level must be touched or not touched.+data TouchConditionEnum+ = TouchConditionEnum_Touch+ -- ^ The spot rate must have touched the predetermined trigger + -- rate at any time over the life of the option for the payout + -- to occur.+ | TouchConditionEnum_Notouch+ -- ^ The spot rate has not touched the predetermined trigger + -- rate at any time over the life of the option for the payout + -- to occur.+ deriving (Eq,Show,Enum)+instance SchemaType TouchConditionEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType TouchConditionEnum where+ acceptingParser = do isWord "Touch"; return TouchConditionEnum_Touch+ `onFail` do isWord "Notouch"; return TouchConditionEnum_Notouch+ + simpleTypeText TouchConditionEnum_Touch = "Touch"+ simpleTypeText TouchConditionEnum_Notouch = "Notouch"+ +-- | The specification of whether a payout will occur on an +-- option depending upon whether the spot rate is above or +-- below the trigger rate.+data TriggerConditionEnum+ = TriggerConditionEnum_Above+ -- ^ The spot rate must be greater than or equal to the trigger + -- rate.+ | TriggerConditionEnum_Below+ -- ^ The spot rate must be less than or equal to the trigger + -- rate.+ deriving (Eq,Show,Enum)+instance SchemaType TriggerConditionEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType TriggerConditionEnum where+ acceptingParser = do isWord "Above"; return TriggerConditionEnum_Above+ `onFail` do isWord "Below"; return TriggerConditionEnum_Below+ + simpleTypeText TriggerConditionEnum_Above = "Above"+ simpleTypeText TriggerConditionEnum_Below = "Below"+ +-- | The ISDA defined methodology for determining the final +-- price of the reference obligation for purposes of cash +-- settlement.+data ValuationMethodEnum+ = ValuationMethodEnum_Market+ | ValuationMethodEnum_Highest+ | ValuationMethodEnum_AverageMarket+ | ValuationMethodEnum_AverageHighest+ | ValuationMethodEnum_BlendedMarket+ | ValuationMethodEnum_BlendedHighest+ | ValuationMethodEnum_AverageBlendedMarket+ | ValuationMethodEnum_AverageBlendedHighest+ deriving (Eq,Show,Enum)+instance SchemaType ValuationMethodEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType ValuationMethodEnum where+ acceptingParser = do isWord "Market"; return ValuationMethodEnum_Market+ `onFail` do isWord "Highest"; return ValuationMethodEnum_Highest+ `onFail` do isWord "AverageMarket"; return ValuationMethodEnum_AverageMarket+ `onFail` do isWord "AverageHighest"; return ValuationMethodEnum_AverageHighest+ `onFail` do isWord "BlendedMarket"; return ValuationMethodEnum_BlendedMarket+ `onFail` do isWord "BlendedHighest"; return ValuationMethodEnum_BlendedHighest+ `onFail` do isWord "AverageBlendedMarket"; return ValuationMethodEnum_AverageBlendedMarket+ `onFail` do isWord "AverageBlendedHighest"; return ValuationMethodEnum_AverageBlendedHighest+ + simpleTypeText ValuationMethodEnum_Market = "Market"+ simpleTypeText ValuationMethodEnum_Highest = "Highest"+ simpleTypeText ValuationMethodEnum_AverageMarket = "AverageMarket"+ simpleTypeText ValuationMethodEnum_AverageHighest = "AverageHighest"+ simpleTypeText ValuationMethodEnum_BlendedMarket = "BlendedMarket"+ simpleTypeText ValuationMethodEnum_BlendedHighest = "BlendedHighest"+ simpleTypeText ValuationMethodEnum_AverageBlendedMarket = "AverageBlendedMarket"+ simpleTypeText ValuationMethodEnum_AverageBlendedHighest = "AverageBlendedHighest"+ +-- | The specification of a weekly roll day.+data WeeklyRollConventionEnum+ = WeeklyRollConventionEnum_MON+ -- ^ Monday+ | WeeklyRollConventionEnum_TUE+ -- ^ Tuesday+ | WeeklyRollConventionEnum_WED+ -- ^ Wednesday+ | WeeklyRollConventionEnum_THU+ -- ^ Thursday+ | WeeklyRollConventionEnum_FRI+ -- ^ Friday+ | WeeklyRollConventionEnum_SAT+ -- ^ Saturday+ | WeeklyRollConventionEnum_SUN+ -- ^ Sunday+ | WeeklyRollConventionEnum_TBILL+ -- ^ 13-week and 26-week U.S. Treasury Bill Auction Dates. Each + -- Monday except for U.S. (New York) holidays when it will + -- occur on a Tuesday.+ deriving (Eq,Show,Enum)+instance SchemaType WeeklyRollConventionEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType WeeklyRollConventionEnum where+ acceptingParser = do isWord "MON"; return WeeklyRollConventionEnum_MON+ `onFail` do isWord "TUE"; return WeeklyRollConventionEnum_TUE+ `onFail` do isWord "WED"; return WeeklyRollConventionEnum_WED+ `onFail` do isWord "THU"; return WeeklyRollConventionEnum_THU+ `onFail` do isWord "FRI"; return WeeklyRollConventionEnum_FRI+ `onFail` do isWord "SAT"; return WeeklyRollConventionEnum_SAT+ `onFail` do isWord "SUN"; return WeeklyRollConventionEnum_SUN+ `onFail` do isWord "TBILL"; return WeeklyRollConventionEnum_TBILL+ + simpleTypeText WeeklyRollConventionEnum_MON = "MON"+ simpleTypeText WeeklyRollConventionEnum_TUE = "TUE"+ simpleTypeText WeeklyRollConventionEnum_WED = "WED"+ simpleTypeText WeeklyRollConventionEnum_THU = "THU"+ simpleTypeText WeeklyRollConventionEnum_FRI = "FRI"+ simpleTypeText WeeklyRollConventionEnum_SAT = "SAT"+ simpleTypeText WeeklyRollConventionEnum_SUN = "SUN"+ simpleTypeText WeeklyRollConventionEnum_TBILL = "TBILL"+ +-- | The type of telephone number used to reach a contact.+data TelephoneTypeEnum+ = TelephoneTypeEnum_Work+ -- ^ A number used primarily for work-related calls. Includes + -- home office numbers used primarily for work purposes.+ | TelephoneTypeEnum_Mobile+ -- ^ A number on a mobile telephone or pager that is often or + -- usually used for work-related calls. This type of number + -- can be used for urgent work related business when a work + -- number is not sufficient to contact the person or firm.+ | TelephoneTypeEnum_Fax+ -- ^ A number used primarily for work-related facsimile + -- transmissions.+ | TelephoneTypeEnum_Personal+ -- ^ A number used primarily for nonwork-related calls. + -- (Normally this type of number would be used only as an + -- emergency backup number, not as a regular course of + -- business).+ deriving (Eq,Show,Enum)+instance SchemaType TelephoneTypeEnum where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s x = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType TelephoneTypeEnum where+ acceptingParser = do isWord "Work"; return TelephoneTypeEnum_Work+ `onFail` do isWord "Mobile"; return TelephoneTypeEnum_Mobile+ `onFail` do isWord "Fax"; return TelephoneTypeEnum_Fax+ `onFail` do isWord "Personal"; return TelephoneTypeEnum_Personal+ + simpleTypeText TelephoneTypeEnum_Work = "Work"+ simpleTypeText TelephoneTypeEnum_Mobile = "Mobile"+ simpleTypeText TelephoneTypeEnum_Fax = "Fax"+ simpleTypeText TelephoneTypeEnum_Personal = "Personal"
+ Data/FpML/V53/Enum.hs-boot view
@@ -0,0 +1,819 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Enum+ ( module Data.FpML.V53.Enum+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+ +-- | The type of averaging used in an Asian option. +data AveragingInOutEnum+instance Eq AveragingInOutEnum+instance Show AveragingInOutEnum+instance Enum AveragingInOutEnum+instance SchemaType AveragingInOutEnum+instance SimpleType AveragingInOutEnum+ +-- | The method of calculation to be used when averaging rates. +-- Per ISDA 2000 Definitions, Section 6.2. Certain Definitions +-- Relating to Floating Amounts. +data AveragingMethodEnum+instance Eq AveragingMethodEnum+instance Show AveragingMethodEnum+instance Enum AveragingMethodEnum+instance SchemaType AveragingMethodEnum+instance SimpleType AveragingMethodEnum+ +-- | When breakage cost is applicable, defines who is +-- calculating it. +data BreakageCostEnum+instance Eq BreakageCostEnum+instance Show BreakageCostEnum+instance Enum BreakageCostEnum+instance SchemaType BreakageCostEnum+instance SimpleType BreakageCostEnum+ +-- | Defines which type of bullion is applicable for a Bullion +-- Transaction. +data BullionTypeEnum+instance Eq BullionTypeEnum+instance Show BullionTypeEnum+instance Enum BullionTypeEnum+instance SchemaType BullionTypeEnum+instance SimpleType BullionTypeEnum+ +-- | The convention for adjusting any relevant date if it would +-- otherwise fall on a day that is not a valid business day. +-- Note that FRN is included here as a type of business day +-- convention although it does not strictly fall within ISDA's +-- definition of a Business Day Convention and does not +-- conform to the simple definition given above. +data BusinessDayConventionEnum+instance Eq BusinessDayConventionEnum+instance Show BusinessDayConventionEnum+instance Enum BusinessDayConventionEnum+instance SchemaType BusinessDayConventionEnum+instance SimpleType BusinessDayConventionEnum+ +-- | Shows how the transaction is to be settled when it is +-- exercised. +data CashPhysicalEnum+instance Eq CashPhysicalEnum+instance Show CashPhysicalEnum+instance Enum CashPhysicalEnum+instance SchemaType CashPhysicalEnum+instance SimpleType CashPhysicalEnum+ +-- | The specification of how a calculation agent will be +-- determined. +data CalculationAgentPartyEnum+instance Eq CalculationAgentPartyEnum+instance Show CalculationAgentPartyEnum+instance Enum CalculationAgentPartyEnum+instance SchemaType CalculationAgentPartyEnum+instance SimpleType CalculationAgentPartyEnum+ +-- | The unit in which a commission is denominated. +data CommissionDenominationEnum+instance Eq CommissionDenominationEnum+instance Show CommissionDenominationEnum+instance Enum CommissionDenominationEnum+instance SchemaType CommissionDenominationEnum+instance SimpleType CommissionDenominationEnum+ +-- | The consequences of Bullion Settlement Disruption Events. +data CommodityBullionSettlementDisruptionEnum+instance Eq CommodityBullionSettlementDisruptionEnum+instance Show CommodityBullionSettlementDisruptionEnum+instance Enum CommodityBullionSettlementDisruptionEnum+instance SchemaType CommodityBullionSettlementDisruptionEnum+instance SimpleType CommodityBullionSettlementDisruptionEnum+ +-- | A day type classification used in counting the number of +-- days between two dates for a commodity transaction. +data CommodityDayTypeEnum+instance Eq CommodityDayTypeEnum+instance Show CommodityDayTypeEnum+instance Enum CommodityDayTypeEnum+instance SchemaType CommodityDayTypeEnum+instance SimpleType CommodityDayTypeEnum+ +-- | The compounding calculation method +data CompoundingMethodEnum+instance Eq CompoundingMethodEnum+instance Show CompoundingMethodEnum+instance Enum CompoundingMethodEnum+instance SchemaType CompoundingMethodEnum+instance SimpleType CompoundingMethodEnum+ +-- | A day of the seven-day week. +data DayOfWeekEnum+instance Eq DayOfWeekEnum+instance Show DayOfWeekEnum+instance Enum DayOfWeekEnum+instance SchemaType DayOfWeekEnum+instance SimpleType DayOfWeekEnum+ +-- | A day type classification used in counting the number of +-- days between two dates. +data DayTypeEnum+instance Eq DayTypeEnum+instance Show DayTypeEnum+instance Enum DayTypeEnum+instance SchemaType DayTypeEnum+instance SimpleType DayTypeEnum+ +data DealtCurrencyEnum+instance Eq DealtCurrencyEnum+instance Show DealtCurrencyEnum+instance Enum DealtCurrencyEnum+instance SchemaType DealtCurrencyEnum+instance SimpleType DealtCurrencyEnum+ +-- | In respect of a Transaction and a Commodity Reference +-- Price, the relevant date or month for delivery of the +-- underlying Commodity. +data DeliveryDatesEnum+instance Eq DeliveryDatesEnum+instance Show DeliveryDatesEnum+instance Enum DeliveryDatesEnum+instance SchemaType DeliveryDatesEnum+instance SimpleType DeliveryDatesEnum+ +data DeliveryTypeEnum+instance Eq DeliveryTypeEnum+instance Show DeliveryTypeEnum+instance Enum DeliveryTypeEnum+instance SchemaType DeliveryTypeEnum+instance SimpleType DeliveryTypeEnum+ +-- | The ISDA defined value indicating the severity of a +-- difference. +data DifferenceSeverityEnum+instance Eq DifferenceSeverityEnum+instance Show DifferenceSeverityEnum+instance Enum DifferenceSeverityEnum+instance SchemaType DifferenceSeverityEnum+instance SimpleType DifferenceSeverityEnum+ +-- | The ISDA defined value indicating the nature of a +-- difference. +data DifferenceTypeEnum+instance Eq DifferenceTypeEnum+instance Show DifferenceTypeEnum+instance Enum DifferenceTypeEnum+instance SchemaType DifferenceTypeEnum+instance SimpleType DifferenceTypeEnum+ +-- | The method of calculating discounted payment amounts +data DiscountingTypeEnum+instance Eq DiscountingTypeEnum+instance Show DiscountingTypeEnum+instance Enum DiscountingTypeEnum+instance SchemaType DiscountingTypeEnum+instance SimpleType DiscountingTypeEnum+ +-- | The specification of how disruption fallbacks will be +-- represented. +data DisruptionFallbacksEnum+instance Eq DisruptionFallbacksEnum+instance Show DisruptionFallbacksEnum+instance Enum DisruptionFallbacksEnum+instance SchemaType DisruptionFallbacksEnum+instance SimpleType DisruptionFallbacksEnum+ +-- | Refers to one on the 3 Amounts +data DividendAmountTypeEnum+instance Eq DividendAmountTypeEnum+instance Show DividendAmountTypeEnum+instance Enum DividendAmountTypeEnum+instance SchemaType DividendAmountTypeEnum+instance SimpleType DividendAmountTypeEnum+ +-- | Defines how the composition of dividends is to be +-- determined. +data DividendCompositionEnum+instance Eq DividendCompositionEnum+instance Show DividendCompositionEnum+instance Enum DividendCompositionEnum+instance SchemaType DividendCompositionEnum+instance SimpleType DividendCompositionEnum+ +-- | The reference to a dividend date. +data DividendDateReferenceEnum+instance Eq DividendDateReferenceEnum+instance Show DividendDateReferenceEnum+instance Enum DividendDateReferenceEnum+instance SchemaType DividendDateReferenceEnum+instance SimpleType DividendDateReferenceEnum+ +-- | The date on which the receiver of the equity return is +-- entitled to the dividend. +data DividendEntitlementEnum+instance Eq DividendEntitlementEnum+instance Show DividendEntitlementEnum+instance Enum DividendEntitlementEnum+instance SchemaType DividendEntitlementEnum+instance SimpleType DividendEntitlementEnum+ +-- | Defines the First Period or the Second Period, as specified +-- in the 2002 ISDA Equity Derivatives Definitions. +data DividendPeriodEnum+instance Eq DividendPeriodEnum+instance Show DividendPeriodEnum+instance Enum DividendPeriodEnum+instance SchemaType DividendPeriodEnum+instance SimpleType DividendPeriodEnum+ +-- | A type which permits the Dual Currency strike quote basis +-- to be expressed in terms of the deposit and alternate +-- currencies. +data DualCurrencyStrikeQuoteBasisEnum+instance Eq DualCurrencyStrikeQuoteBasisEnum+instance Show DualCurrencyStrikeQuoteBasisEnum+instance Enum DualCurrencyStrikeQuoteBasisEnum+instance SchemaType DualCurrencyStrikeQuoteBasisEnum+instance SimpleType DualCurrencyStrikeQuoteBasisEnum+ +-- | The type of electricity product. +data ElectricityProductTypeEnum+instance Eq ElectricityProductTypeEnum+instance Show ElectricityProductTypeEnum+instance Enum ElectricityProductTypeEnum+instance SchemaType ElectricityProductTypeEnum+instance SimpleType ElectricityProductTypeEnum+ +-- | Specifies an additional Forward type. +data EquityOptionTypeEnum+instance Eq EquityOptionTypeEnum+instance Show EquityOptionTypeEnum+instance Enum EquityOptionTypeEnum+instance SchemaType EquityOptionTypeEnum+instance SimpleType EquityOptionTypeEnum+ +-- | The specification of how an OTC option will be exercised. +data ExerciseStyleEnum+instance Eq ExerciseStyleEnum+instance Show ExerciseStyleEnum+instance Enum ExerciseStyleEnum+instance SchemaType ExerciseStyleEnum+instance SimpleType ExerciseStyleEnum+ +-- | Defines the fee type. +data FeeElectionEnum+instance Eq FeeElectionEnum+instance Show FeeElectionEnum+instance Enum FeeElectionEnum+instance SchemaType FeeElectionEnum+instance SimpleType FeeElectionEnum+ +-- | The method by which the Flat Rate is calculated for a +-- commodity freight transaction. +data FlatRateEnum+instance Eq FlatRateEnum+instance Show FlatRateEnum+instance Enum FlatRateEnum+instance SchemaType FlatRateEnum+instance SimpleType FlatRateEnum+ +-- | Specifies the fallback provisions in respect to the +-- applicable Futures Price Valuation. +data FPVFinalPriceElectionFallbackEnum+instance Eq FPVFinalPriceElectionFallbackEnum+instance Show FPVFinalPriceElectionFallbackEnum+instance Enum FPVFinalPriceElectionFallbackEnum+instance SchemaType FPVFinalPriceElectionFallbackEnum+instance SimpleType FPVFinalPriceElectionFallbackEnum+ +-- | The method of FRA discounting, if any, that will apply. +data FraDiscountingEnum+instance Eq FraDiscountingEnum+instance Show FraDiscountingEnum+instance Enum FraDiscountingEnum+instance SchemaType FraDiscountingEnum+instance SimpleType FraDiscountingEnum+ +-- | The schedule frequency type +data FrequencyTypeEnum+instance Eq FrequencyTypeEnum+instance Show FrequencyTypeEnum+instance Enum FrequencyTypeEnum+instance SchemaType FrequencyTypeEnum+instance SimpleType FrequencyTypeEnum+ +-- | The specification of whether a barrier within an FX OTC +-- option is a knockin or knockout, as well as whether it is a +-- standard barrier or a reverse barrier. +data FxBarrierTypeEnum+instance Eq FxBarrierTypeEnum+instance Show FxBarrierTypeEnum+instance Enum FxBarrierTypeEnum+instance SchemaType FxBarrierTypeEnum+instance SimpleType FxBarrierTypeEnum+ +-- | The specification of a time period containing values such +-- as Today, Tomorrow etc. +data FxTenorPeriodEnum+instance Eq FxTenorPeriodEnum+instance Show FxTenorPeriodEnum+instance Enum FxTenorPeriodEnum+instance SchemaType FxTenorPeriodEnum+instance SimpleType FxTenorPeriodEnum+ +-- | The type of gas product. +data GasProductTypeEnum+instance Eq GasProductTypeEnum+instance Show GasProductTypeEnum+instance Enum GasProductTypeEnum+instance SchemaType GasProductTypeEnum+instance SimpleType GasProductTypeEnum+ +-- | The type of independent amount convention. +data IndependentAmountConventionEnum+instance Eq IndependentAmountConventionEnum+instance Show IndependentAmountConventionEnum+instance Enum IndependentAmountConventionEnum+instance SchemaType IndependentAmountConventionEnum+instance SimpleType IndependentAmountConventionEnum+ +-- | The specification of the consequences of Index Events. +data IndexEventConsequenceEnum+instance Eq IndexEventConsequenceEnum+instance Show IndexEventConsequenceEnum+instance Enum IndexEventConsequenceEnum+instance SchemaType IndexEventConsequenceEnum+instance SimpleType IndexEventConsequenceEnum+ +-- | >Defines whether agent bank is making an interest +-- payment based on the lender pro-rata share at the end of +-- the period or based on the lender position throughout the +-- period. Agent Banks decide which way to calculate the +-- interest for a deal. +data InterestCalculationMethodEnum+instance Eq InterestCalculationMethodEnum+instance Show InterestCalculationMethodEnum+instance Enum InterestCalculationMethodEnum+instance SchemaType InterestCalculationMethodEnum+instance SimpleType InterestCalculationMethodEnum+ +-- | The type of calculation. +data InterestCalculationTypeEnum+instance Eq InterestCalculationTypeEnum+instance Show InterestCalculationTypeEnum+instance Enum InterestCalculationTypeEnum+instance SchemaType InterestCalculationTypeEnum+instance SimpleType InterestCalculationTypeEnum+ +-- | The type of method. +data InterestMethodEnum+instance Eq InterestMethodEnum+instance Show InterestMethodEnum+instance Enum InterestMethodEnum+instance SchemaType InterestMethodEnum+instance SimpleType InterestMethodEnum+ +-- | The specification of the interest shortfall cap, applicable +-- to mortgage derivatives. +data InterestShortfallCapEnum+instance Eq InterestShortfallCapEnum+instance Show InterestShortfallCapEnum+instance Enum InterestShortfallCapEnum+instance SchemaType InterestShortfallCapEnum+instance SimpleType InterestShortfallCapEnum+ +-- | Defines applicable periods for interpolation. +data InterpolationPeriodEnum+instance Eq InterpolationPeriodEnum+instance Show InterpolationPeriodEnum+instance Enum InterpolationPeriodEnum+instance SchemaType InterpolationPeriodEnum+instance SimpleType InterpolationPeriodEnum+ +-- | Used for indicating the length unit in the Resource type. +data LengthUnitEnum+instance Eq LengthUnitEnum+instance Show LengthUnitEnum+instance Enum LengthUnitEnum+instance SchemaType LengthUnitEnum+instance SimpleType LengthUnitEnum+ +-- | The specification of how market disruption events will be +-- represented. +data MarketDisruptionEventsEnum+instance Eq MarketDisruptionEventsEnum+instance Show MarketDisruptionEventsEnum+instance Enum MarketDisruptionEventsEnum+instance SchemaType MarketDisruptionEventsEnum+instance SimpleType MarketDisruptionEventsEnum+ +-- | The type of mark to market convention. +data MarkToMarketConventionEnum+instance Eq MarkToMarketConventionEnum+instance Show MarkToMarketConventionEnum+instance Enum MarkToMarketConventionEnum+instance SchemaType MarkToMarketConventionEnum+instance SimpleType MarkToMarketConventionEnum+ +-- | Defines how adjustments will be made to the contract should +-- one or more of the extraordinary events occur. +data MethodOfAdjustmentEnum+instance Eq MethodOfAdjustmentEnum+instance Show MethodOfAdjustmentEnum+instance Enum MethodOfAdjustmentEnum+instance SchemaType MethodOfAdjustmentEnum+instance SimpleType MethodOfAdjustmentEnum+ +-- | Defines the consequences of nationalisation, insolvency and +-- delisting events relating to the underlying. +data NationalisationOrInsolvencyOrDelistingEventEnum+instance Eq NationalisationOrInsolvencyOrDelistingEventEnum+instance Show NationalisationOrInsolvencyOrDelistingEventEnum+instance Enum NationalisationOrInsolvencyOrDelistingEventEnum+instance SchemaType NationalisationOrInsolvencyOrDelistingEventEnum+instance SimpleType NationalisationOrInsolvencyOrDelistingEventEnum+ +-- | The method of calculating payment obligations when a +-- floating rate is negative (either due to a quoted negative +-- floating rate or by operation of a spread that is +-- subtracted from the floating rate). +data NegativeInterestRateTreatmentEnum+instance Eq NegativeInterestRateTreatmentEnum+instance Show NegativeInterestRateTreatmentEnum+instance Enum NegativeInterestRateTreatmentEnum+instance SchemaType NegativeInterestRateTreatmentEnum+instance SimpleType NegativeInterestRateTreatmentEnum+ +-- | Defines treatment of non-cash dividends. +data NonCashDividendTreatmentEnum+instance Eq NonCashDividendTreatmentEnum+instance Show NonCashDividendTreatmentEnum+instance Enum NonCashDividendTreatmentEnum+instance SchemaType NonCashDividendTreatmentEnum+instance SimpleType NonCashDividendTreatmentEnum+ +-- | The conditions that govern the adjustment to the number of +-- units of the equity swap. +data NotionalAdjustmentEnum+instance Eq NotionalAdjustmentEnum+instance Show NotionalAdjustmentEnum+instance Enum NotionalAdjustmentEnum+instance SchemaType NotionalAdjustmentEnum+instance SimpleType NotionalAdjustmentEnum+ +-- | Used in both the obligations and deliverable obligations of +-- the credit default swap to represent a class or type of +-- securities which apply. +data ObligationCategoryEnum+instance Eq ObligationCategoryEnum+instance Show ObligationCategoryEnum+instance Enum ObligationCategoryEnum+instance SchemaType ObligationCategoryEnum+instance SimpleType ObligationCategoryEnum+ +-- | Specifies the type of the option. +data OptionTypeEnum+instance Eq OptionTypeEnum+instance Show OptionTypeEnum+instance Enum OptionTypeEnum+instance SchemaType OptionTypeEnum+instance SimpleType OptionTypeEnum+ +-- | The specification of an interest rate stream payer or +-- receiver party. +data PayerReceiverEnum+instance Eq PayerReceiverEnum+instance Show PayerReceiverEnum+instance Enum PayerReceiverEnum+instance SchemaType PayerReceiverEnum+instance SimpleType PayerReceiverEnum+ +-- | The specification of how an FX OTC option with a trigger +-- payout will be paid if the trigger condition is met. The +-- contract will specify whether the payout will occur +-- immediately or on the original value date of the option. +data PayoutEnum+instance Eq PayoutEnum+instance Show PayoutEnum+instance Enum PayoutEnum+instance SchemaType PayoutEnum+instance SimpleType PayoutEnum+ +-- | The specification of whether payments occur relative to the +-- calculation period start or end date, or the reset date. +data PayRelativeToEnum+instance Eq PayRelativeToEnum+instance Show PayRelativeToEnum+instance Enum PayRelativeToEnum+instance SchemaType PayRelativeToEnum+instance SimpleType PayRelativeToEnum+ +-- | The specification of a time period +data PeriodEnum+instance Eq PeriodEnum+instance Show PeriodEnum+instance Enum PeriodEnum+instance SchemaType PeriodEnum+instance SimpleType PeriodEnum+ +-- | The specification of a time period containing additional +-- values such as Term. +data PeriodExtendedEnum+instance Eq PeriodExtendedEnum+instance Show PeriodExtendedEnum+instance Enum PeriodExtendedEnum+instance SchemaType PeriodExtendedEnum+instance SimpleType PeriodExtendedEnum+ +-- | A type used to report how a position originated. +data PositionOriginEnum+instance Eq PositionOriginEnum+instance Show PositionOriginEnum+instance Enum PositionOriginEnum+instance SchemaType PositionOriginEnum+instance SimpleType PositionOriginEnum+ +data PositionStatusEnum+instance Eq PositionStatusEnum+instance Show PositionStatusEnum+instance Enum PositionStatusEnum+instance SchemaType PositionStatusEnum+instance SimpleType PositionStatusEnum+ +-- | The specification of how the premium for an FX OTC option +-- is quoted. +data PremiumQuoteBasisEnum+instance Eq PremiumQuoteBasisEnum+instance Show PremiumQuoteBasisEnum+instance Enum PremiumQuoteBasisEnum+instance SchemaType PremiumQuoteBasisEnum+instance SimpleType PremiumQuoteBasisEnum+ +-- | Premium Type for Forward Start Equity Option +data PremiumTypeEnum+instance Eq PremiumTypeEnum+instance Show PremiumTypeEnum+instance Enum PremiumTypeEnum+instance SchemaType PremiumTypeEnum+instance SimpleType PremiumTypeEnum+ +-- | The mode of expression of a price. +data PriceExpressionEnum+instance Eq PriceExpressionEnum+instance Show PriceExpressionEnum+instance Enum PriceExpressionEnum+instance SchemaType PriceExpressionEnum+instance SimpleType PriceExpressionEnum+ +-- | Specifies whether the option is a call or a put. +data PutCallEnum+instance Eq PutCallEnum+instance Show PutCallEnum+instance Enum PutCallEnum+instance SchemaType PutCallEnum+instance SimpleType PutCallEnum+ +-- | The specification of the type of quotation rate to be +-- obtained from each cash settlement reference bank. +data QuotationRateTypeEnum+instance Eq QuotationRateTypeEnum+instance Show QuotationRateTypeEnum+instance Enum QuotationRateTypeEnum+instance SchemaType QuotationRateTypeEnum+instance SimpleType QuotationRateTypeEnum+ +-- | The side from which perspective a value is quoted. +data QuotationSideEnum+instance Eq QuotationSideEnum+instance Show QuotationSideEnum+instance Enum QuotationSideEnum+instance SchemaType QuotationSideEnum+instance SimpleType QuotationSideEnum+ +-- | Indicates the actual quotation style of of PointsUpFront or +-- TradedSpread that was used to quote this trade. +data QuotationStyleEnum+instance Eq QuotationStyleEnum+instance Show QuotationStyleEnum+instance Enum QuotationStyleEnum+instance SchemaType QuotationStyleEnum+instance SimpleType QuotationStyleEnum+ +-- | How an exchange rate is quoted. +data QuoteBasisEnum+instance Eq QuoteBasisEnum+instance Show QuoteBasisEnum+instance Enum QuoteBasisEnum+instance SchemaType QuoteBasisEnum+instance SimpleType QuoteBasisEnum+ +-- | The specification of methods for converting rates from one +-- basis to another. +data RateTreatmentEnum+instance Eq RateTreatmentEnum+instance Show RateTreatmentEnum+instance Enum RateTreatmentEnum+instance SchemaType RateTreatmentEnum+instance SimpleType RateTreatmentEnum+ +-- | The contract specifies whether which price must satisfy the +-- boundary condition. +data RealisedVarianceMethodEnum+instance Eq RealisedVarianceMethodEnum+instance Show RealisedVarianceMethodEnum+instance Enum RealisedVarianceMethodEnum+instance SchemaType RealisedVarianceMethodEnum+instance SimpleType RealisedVarianceMethodEnum+ +-- | The specification of whether resets occur relative to the +-- first or last day of a calculation period. +data ResetRelativeToEnum+instance Eq ResetRelativeToEnum+instance Show ResetRelativeToEnum+instance Enum ResetRelativeToEnum+instance SchemaType ResetRelativeToEnum+instance SimpleType ResetRelativeToEnum+ +-- | The type of return associated with the equity swap. +data ReturnTypeEnum+instance Eq ReturnTypeEnum+instance Show ReturnTypeEnum+instance Enum ReturnTypeEnum+instance SchemaType ReturnTypeEnum+instance SimpleType ReturnTypeEnum+ +-- | The convention for determining the sequence of calculation +-- period end dates. It is used in conjunction with a +-- specified frequency and the regular period start date of a +-- calculation period, e.g. semi-annual IMM roll dates. +data RollConventionEnum+instance Eq RollConventionEnum+instance Show RollConventionEnum+instance Enum RollConventionEnum+instance SchemaType RollConventionEnum+instance SimpleType RollConventionEnum+ +-- | The method of rounding a fractional number. +data RoundingDirectionEnum+instance Eq RoundingDirectionEnum+instance Show RoundingDirectionEnum+instance Enum RoundingDirectionEnum+instance SchemaType RoundingDirectionEnum+instance SimpleType RoundingDirectionEnum+ +-- | Defines the Settlement Period Duration for an Electricity +-- Transaction. +data SettlementPeriodDurationEnum+instance Eq SettlementPeriodDurationEnum+instance Show SettlementPeriodDurationEnum+instance Enum SettlementPeriodDurationEnum+instance SchemaType SettlementPeriodDurationEnum+instance SimpleType SettlementPeriodDurationEnum+ +-- | Shows how the transaction is to be settled when it is +-- exercised. +data SettlementTypeEnum+instance Eq SettlementTypeEnum+instance Show SettlementTypeEnum+instance Enum SettlementTypeEnum+instance SchemaType SettlementTypeEnum+instance SimpleType SettlementTypeEnum+ +-- | Defines the consequences of extraordinary events relating +-- to the underlying. +data ShareExtraordinaryEventEnum+instance Eq ShareExtraordinaryEventEnum+instance Show ShareExtraordinaryEventEnum+instance Enum ShareExtraordinaryEventEnum+instance SchemaType ShareExtraordinaryEventEnum+instance SimpleType ShareExtraordinaryEventEnum+ +-- | The Specified Price in respect of a Transaction and a +-- Commodity Reference Price. +data SpecifiedPriceEnum+instance Eq SpecifiedPriceEnum+instance Show SpecifiedPriceEnum+instance Enum SpecifiedPriceEnum+instance SchemaType SpecifiedPriceEnum+instance SimpleType SpecifiedPriceEnum+ +-- | The code specification of whether a trade is settling using +-- standard settlement instructions as well as whether it is a +-- candidate for settlement netting. +data StandardSettlementStyleEnum+instance Eq StandardSettlementStyleEnum+instance Show StandardSettlementStyleEnum+instance Enum StandardSettlementStyleEnum+instance SchemaType StandardSettlementStyleEnum+instance SimpleType StandardSettlementStyleEnum+ +-- | The specification of whether a percentage rate change, used +-- to calculate a change in notional outstanding, is expressed +-- as a percentage of the initial notional amount or the +-- previously outstanding notional amount. +data StepRelativeToEnum+instance Eq StepRelativeToEnum+instance Show StepRelativeToEnum+instance Enum StepRelativeToEnum+instance SchemaType StepRelativeToEnum+instance SimpleType StepRelativeToEnum+ +-- | Element to define how to deal with a none standard +-- calculation period within a swap stream. +data StubPeriodTypeEnum+instance Eq StubPeriodTypeEnum+instance Show StubPeriodTypeEnum+instance Enum StubPeriodTypeEnum+instance SchemaType StubPeriodTypeEnum+instance SimpleType StubPeriodTypeEnum+ +-- | The specification of how an FX OTC option strike price is +-- quoted. +data StrikeQuoteBasisEnum+instance Eq StrikeQuoteBasisEnum+instance Show StrikeQuoteBasisEnum+instance Enum StrikeQuoteBasisEnum+instance SchemaType StrikeQuoteBasisEnum+instance SimpleType StrikeQuoteBasisEnum+ +-- | The type of threshold. +data ThresholdTypeEnum+instance Eq ThresholdTypeEnum+instance Show ThresholdTypeEnum+instance Enum ThresholdTypeEnum+instance SchemaType ThresholdTypeEnum+instance SimpleType ThresholdTypeEnum+ +-- | Defines points in the day when equity option exercise and +-- valuation can occur. +data TimeTypeEnum+instance Eq TimeTypeEnum+instance Show TimeTypeEnum+instance Enum TimeTypeEnum+instance SchemaType TimeTypeEnum+instance SimpleType TimeTypeEnum+ +-- | The time of day which would be considered for valuing the +-- knock event. +data TriggerTimeTypeEnum+instance Eq TriggerTimeTypeEnum+instance Show TriggerTimeTypeEnum+instance Enum TriggerTimeTypeEnum+instance SchemaType TriggerTimeTypeEnum+instance SimpleType TriggerTimeTypeEnum+ +-- | The specification of whether an option would trigger or +-- expire depending upon whether the spot rate is above or +-- below the barrier rate. +data TriggerTypeEnum+instance Eq TriggerTypeEnum+instance Show TriggerTypeEnum+instance Enum TriggerTypeEnum+instance SchemaType TriggerTypeEnum+instance SimpleType TriggerTypeEnum+ +-- | The specification of, for American-style digitals, whether +-- the trigger level must be touched or not touched. +data TouchConditionEnum+instance Eq TouchConditionEnum+instance Show TouchConditionEnum+instance Enum TouchConditionEnum+instance SchemaType TouchConditionEnum+instance SimpleType TouchConditionEnum+ +-- | The specification of whether a payout will occur on an +-- option depending upon whether the spot rate is above or +-- below the trigger rate. +data TriggerConditionEnum+instance Eq TriggerConditionEnum+instance Show TriggerConditionEnum+instance Enum TriggerConditionEnum+instance SchemaType TriggerConditionEnum+instance SimpleType TriggerConditionEnum+ +-- | The ISDA defined methodology for determining the final +-- price of the reference obligation for purposes of cash +-- settlement. +data ValuationMethodEnum+instance Eq ValuationMethodEnum+instance Show ValuationMethodEnum+instance Enum ValuationMethodEnum+instance SchemaType ValuationMethodEnum+instance SimpleType ValuationMethodEnum+ +-- | The specification of a weekly roll day. +data WeeklyRollConventionEnum+instance Eq WeeklyRollConventionEnum+instance Show WeeklyRollConventionEnum+instance Enum WeeklyRollConventionEnum+instance SchemaType WeeklyRollConventionEnum+instance SimpleType WeeklyRollConventionEnum+ +-- | The type of telephone number used to reach a contact. +data TelephoneTypeEnum+instance Eq TelephoneTypeEnum+instance Show TelephoneTypeEnum+instance Enum TelephoneTypeEnum+instance SchemaType TelephoneTypeEnum+instance SimpleType TelephoneTypeEnum
+ Data/FpML/V53/Eqd.hs view
@@ -0,0 +1,1168 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Eqd+ ( module Data.FpML.V53.Eqd+ , module Data.FpML.V53.Shared.EQ+ ) 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+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | A type for defining the broker equity options.+data BrokerEquityOption = BrokerEquityOption+ { brokerEquityOption_ID :: Maybe Xsd.ID+ , brokerEquityOption_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , brokerEquityOption_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , brokerEquityOption_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , brokerEquityOption_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , brokerEquityOption_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , brokerEquityOption_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , brokerEquityOption_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , brokerEquityOption_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , brokerEquityOption_optionType :: Maybe EquityOptionTypeEnum+ -- ^ The type of option transaction.+ , brokerEquityOption_equityEffectiveDate :: Maybe Xsd.Date+ -- ^ Effective date for a forward starting option.+ , brokerEquityOption_underlyer :: Maybe Underlyer+ -- ^ Specifies the underlying component, which can be either one + -- or many and consists in either equity, index or convertible + -- bond component, or a combination of these.+ , brokerEquityOption_notional :: Maybe NonNegativeMoney+ -- ^ The notional amount.+ , brokerEquityOption_equityExercise :: Maybe EquityExerciseValuationSettlement+ -- ^ The parameters for defining how the equity option can be + -- exercised, how it is valued and how it is settled.+ , brokerEquityOption_feature :: Maybe OptionFeatures+ -- ^ Asian, Barrier, Knock and Pass Through features.+ , brokerEquityOption_fxFeature :: Maybe FxFeature+ -- ^ Quanto, Composite, or Cross Currency FX features.+ , brokerEquityOption_strategyFeature :: Maybe StrategyFeature+ -- ^ A equity option simple strategy feature.+ , brokerEquityOption_strike :: Maybe EquityStrike+ -- ^ Defines whether it is a price or level at which the option + -- has been, or will be, struck.+ , brokerEquityOption_spotPrice :: Maybe NonNegativeDecimal+ -- ^ The price per share, index or basket observed on the trade + -- or effective date.+ , brokerEquityOption_numberOfOptions :: Maybe NonNegativeDecimal+ -- ^ The number of options comprised in the option transaction.+ , brokerEquityOption_equityPremium :: Maybe EquityPremium+ -- ^ The equity option premium payable by the buyer to the + -- seller.+ , brokerEquityOption_deltaCrossed :: Maybe Xsd.Boolean+ , brokerEquityOption_brokerageFee :: Maybe Money+ , brokerEquityOption_brokerNotes :: Maybe Xsd.XsdString+ }+ deriving (Eq,Show)+instance SchemaType BrokerEquityOption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (BrokerEquityOption 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 (parseSchemaType "optionType")+ `apply` optional (parseSchemaType "equityEffectiveDate")+ `apply` optional (parseSchemaType "underlyer")+ `apply` optional (parseSchemaType "notional")+ `apply` optional (parseSchemaType "equityExercise")+ `apply` optional (parseSchemaType "feature")+ `apply` optional (parseSchemaType "fxFeature")+ `apply` optional (parseSchemaType "strategyFeature")+ `apply` optional (parseSchemaType "strike")+ `apply` optional (parseSchemaType "spotPrice")+ `apply` optional (parseSchemaType "numberOfOptions")+ `apply` optional (parseSchemaType "equityPremium")+ `apply` optional (parseSchemaType "deltaCrossed")+ `apply` optional (parseSchemaType "brokerageFee")+ `apply` optional (parseSchemaType "brokerNotes")+ schemaTypeToXML s x@BrokerEquityOption{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ brokerEquityOption_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ brokerEquityOption_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ brokerEquityOption_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ brokerEquityOption_productType x+ , concatMap (schemaTypeToXML "productId") $ brokerEquityOption_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ brokerEquityOption_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ brokerEquityOption_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ brokerEquityOption_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ brokerEquityOption_sellerAccountReference x+ , maybe [] (schemaTypeToXML "optionType") $ brokerEquityOption_optionType x+ , maybe [] (schemaTypeToXML "equityEffectiveDate") $ brokerEquityOption_equityEffectiveDate x+ , maybe [] (schemaTypeToXML "underlyer") $ brokerEquityOption_underlyer x+ , maybe [] (schemaTypeToXML "notional") $ brokerEquityOption_notional x+ , maybe [] (schemaTypeToXML "equityExercise") $ brokerEquityOption_equityExercise x+ , maybe [] (schemaTypeToXML "feature") $ brokerEquityOption_feature x+ , maybe [] (schemaTypeToXML "fxFeature") $ brokerEquityOption_fxFeature x+ , maybe [] (schemaTypeToXML "strategyFeature") $ brokerEquityOption_strategyFeature x+ , maybe [] (schemaTypeToXML "strike") $ brokerEquityOption_strike x+ , maybe [] (schemaTypeToXML "spotPrice") $ brokerEquityOption_spotPrice x+ , maybe [] (schemaTypeToXML "numberOfOptions") $ brokerEquityOption_numberOfOptions x+ , maybe [] (schemaTypeToXML "equityPremium") $ brokerEquityOption_equityPremium x+ , maybe [] (schemaTypeToXML "deltaCrossed") $ brokerEquityOption_deltaCrossed x+ , maybe [] (schemaTypeToXML "brokerageFee") $ brokerEquityOption_brokerageFee x+ , maybe [] (schemaTypeToXML "brokerNotes") $ brokerEquityOption_brokerNotes x+ ]+instance Extension BrokerEquityOption EquityDerivativeShortFormBase where+ supertype v = EquityDerivativeShortFormBase_BrokerEquityOption v+instance Extension BrokerEquityOption EquityDerivativeBase where+ supertype = (supertype :: EquityDerivativeShortFormBase -> EquityDerivativeBase)+ . (supertype :: BrokerEquityOption -> EquityDerivativeShortFormBase)+ +instance Extension BrokerEquityOption Product where+ supertype = (supertype :: EquityDerivativeBase -> Product)+ . (supertype :: EquityDerivativeShortFormBase -> EquityDerivativeBase)+ . (supertype :: BrokerEquityOption -> EquityDerivativeShortFormBase)+ + +-- | A type for defining exercise procedures associated with an +-- American style exercise of an equity option. This entity +-- inherits from the type SharedAmericanExercise.+data EquityAmericanExercise = EquityAmericanExercise+ { equityAmericExerc_ID :: Maybe Xsd.ID+ , equityAmericExerc_commencementDate :: Maybe AdjustableOrRelativeDate+ -- ^ The first day of the exercise period for an American style + -- option.+ , equityAmericExerc_expirationDate :: Maybe AdjustableOrRelativeDate+ -- ^ The last day within an exercise period for an American + -- style option. For a European style option it is the only + -- day within the exercise period.+ , equityAmericExerc_choice2 :: (Maybe (OneOf2 BusinessCenterTime DeterminationMethod))+ -- ^ Choice between latest exercise time expressed as literal + -- time, or using a determination method.+ -- + -- Choice between:+ -- + -- (1) For a Bermuda or American style option, the latest time + -- on an exercise business day (excluding the expiration + -- date) within the exercise period that notice can be + -- given by the buyer to the seller or seller's agent. + -- Notice of exercise given after this time will be deemed + -- to have been given on the next exercise business day.+ -- + -- (2) Latest exercise time determination method.+ , equityAmericExerc_latestExerciseTimeType :: Maybe TimeTypeEnum+ -- ^ The latest time of day at which the equity option can be + -- exercised, for example the official closing time of the + -- exchange.+ , equityAmericExerc_choice4 :: (Maybe (OneOf2 ((Maybe (TimeTypeEnum)),(Maybe (BusinessCenterTime))) DeterminationMethod))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The time of day at which the equity option expires, + -- for example the official closing time of the + -- exchange.+ -- + -- * The specific time of day at which the equity option + -- expires.+ -- + -- (2) Expiration time determination method.+ , equityAmericExerc_equityMultipleExercise :: Maybe EquityMultipleExercise+ -- ^ The presence of this element indicates that the option may + -- be exercised on different days. It is not applicable to + -- European options.+ }+ deriving (Eq,Show)+instance SchemaType EquityAmericanExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (EquityAmericanExercise a0)+ `apply` optional (parseSchemaType "commencementDate")+ `apply` optional (parseSchemaType "expirationDate")+ `apply` optional (oneOf' [ ("BusinessCenterTime", fmap OneOf2 (parseSchemaType "latestExerciseTime"))+ , ("DeterminationMethod", fmap TwoOf2 (parseSchemaType "latestExerciseTimeDetermination"))+ ])+ `apply` optional (parseSchemaType "latestExerciseTimeType")+ `apply` optional (oneOf' [ ("Maybe TimeTypeEnum Maybe BusinessCenterTime", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "equityExpirationTimeType")+ `apply` optional (parseSchemaType "equityExpirationTime")))+ , ("DeterminationMethod", fmap TwoOf2 (parseSchemaType "expirationTimeDetermination"))+ ])+ `apply` optional (parseSchemaType "equityMultipleExercise")+ schemaTypeToXML s x@EquityAmericanExercise{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ equityAmericExerc_ID x+ ]+ [ maybe [] (schemaTypeToXML "commencementDate") $ equityAmericExerc_commencementDate x+ , maybe [] (schemaTypeToXML "expirationDate") $ equityAmericExerc_expirationDate x+ , maybe [] (foldOneOf2 (schemaTypeToXML "latestExerciseTime")+ (schemaTypeToXML "latestExerciseTimeDetermination")+ ) $ equityAmericExerc_choice2 x+ , maybe [] (schemaTypeToXML "latestExerciseTimeType") $ equityAmericExerc_latestExerciseTimeType x+ , maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "equityExpirationTimeType") a+ , maybe [] (schemaTypeToXML "equityExpirationTime") b+ ])+ (schemaTypeToXML "expirationTimeDetermination")+ ) $ equityAmericExerc_choice4 x+ , maybe [] (schemaTypeToXML "equityMultipleExercise") $ equityAmericExerc_equityMultipleExercise x+ ]+instance Extension EquityAmericanExercise SharedAmericanExercise where+ supertype (EquityAmericanExercise a0 e0 e1 e2 e3 e4 e5) =+ SharedAmericanExercise a0 e0 e1 e2+instance Extension EquityAmericanExercise Exercise where+ supertype = (supertype :: SharedAmericanExercise -> Exercise)+ . (supertype :: EquityAmericanExercise -> SharedAmericanExercise)+ + +-- | A type for defining exercise procedures associated with a +-- Bermuda style exercise of an equity option. The term +-- Bermuda is adopted in FpML for consistency with the ISDA +-- Definitions.+data EquityBermudaExercise = EquityBermudaExercise+ { equityBermudaExerc_ID :: Maybe Xsd.ID+ , equityBermudaExerc_commencementDate :: Maybe AdjustableOrRelativeDate+ -- ^ The first day of the exercise period for an American style + -- option.+ , equityBermudaExerc_expirationDate :: Maybe AdjustableOrRelativeDate+ -- ^ The last day within an exercise period for an American + -- style option. For a European style option it is the only + -- day within the exercise period.+ , equityBermudaExerc_choice2 :: (Maybe (OneOf2 BusinessCenterTime DeterminationMethod))+ -- ^ Choice between latest exercise time expressed as literal + -- time, or using a determination method.+ -- + -- Choice between:+ -- + -- (1) For a Bermuda or American style option, the latest time + -- on an exercise business day (excluding the expiration + -- date) within the exercise period that notice can be + -- given by the buyer to the seller or seller's agent. + -- Notice of exercise given after this time will be deemed + -- to have been given on the next exercise business day.+ -- + -- (2) Latest exercise time determination method.+ , equityBermudaExerc_bermudaExerciseDates :: Maybe DateList+ -- ^ List of Exercise Dates for a Bermuda option.+ , equityBermudaExerc_latestExerciseTimeType :: Maybe TimeTypeEnum+ -- ^ The latest time of day at which the equity option can be + -- exercised, for example the official closing time of the + -- exchange.+ , equityBermudaExerc_choice5 :: (Maybe (OneOf2 ((Maybe (TimeTypeEnum)),(Maybe (BusinessCenterTime))) DeterminationMethod))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The time of day at which the equity option expires, + -- for example the official closing time of the + -- exchange.+ -- + -- * The specific time of day at which the equity option + -- expires.+ -- + -- (2) Expiration time determination method.+ , equityBermudaExerc_equityMultipleExercise :: Maybe EquityMultipleExercise+ -- ^ The presence of this element indicates that the option may + -- be exercised on different days. It is not applicable to + -- European options.+ }+ deriving (Eq,Show)+instance SchemaType EquityBermudaExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (EquityBermudaExercise a0)+ `apply` optional (parseSchemaType "commencementDate")+ `apply` optional (parseSchemaType "expirationDate")+ `apply` optional (oneOf' [ ("BusinessCenterTime", fmap OneOf2 (parseSchemaType "latestExerciseTime"))+ , ("DeterminationMethod", fmap TwoOf2 (parseSchemaType "latestExerciseTimeDetermination"))+ ])+ `apply` optional (parseSchemaType "bermudaExerciseDates")+ `apply` optional (parseSchemaType "latestExerciseTimeType")+ `apply` optional (oneOf' [ ("Maybe TimeTypeEnum Maybe BusinessCenterTime", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "equityExpirationTimeType")+ `apply` optional (parseSchemaType "equityExpirationTime")))+ , ("DeterminationMethod", fmap TwoOf2 (parseSchemaType "expirationTimeDetermination"))+ ])+ `apply` optional (parseSchemaType "equityMultipleExercise")+ schemaTypeToXML s x@EquityBermudaExercise{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ equityBermudaExerc_ID x+ ]+ [ maybe [] (schemaTypeToXML "commencementDate") $ equityBermudaExerc_commencementDate x+ , maybe [] (schemaTypeToXML "expirationDate") $ equityBermudaExerc_expirationDate x+ , maybe [] (foldOneOf2 (schemaTypeToXML "latestExerciseTime")+ (schemaTypeToXML "latestExerciseTimeDetermination")+ ) $ equityBermudaExerc_choice2 x+ , maybe [] (schemaTypeToXML "bermudaExerciseDates") $ equityBermudaExerc_bermudaExerciseDates x+ , maybe [] (schemaTypeToXML "latestExerciseTimeType") $ equityBermudaExerc_latestExerciseTimeType x+ , maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "equityExpirationTimeType") a+ , maybe [] (schemaTypeToXML "equityExpirationTime") b+ ])+ (schemaTypeToXML "expirationTimeDetermination")+ ) $ equityBermudaExerc_choice5 x+ , maybe [] (schemaTypeToXML "equityMultipleExercise") $ equityBermudaExerc_equityMultipleExercise x+ ]+instance Extension EquityBermudaExercise SharedAmericanExercise where+ supertype (EquityBermudaExercise a0 e0 e1 e2 e3 e4 e5 e6) =+ SharedAmericanExercise a0 e0 e1 e2+instance Extension EquityBermudaExercise Exercise where+ supertype = (supertype :: SharedAmericanExercise -> Exercise)+ . (supertype :: EquityBermudaExercise -> SharedAmericanExercise)+ + +-- | A type for defining the common features of equity +-- derivatives.+data EquityDerivativeBase+ = EquityDerivativeBase_EquityDerivativeShortFormBase EquityDerivativeShortFormBase+ | EquityDerivativeBase_EquityDerivativeLongFormBase EquityDerivativeLongFormBase+ + deriving (Eq,Show)+instance SchemaType EquityDerivativeBase where+ parseSchemaType s = do+ (fmap EquityDerivativeBase_EquityDerivativeShortFormBase $ parseSchemaType s)+ `onFail`+ (fmap EquityDerivativeBase_EquityDerivativeLongFormBase $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of EquityDerivativeBase,\n\+\ namely one of:\n\+\EquityDerivativeShortFormBase,EquityDerivativeLongFormBase"+ schemaTypeToXML _s (EquityDerivativeBase_EquityDerivativeShortFormBase x) = schemaTypeToXML "equityDerivativeShortFormBase" x+ schemaTypeToXML _s (EquityDerivativeBase_EquityDerivativeLongFormBase x) = schemaTypeToXML "equityDerivativeLongFormBase" x+instance Extension EquityDerivativeBase Product where+ supertype v = Product_EquityDerivativeBase v+ +-- | type for defining the common features of equity +-- derivatives.+data EquityDerivativeLongFormBase+ = EquityDerivativeLongFormBase_EquityOption EquityOption+ | EquityDerivativeLongFormBase_EquityForward EquityForward+ + deriving (Eq,Show)+instance SchemaType EquityDerivativeLongFormBase where+ parseSchemaType s = do+ (fmap EquityDerivativeLongFormBase_EquityOption $ parseSchemaType s)+ `onFail`+ (fmap EquityDerivativeLongFormBase_EquityForward $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of EquityDerivativeLongFormBase,\n\+\ namely one of:\n\+\EquityOption,EquityForward"+ schemaTypeToXML _s (EquityDerivativeLongFormBase_EquityOption x) = schemaTypeToXML "equityOption" x+ schemaTypeToXML _s (EquityDerivativeLongFormBase_EquityForward x) = schemaTypeToXML "equityForward" x+instance Extension EquityDerivativeLongFormBase EquityDerivativeBase where+ supertype v = EquityDerivativeBase_EquityDerivativeLongFormBase v+ +-- | A type for defining short form equity option basic +-- features.+data EquityDerivativeShortFormBase+ = EquityDerivativeShortFormBase_EquityOptionTransactionSupplement EquityOptionTransactionSupplement+ | EquityDerivativeShortFormBase_BrokerEquityOption BrokerEquityOption+ + deriving (Eq,Show)+instance SchemaType EquityDerivativeShortFormBase where+ parseSchemaType s = do+ (fmap EquityDerivativeShortFormBase_EquityOptionTransactionSupplement $ parseSchemaType s)+ `onFail`+ (fmap EquityDerivativeShortFormBase_BrokerEquityOption $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of EquityDerivativeShortFormBase,\n\+\ namely one of:\n\+\EquityOptionTransactionSupplement,BrokerEquityOption"+ schemaTypeToXML _s (EquityDerivativeShortFormBase_EquityOptionTransactionSupplement x) = schemaTypeToXML "equityOptionTransactionSupplement" x+ schemaTypeToXML _s (EquityDerivativeShortFormBase_BrokerEquityOption x) = schemaTypeToXML "brokerEquityOption" x+instance Extension EquityDerivativeShortFormBase EquityDerivativeBase where+ supertype v = EquityDerivativeBase_EquityDerivativeShortFormBase v+ +-- | A type for defining exercise procedures associated with a +-- European style exercise of an equity option.+data EquityEuropeanExercise = EquityEuropeanExercise+ { equityEuropExerc_ID :: Maybe Xsd.ID+ , equityEuropExerc_expirationDate :: Maybe AdjustableOrRelativeDate+ -- ^ The last day within an exercise period for an American + -- style option. For a European style option it is the only + -- day within the exercise period.+ , equityEuropExerc_choice1 :: (Maybe (OneOf2 ((Maybe (TimeTypeEnum)),(Maybe (BusinessCenterTime))) DeterminationMethod))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The time of day at which the equity option expires, + -- for example the official closing time of the + -- exchange.+ -- + -- * The specific time of day at which the equity option + -- expires.+ -- + -- (2) Expiration time determination method.+ }+ deriving (Eq,Show)+instance SchemaType EquityEuropeanExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (EquityEuropeanExercise a0)+ `apply` optional (parseSchemaType "expirationDate")+ `apply` optional (oneOf' [ ("Maybe TimeTypeEnum Maybe BusinessCenterTime", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "equityExpirationTimeType")+ `apply` optional (parseSchemaType "equityExpirationTime")))+ , ("DeterminationMethod", fmap TwoOf2 (parseSchemaType "expirationTimeDetermination"))+ ])+ schemaTypeToXML s x@EquityEuropeanExercise{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ equityEuropExerc_ID x+ ]+ [ maybe [] (schemaTypeToXML "expirationDate") $ equityEuropExerc_expirationDate x+ , maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "equityExpirationTimeType") a+ , maybe [] (schemaTypeToXML "equityExpirationTime") b+ ])+ (schemaTypeToXML "expirationTimeDetermination")+ ) $ equityEuropExerc_choice1 x+ ]+instance Extension EquityEuropeanExercise Exercise where+ supertype v = Exercise_EquityEuropeanExercise v+ +-- | A type for defining exercise procedures for equity options.+data EquityExerciseValuationSettlement = EquityExerciseValuationSettlement+ { equityExercValSettl_choice0 :: (Maybe (OneOf3 EquityEuropeanExercise EquityAmericanExercise EquityBermudaExercise))+ -- ^ The parameters for defining how the equity option can be + -- exercised, how it is valued and how it is settled.+ -- + -- Choice between:+ -- + -- (1) The parameters for defining the expiration date and + -- time for a European style equity option.+ -- + -- (2) The parameters for defining the exercise period for an + -- American style equity option together with the rules + -- governing the quantity of the underlying that can be + -- exercised on any given exercise date.+ -- + -- (3) The parameters for defining the exercise period for an + -- Bermuda style equity option together with the rules + -- governing the quantity of the underlying that can be + -- exercised on any given exercise date.+ , equityExercValSettl_choice1 :: (Maybe (OneOf2 ((Maybe (Xsd.Boolean)),(Maybe (MakeWholeProvisions))) PrePayment))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * If true then each option not previously exercised + -- will be deemed to be exercised at the expiration + -- time on the expiration date without service of + -- notice unless the buyer notifies the seller that it + -- no longer wishes this to occur.+ -- + -- * Provisions covering early exercise of option.+ -- + -- (2) Prepayment features for Forward.+ , equityExercValSettl_equityValuation :: Maybe EquityValuation+ -- ^ The parameters for defining when valuation of the + -- underlying takes place.+ , equityExercValSettl_settlementDate :: Maybe AdjustableOrRelativeDate+ -- ^ Date on which settlement of option premiums will occur.+ , equityExercValSettl_settlementCurrency :: Maybe Currency+ -- ^ The currency in which a cash settlement for non-deliverable + -- forward and non-deliverable options.+ , equityExercValSettl_settlementPriceSource :: Maybe SettlementPriceSource+ , equityExercValSettl_settlementType :: Maybe SettlementTypeEnum+ -- ^ How the option will be settled.+ , equityExercValSettl_settlementMethodElectionDate :: Maybe AdjustableOrRelativeDate+ , equityExercValSettl_settlementMethodElectingPartyReference :: Maybe PartyReference+ , equityExercValSettl_settlementPriceDefaultElection :: Maybe SettlementPriceDefaultElection+ }+ deriving (Eq,Show)+instance SchemaType EquityExerciseValuationSettlement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return EquityExerciseValuationSettlement+ `apply` optional (oneOf' [ ("EquityEuropeanExercise", fmap OneOf3 (parseSchemaType "equityEuropeanExercise"))+ , ("EquityAmericanExercise", fmap TwoOf3 (parseSchemaType "equityAmericanExercise"))+ , ("EquityBermudaExercise", fmap ThreeOf3 (parseSchemaType "equityBermudaExercise"))+ ])+ `apply` optional (oneOf' [ ("Maybe Xsd.Boolean Maybe MakeWholeProvisions", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "automaticExercise")+ `apply` optional (parseSchemaType "makeWholeProvisions")))+ , ("PrePayment", fmap TwoOf2 (parseSchemaType "prePayment"))+ ])+ `apply` optional (parseSchemaType "equityValuation")+ `apply` optional (parseSchemaType "settlementDate")+ `apply` optional (parseSchemaType "settlementCurrency")+ `apply` optional (parseSchemaType "settlementPriceSource")+ `apply` optional (parseSchemaType "settlementType")+ `apply` optional (parseSchemaType "settlementMethodElectionDate")+ `apply` optional (parseSchemaType "settlementMethodElectingPartyReference")+ `apply` optional (parseSchemaType "settlementPriceDefaultElection")+ schemaTypeToXML s x@EquityExerciseValuationSettlement{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "equityEuropeanExercise")+ (schemaTypeToXML "equityAmericanExercise")+ (schemaTypeToXML "equityBermudaExercise")+ ) $ equityExercValSettl_choice0 x+ , maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "automaticExercise") a+ , maybe [] (schemaTypeToXML "makeWholeProvisions") b+ ])+ (schemaTypeToXML "prePayment")+ ) $ equityExercValSettl_choice1 x+ , maybe [] (schemaTypeToXML "equityValuation") $ equityExercValSettl_equityValuation x+ , maybe [] (schemaTypeToXML "settlementDate") $ equityExercValSettl_settlementDate x+ , maybe [] (schemaTypeToXML "settlementCurrency") $ equityExercValSettl_settlementCurrency x+ , maybe [] (schemaTypeToXML "settlementPriceSource") $ equityExercValSettl_settlementPriceSource x+ , maybe [] (schemaTypeToXML "settlementType") $ equityExercValSettl_settlementType x+ , maybe [] (schemaTypeToXML "settlementMethodElectionDate") $ equityExercValSettl_settlementMethodElectionDate x+ , maybe [] (schemaTypeToXML "settlementMethodElectingPartyReference") $ equityExercValSettl_settlementMethodElectingPartyReference x+ , maybe [] (schemaTypeToXML "settlementPriceDefaultElection") $ equityExercValSettl_settlementPriceDefaultElection x+ ]+ +-- | A type for defining equity forwards.+data EquityForward = EquityForward+ { equityForward_ID :: Maybe Xsd.ID+ , equityForward_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , equityForward_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , equityForward_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , equityForward_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , equityForward_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , equityForward_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , equityForward_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , equityForward_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , equityForward_optionType :: Maybe EquityOptionTypeEnum+ -- ^ The type of option transaction.+ , equityForward_equityEffectiveDate :: Maybe Xsd.Date+ -- ^ Effective date for a forward starting option.+ , equityForward_underlyer :: Maybe Underlyer+ -- ^ Specifies the underlying component, which can be either one + -- or many and consists in either equity, index or convertible + -- bond component, or a combination of these.+ , equityForward_notional :: Maybe NonNegativeMoney+ -- ^ The notional amount.+ , equityForward_equityExercise :: Maybe EquityExerciseValuationSettlement+ -- ^ The parameters for defining how the equity option can be + -- exercised, how it is valued and how it is settled.+ , equityForward_feature :: Maybe OptionFeatures+ -- ^ Asian, Barrier, Knock and Pass Through features.+ , equityForward_fxFeature :: Maybe FxFeature+ -- ^ Quanto, Composite, or Cross Currency FX features.+ , equityForward_strategyFeature :: Maybe StrategyFeature+ -- ^ A equity option simple strategy feature.+ , equityForward_dividendConditions :: Maybe DividendConditions+ , equityForward_methodOfAdjustment :: Maybe MethodOfAdjustmentEnum+ -- ^ Defines how adjustments will be made to the contract should + -- one or more of the extraordinary events occur.+ , equityForward_extraordinaryEvents :: Maybe ExtraordinaryEvents+ -- ^ Where the underlying is shares, specifies events affecting + -- the issuer of those shares that may require the terms of + -- the transaction to be adjusted.+ , equityForward_forwardPrice :: NonNegativeMoney+ -- ^ The forward price per share, index or basket.+ }+ deriving (Eq,Show)+instance SchemaType EquityForward where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (EquityForward 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 (parseSchemaType "optionType")+ `apply` optional (parseSchemaType "equityEffectiveDate")+ `apply` optional (parseSchemaType "underlyer")+ `apply` optional (parseSchemaType "notional")+ `apply` optional (parseSchemaType "equityExercise")+ `apply` optional (parseSchemaType "feature")+ `apply` optional (parseSchemaType "fxFeature")+ `apply` optional (parseSchemaType "strategyFeature")+ `apply` optional (parseSchemaType "dividendConditions")+ `apply` optional (parseSchemaType "methodOfAdjustment")+ `apply` optional (parseSchemaType "extraordinaryEvents")+ `apply` parseSchemaType "forwardPrice"+ schemaTypeToXML s x@EquityForward{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ equityForward_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ equityForward_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ equityForward_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ equityForward_productType x+ , concatMap (schemaTypeToXML "productId") $ equityForward_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ equityForward_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ equityForward_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ equityForward_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ equityForward_sellerAccountReference x+ , maybe [] (schemaTypeToXML "optionType") $ equityForward_optionType x+ , maybe [] (schemaTypeToXML "equityEffectiveDate") $ equityForward_equityEffectiveDate x+ , maybe [] (schemaTypeToXML "underlyer") $ equityForward_underlyer x+ , maybe [] (schemaTypeToXML "notional") $ equityForward_notional x+ , maybe [] (schemaTypeToXML "equityExercise") $ equityForward_equityExercise x+ , maybe [] (schemaTypeToXML "feature") $ equityForward_feature x+ , maybe [] (schemaTypeToXML "fxFeature") $ equityForward_fxFeature x+ , maybe [] (schemaTypeToXML "strategyFeature") $ equityForward_strategyFeature x+ , maybe [] (schemaTypeToXML "dividendConditions") $ equityForward_dividendConditions x+ , maybe [] (schemaTypeToXML "methodOfAdjustment") $ equityForward_methodOfAdjustment x+ , maybe [] (schemaTypeToXML "extraordinaryEvents") $ equityForward_extraordinaryEvents x+ , schemaTypeToXML "forwardPrice" $ equityForward_forwardPrice x+ ]+instance Extension EquityForward EquityDerivativeLongFormBase where+ supertype v = EquityDerivativeLongFormBase_EquityForward v+instance Extension EquityForward EquityDerivativeBase where+ supertype = (supertype :: EquityDerivativeLongFormBase -> EquityDerivativeBase)+ . (supertype :: EquityForward -> EquityDerivativeLongFormBase)+ +instance Extension EquityForward Product where+ supertype = (supertype :: EquityDerivativeBase -> Product)+ . (supertype :: EquityDerivativeLongFormBase -> EquityDerivativeBase)+ . (supertype :: EquityForward -> EquityDerivativeLongFormBase)+ + +-- | A type for defining the multiple exercise provisions of an +-- American or Bermuda style equity option.+data EquityMultipleExercise = EquityMultipleExercise+ { equityMultiExerc_integralMultipleExercise :: Maybe PositiveDecimal+ -- ^ When multiple exercise is applicable and this element is + -- present it specifies that the number of options that can be + -- exercised on a given exercise date must either be equal to + -- the value of this element or be an integral multiple of it.+ , equityMultiExerc_minimumNumberOfOptions :: Maybe NonNegativeDecimal+ -- ^ When multiple exercise is applicable this element specifies + -- the minimum number of options that can be exercised on a + -- given exercise date. If this element is not present then + -- the minimum number is deemed to be 1. Its value can be a + -- fractional number as a result of corporate actions.+ , equityMultiExerc_maximumNumberOfOptions :: Maybe NonNegativeDecimal+ -- ^ When multiple exercise is applicable this element specifies + -- the maximum number of options that can be exercised on a + -- given exercise date. If this element is not present then + -- the maximum number is deemed to be the same as the number + -- of options. Its value can be a fractional number as a + -- result of corporate actions.+ }+ deriving (Eq,Show)+instance SchemaType EquityMultipleExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return EquityMultipleExercise+ `apply` optional (parseSchemaType "integralMultipleExercise")+ `apply` optional (parseSchemaType "minimumNumberOfOptions")+ `apply` optional (parseSchemaType "maximumNumberOfOptions")+ schemaTypeToXML s x@EquityMultipleExercise{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "integralMultipleExercise") $ equityMultiExerc_integralMultipleExercise x+ , maybe [] (schemaTypeToXML "minimumNumberOfOptions") $ equityMultiExerc_minimumNumberOfOptions x+ , maybe [] (schemaTypeToXML "maximumNumberOfOptions") $ equityMultiExerc_maximumNumberOfOptions x+ ]+ +-- | A type for defining equity options.+data EquityOption = EquityOption+ { equityOption_ID :: Maybe Xsd.ID+ , equityOption_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , equityOption_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , equityOption_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , equityOption_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , equityOption_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , equityOption_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , equityOption_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , equityOption_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , equityOption_optionType :: Maybe EquityOptionTypeEnum+ -- ^ The type of option transaction.+ , equityOption_equityEffectiveDate :: Maybe Xsd.Date+ -- ^ Effective date for a forward starting option.+ , equityOption_underlyer :: Maybe Underlyer+ -- ^ Specifies the underlying component, which can be either one + -- or many and consists in either equity, index or convertible + -- bond component, or a combination of these.+ , equityOption_notional :: Maybe NonNegativeMoney+ -- ^ The notional amount.+ , equityOption_equityExercise :: Maybe EquityExerciseValuationSettlement+ -- ^ The parameters for defining how the equity option can be + -- exercised, how it is valued and how it is settled.+ , equityOption_feature :: Maybe OptionFeatures+ -- ^ Asian, Barrier, Knock and Pass Through features.+ , equityOption_fxFeature :: Maybe FxFeature+ -- ^ Quanto, Composite, or Cross Currency FX features.+ , equityOption_strategyFeature :: Maybe StrategyFeature+ -- ^ A equity option simple strategy feature.+ , equityOption_dividendConditions :: Maybe DividendConditions+ , equityOption_methodOfAdjustment :: Maybe MethodOfAdjustmentEnum+ -- ^ Defines how adjustments will be made to the contract should + -- one or more of the extraordinary events occur.+ , equityOption_extraordinaryEvents :: Maybe ExtraordinaryEvents+ -- ^ Where the underlying is shares, specifies events affecting + -- the issuer of those shares that may require the terms of + -- the transaction to be adjusted.+ , equityOption_strike :: Maybe EquityStrike+ -- ^ Defines whether it is a price or level at which the option + -- has been, or will be, struck.+ , equityOption_spotPrice :: Maybe NonNegativeDecimal+ -- ^ The price per share, index or basket observed on the trade + -- or effective date.+ , equityOption_numberOfOptions :: Maybe NonNegativeDecimal+ -- ^ The number of options comprised in the option transaction.+ , equityOption_optionEntitlement :: Maybe PositiveDecimal+ -- ^ The number of shares per option comprised in the option + -- transaction.+ , equityOption_equityPremium :: Maybe EquityPremium+ -- ^ The equity option premium payable by the buyer to the + -- seller.+ }+ deriving (Eq,Show)+instance SchemaType EquityOption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (EquityOption 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 (parseSchemaType "optionType")+ `apply` optional (parseSchemaType "equityEffectiveDate")+ `apply` optional (parseSchemaType "underlyer")+ `apply` optional (parseSchemaType "notional")+ `apply` optional (parseSchemaType "equityExercise")+ `apply` optional (parseSchemaType "feature")+ `apply` optional (parseSchemaType "fxFeature")+ `apply` optional (parseSchemaType "strategyFeature")+ `apply` optional (parseSchemaType "dividendConditions")+ `apply` optional (parseSchemaType "methodOfAdjustment")+ `apply` optional (parseSchemaType "extraordinaryEvents")+ `apply` optional (parseSchemaType "strike")+ `apply` optional (parseSchemaType "spotPrice")+ `apply` optional (parseSchemaType "numberOfOptions")+ `apply` optional (parseSchemaType "optionEntitlement")+ `apply` optional (parseSchemaType "equityPremium")+ schemaTypeToXML s x@EquityOption{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ equityOption_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ equityOption_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ equityOption_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ equityOption_productType x+ , concatMap (schemaTypeToXML "productId") $ equityOption_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ equityOption_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ equityOption_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ equityOption_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ equityOption_sellerAccountReference x+ , maybe [] (schemaTypeToXML "optionType") $ equityOption_optionType x+ , maybe [] (schemaTypeToXML "equityEffectiveDate") $ equityOption_equityEffectiveDate x+ , maybe [] (schemaTypeToXML "underlyer") $ equityOption_underlyer x+ , maybe [] (schemaTypeToXML "notional") $ equityOption_notional x+ , maybe [] (schemaTypeToXML "equityExercise") $ equityOption_equityExercise x+ , maybe [] (schemaTypeToXML "feature") $ equityOption_feature x+ , maybe [] (schemaTypeToXML "fxFeature") $ equityOption_fxFeature x+ , maybe [] (schemaTypeToXML "strategyFeature") $ equityOption_strategyFeature x+ , maybe [] (schemaTypeToXML "dividendConditions") $ equityOption_dividendConditions x+ , maybe [] (schemaTypeToXML "methodOfAdjustment") $ equityOption_methodOfAdjustment x+ , maybe [] (schemaTypeToXML "extraordinaryEvents") $ equityOption_extraordinaryEvents x+ , maybe [] (schemaTypeToXML "strike") $ equityOption_strike x+ , maybe [] (schemaTypeToXML "spotPrice") $ equityOption_spotPrice x+ , maybe [] (schemaTypeToXML "numberOfOptions") $ equityOption_numberOfOptions x+ , maybe [] (schemaTypeToXML "optionEntitlement") $ equityOption_optionEntitlement x+ , maybe [] (schemaTypeToXML "equityPremium") $ equityOption_equityPremium x+ ]+instance Extension EquityOption EquityDerivativeLongFormBase where+ supertype v = EquityDerivativeLongFormBase_EquityOption v+instance Extension EquityOption EquityDerivativeBase where+ supertype = (supertype :: EquityDerivativeLongFormBase -> EquityDerivativeBase)+ . (supertype :: EquityOption -> EquityDerivativeLongFormBase)+ +instance Extension EquityOption Product where+ supertype = (supertype :: EquityDerivativeBase -> Product)+ . (supertype :: EquityDerivativeLongFormBase -> EquityDerivativeBase)+ . (supertype :: EquityOption -> EquityDerivativeLongFormBase)+ + +-- | A type for defining Equity Option Termination.+data EquityOptionTermination = EquityOptionTermination+ { equityOptionTermin_settlementAmountPaymentDate :: Maybe AdjustableDate+ , equityOptionTermin_settlementAmount :: Maybe NonNegativeMoney+ }+ deriving (Eq,Show)+instance SchemaType EquityOptionTermination where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return EquityOptionTermination+ `apply` optional (parseSchemaType "settlementAmountPaymentDate")+ `apply` optional (parseSchemaType "settlementAmount")+ schemaTypeToXML s x@EquityOptionTermination{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "settlementAmountPaymentDate") $ equityOptionTermin_settlementAmountPaymentDate x+ , maybe [] (schemaTypeToXML "settlementAmount") $ equityOptionTermin_settlementAmount x+ ]+ +-- | A type for defining equity option transaction supplements.+data EquityOptionTransactionSupplement = EquityOptionTransactionSupplement+ { equityOptionTransSuppl_ID :: Maybe Xsd.ID+ , equityOptionTransSuppl_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , equityOptionTransSuppl_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , equityOptionTransSuppl_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , equityOptionTransSuppl_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , equityOptionTransSuppl_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , equityOptionTransSuppl_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , equityOptionTransSuppl_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , equityOptionTransSuppl_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , equityOptionTransSuppl_optionType :: Maybe EquityOptionTypeEnum+ -- ^ The type of option transaction.+ , equityOptionTransSuppl_equityEffectiveDate :: Maybe Xsd.Date+ -- ^ Effective date for a forward starting option.+ , equityOptionTransSuppl_underlyer :: Maybe Underlyer+ -- ^ Specifies the underlying component, which can be either one + -- or many and consists in either equity, index or convertible + -- bond component, or a combination of these.+ , equityOptionTransSuppl_notional :: Maybe NonNegativeMoney+ -- ^ The notional amount.+ , equityOptionTransSuppl_equityExercise :: Maybe EquityExerciseValuationSettlement+ -- ^ The parameters for defining how the equity option can be + -- exercised, how it is valued and how it is settled.+ , equityOptionTransSuppl_feature :: Maybe OptionFeatures+ -- ^ Asian, Barrier, Knock and Pass Through features.+ , equityOptionTransSuppl_fxFeature :: Maybe FxFeature+ -- ^ Quanto, Composite, or Cross Currency FX features.+ , equityOptionTransSuppl_strategyFeature :: Maybe StrategyFeature+ -- ^ A equity option simple strategy feature.+ , equityOptionTransSuppl_strike :: Maybe EquityStrike+ -- ^ Defines whether it is a price or level at which the option + -- has been, or will be, struck.+ , equityOptionTransSuppl_spotPrice :: Maybe NonNegativeDecimal+ -- ^ The price per share, index or basket observed on the trade + -- or effective date.+ , equityOptionTransSuppl_numberOfOptions :: Maybe NonNegativeDecimal+ -- ^ The number of options comprised in the option transaction.+ , equityOptionTransSuppl_equityPremium :: Maybe EquityPremium+ -- ^ The equity option premium payable by the buyer to the + -- seller.+ , equityOptionTransSuppl_exchangeLookAlike :: Maybe Xsd.Boolean+ -- ^ For a share option transaction, a flag used to indicate + -- whether the transaction is to be treated as an 'exchange + -- look-alike'. This designation has significance for how + -- share adjustments (arising from corporate actions) will be + -- determined for the transaction. For an 'exchange + -- look-alike' transaction the relevant share adjustments will + -- follow that for a corresponding designated contract listed + -- on the related exchange (referred to as Options Exchange + -- Adjustment (ISDA defined term), otherwise the share + -- adjustments will be determined by the calculation agent + -- (referred to as Calculation Agent Adjustment (ISDA defined + -- term)).+ , equityOptionTransSuppl_exchangeTradedContractNearest :: Maybe Xsd.Boolean+ -- ^ For an index option transaction, a flag used in conjuction + -- with Futures Price Valuation (ISDA defined term) to + -- indicate whether the Nearest Index Contract provision is + -- applicable. The Nearest Index Contract provision is a rule + -- for determining the Exchange-traded Contract (ISDA defined + -- term) without having to explicitly state the actual + -- contract, delivery month and exchange on which it is + -- traded.+ , equityOptionTransSuppl_choice22 :: (Maybe (OneOf2 Xsd.Boolean Xsd.Boolean))+ -- ^ Choice between:+ -- + -- (1) For an index option transaction, a flag to indicate + -- whether a relevant Multiple Exchange Index Annex is + -- applicable to the transaction. This annex defines + -- additional provisions which are applicable where an + -- index is comprised of component securities that are + -- traded on multiple exchanges.+ -- + -- (2) For an index option transaction, a flag to indicate + -- whether a relevant Component Security Index Annex is + -- applicable to the transaction.+ , equityOptionTransSuppl_methodOfAdjustment :: Maybe MethodOfAdjustmentEnum+ , equityOptionTransSuppl_localJurisdiction :: Maybe CountryCode+ -- ^ Local Jurisdiction is a term used in the AEJ Master + -- Confirmation, which is used to determine local taxes, which + -- shall mean taxes, duties, and similar charges imposed by + -- the taxing authority of the Local Jurisdiction If this + -- element is not present Local Jurisdiction is Not + -- Applicable.+ , equityOptionTransSuppl_choice25 :: (Maybe (OneOf2 PositiveDecimal PositiveDecimal))+ -- ^ Choice between:+ -- + -- (1) The number of shares per option comprised in the option + -- transaction supplement.+ -- + -- (2) Specifies the contract multiplier that can be + -- associated with an index option.+ , equityOptionTransSuppl_extraordinaryEvents :: Maybe ExtraordinaryEvents+ -- ^ A component to contain elements that represent an + -- extraordinary event.+ }+ deriving (Eq,Show)+instance SchemaType EquityOptionTransactionSupplement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (EquityOptionTransactionSupplement 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 (parseSchemaType "optionType")+ `apply` optional (parseSchemaType "equityEffectiveDate")+ `apply` optional (parseSchemaType "underlyer")+ `apply` optional (parseSchemaType "notional")+ `apply` optional (parseSchemaType "equityExercise")+ `apply` optional (parseSchemaType "feature")+ `apply` optional (parseSchemaType "fxFeature")+ `apply` optional (parseSchemaType "strategyFeature")+ `apply` optional (parseSchemaType "strike")+ `apply` optional (parseSchemaType "spotPrice")+ `apply` optional (parseSchemaType "numberOfOptions")+ `apply` optional (parseSchemaType "equityPremium")+ `apply` optional (parseSchemaType "exchangeLookAlike")+ `apply` optional (parseSchemaType "exchangeTradedContractNearest")+ `apply` optional (oneOf' [ ("Xsd.Boolean", fmap OneOf2 (parseSchemaType "multipleExchangeIndexAnnexFallback"))+ , ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "componentSecurityIndexAnnexFallback"))+ ])+ `apply` optional (parseSchemaType "methodOfAdjustment")+ `apply` optional (parseSchemaType "localJurisdiction")+ `apply` optional (oneOf' [ ("PositiveDecimal", fmap OneOf2 (parseSchemaType "optionEntitlement"))+ , ("PositiveDecimal", fmap TwoOf2 (parseSchemaType "multiplier"))+ ])+ `apply` optional (parseSchemaType "extraordinaryEvents")+ schemaTypeToXML s x@EquityOptionTransactionSupplement{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ equityOptionTransSuppl_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ equityOptionTransSuppl_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ equityOptionTransSuppl_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ equityOptionTransSuppl_productType x+ , concatMap (schemaTypeToXML "productId") $ equityOptionTransSuppl_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ equityOptionTransSuppl_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ equityOptionTransSuppl_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ equityOptionTransSuppl_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ equityOptionTransSuppl_sellerAccountReference x+ , maybe [] (schemaTypeToXML "optionType") $ equityOptionTransSuppl_optionType x+ , maybe [] (schemaTypeToXML "equityEffectiveDate") $ equityOptionTransSuppl_equityEffectiveDate x+ , maybe [] (schemaTypeToXML "underlyer") $ equityOptionTransSuppl_underlyer x+ , maybe [] (schemaTypeToXML "notional") $ equityOptionTransSuppl_notional x+ , maybe [] (schemaTypeToXML "equityExercise") $ equityOptionTransSuppl_equityExercise x+ , maybe [] (schemaTypeToXML "feature") $ equityOptionTransSuppl_feature x+ , maybe [] (schemaTypeToXML "fxFeature") $ equityOptionTransSuppl_fxFeature x+ , maybe [] (schemaTypeToXML "strategyFeature") $ equityOptionTransSuppl_strategyFeature x+ , maybe [] (schemaTypeToXML "strike") $ equityOptionTransSuppl_strike x+ , maybe [] (schemaTypeToXML "spotPrice") $ equityOptionTransSuppl_spotPrice x+ , maybe [] (schemaTypeToXML "numberOfOptions") $ equityOptionTransSuppl_numberOfOptions x+ , maybe [] (schemaTypeToXML "equityPremium") $ equityOptionTransSuppl_equityPremium x+ , maybe [] (schemaTypeToXML "exchangeLookAlike") $ equityOptionTransSuppl_exchangeLookAlike x+ , maybe [] (schemaTypeToXML "exchangeTradedContractNearest") $ equityOptionTransSuppl_exchangeTradedContractNearest x+ , maybe [] (foldOneOf2 (schemaTypeToXML "multipleExchangeIndexAnnexFallback")+ (schemaTypeToXML "componentSecurityIndexAnnexFallback")+ ) $ equityOptionTransSuppl_choice22 x+ , maybe [] (schemaTypeToXML "methodOfAdjustment") $ equityOptionTransSuppl_methodOfAdjustment x+ , maybe [] (schemaTypeToXML "localJurisdiction") $ equityOptionTransSuppl_localJurisdiction x+ , maybe [] (foldOneOf2 (schemaTypeToXML "optionEntitlement")+ (schemaTypeToXML "multiplier")+ ) $ equityOptionTransSuppl_choice25 x+ , maybe [] (schemaTypeToXML "extraordinaryEvents") $ equityOptionTransSuppl_extraordinaryEvents x+ ]+instance Extension EquityOptionTransactionSupplement EquityDerivativeShortFormBase where+ supertype v = EquityDerivativeShortFormBase_EquityOptionTransactionSupplement v+instance Extension EquityOptionTransactionSupplement EquityDerivativeBase where+ supertype = (supertype :: EquityDerivativeShortFormBase -> EquityDerivativeBase)+ . (supertype :: EquityOptionTransactionSupplement -> EquityDerivativeShortFormBase)+ +instance Extension EquityOptionTransactionSupplement Product where+ supertype = (supertype :: EquityDerivativeBase -> Product)+ . (supertype :: EquityDerivativeShortFormBase -> EquityDerivativeBase)+ . (supertype :: EquityOptionTransactionSupplement -> EquityDerivativeShortFormBase)+ + +-- | A type for defining PrePayment.+data PrePayment = PrePayment+ { prePayment_ID :: Maybe Xsd.ID+ , prePayment_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , prePayment_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , prePayment_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , prePayment_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , prePayment :: Maybe Xsd.Boolean+ , prePayment_amount :: Maybe NonNegativeMoney+ , prePayment_date :: Maybe AdjustableDate+ }+ deriving (Eq,Show)+instance SchemaType PrePayment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PrePayment a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "prePayment")+ `apply` optional (parseSchemaType "prePaymentAmount")+ `apply` optional (parseSchemaType "prePaymentDate")+ schemaTypeToXML s x@PrePayment{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ prePayment_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ prePayment_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ prePayment_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ prePayment_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ prePayment_receiverAccountReference x+ , maybe [] (schemaTypeToXML "prePayment") $ prePayment x+ , maybe [] (schemaTypeToXML "prePaymentAmount") $ prePayment_amount x+ , maybe [] (schemaTypeToXML "prePaymentDate") $ prePayment_date x+ ]+instance Extension PrePayment PaymentBase where+ supertype v = PaymentBase_PrePayment v+ +-- | A component describing a Broker View of an Equity Option.+elementBrokerEquityOption :: XMLParser BrokerEquityOption+elementBrokerEquityOption = parseSchemaType "brokerEquityOption"+elementToXMLBrokerEquityOption :: BrokerEquityOption -> [Content ()]+elementToXMLBrokerEquityOption = schemaTypeToXML "brokerEquityOption"+ +-- | A component describing an Equity Forward product.+elementEquityForward :: XMLParser EquityForward+elementEquityForward = parseSchemaType "equityForward"+elementToXMLEquityForward :: EquityForward -> [Content ()]+elementToXMLEquityForward = schemaTypeToXML "equityForward"+ +-- | A component describing an Equity Option product.+elementEquityOption :: XMLParser EquityOption+elementEquityOption = parseSchemaType "equityOption"+elementToXMLEquityOption :: EquityOption -> [Content ()]+elementToXMLEquityOption = schemaTypeToXML "equityOption"+ +-- | A component describing an Equity Option Transaction +-- Supplement.+elementEquityOptionTransactionSupplement :: XMLParser EquityOptionTransactionSupplement+elementEquityOptionTransactionSupplement = parseSchemaType "equityOptionTransactionSupplement"+elementToXMLEquityOptionTransactionSupplement :: EquityOptionTransactionSupplement -> [Content ()]+elementToXMLEquityOptionTransactionSupplement = schemaTypeToXML "equityOptionTransactionSupplement"+
+ Data/FpML/V53/Eqd.hs-boot view
@@ -0,0 +1,144 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Eqd+ ( module Data.FpML.V53.Eqd+ , module Data.FpML.V53.Shared.EQ+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Shared.EQ+ +-- | A type for defining the broker equity options. +data BrokerEquityOption+instance Eq BrokerEquityOption+instance Show BrokerEquityOption+instance SchemaType BrokerEquityOption+instance Extension BrokerEquityOption EquityDerivativeShortFormBase+instance Extension BrokerEquityOption EquityDerivativeBase+instance Extension BrokerEquityOption Product+ +-- | A type for defining exercise procedures associated with an +-- American style exercise of an equity option. This entity +-- inherits from the type SharedAmericanExercise. +data EquityAmericanExercise+instance Eq EquityAmericanExercise+instance Show EquityAmericanExercise+instance SchemaType EquityAmericanExercise+instance Extension EquityAmericanExercise SharedAmericanExercise+instance Extension EquityAmericanExercise Exercise+ +-- | A type for defining exercise procedures associated with a +-- Bermuda style exercise of an equity option. The term +-- Bermuda is adopted in FpML for consistency with the ISDA +-- Definitions. +data EquityBermudaExercise+instance Eq EquityBermudaExercise+instance Show EquityBermudaExercise+instance SchemaType EquityBermudaExercise+instance Extension EquityBermudaExercise SharedAmericanExercise+instance Extension EquityBermudaExercise Exercise+ +-- | A type for defining the common features of equity +-- derivatives. +data EquityDerivativeBase+instance Eq EquityDerivativeBase+instance Show EquityDerivativeBase+instance SchemaType EquityDerivativeBase+instance Extension EquityDerivativeBase Product+ +-- | type for defining the common features of equity +-- derivatives. +data EquityDerivativeLongFormBase+instance Eq EquityDerivativeLongFormBase+instance Show EquityDerivativeLongFormBase+instance SchemaType EquityDerivativeLongFormBase+instance Extension EquityDerivativeLongFormBase EquityDerivativeBase+ +-- | A type for defining short form equity option basic +-- features. +data EquityDerivativeShortFormBase+instance Eq EquityDerivativeShortFormBase+instance Show EquityDerivativeShortFormBase+instance SchemaType EquityDerivativeShortFormBase+instance Extension EquityDerivativeShortFormBase EquityDerivativeBase+ +-- | A type for defining exercise procedures associated with a +-- European style exercise of an equity option. +data EquityEuropeanExercise+instance Eq EquityEuropeanExercise+instance Show EquityEuropeanExercise+instance SchemaType EquityEuropeanExercise+instance Extension EquityEuropeanExercise Exercise+ +-- | A type for defining exercise procedures for equity options. +data EquityExerciseValuationSettlement+instance Eq EquityExerciseValuationSettlement+instance Show EquityExerciseValuationSettlement+instance SchemaType EquityExerciseValuationSettlement+ +-- | A type for defining equity forwards. +data EquityForward+instance Eq EquityForward+instance Show EquityForward+instance SchemaType EquityForward+instance Extension EquityForward EquityDerivativeLongFormBase+instance Extension EquityForward EquityDerivativeBase+instance Extension EquityForward Product+ +-- | A type for defining the multiple exercise provisions of an +-- American or Bermuda style equity option. +data EquityMultipleExercise+instance Eq EquityMultipleExercise+instance Show EquityMultipleExercise+instance SchemaType EquityMultipleExercise+ +-- | A type for defining equity options. +data EquityOption+instance Eq EquityOption+instance Show EquityOption+instance SchemaType EquityOption+instance Extension EquityOption EquityDerivativeLongFormBase+instance Extension EquityOption EquityDerivativeBase+instance Extension EquityOption Product+ +-- | A type for defining Equity Option Termination. +data EquityOptionTermination+instance Eq EquityOptionTermination+instance Show EquityOptionTermination+instance SchemaType EquityOptionTermination+ +-- | A type for defining equity option transaction supplements. +data EquityOptionTransactionSupplement+instance Eq EquityOptionTransactionSupplement+instance Show EquityOptionTransactionSupplement+instance SchemaType EquityOptionTransactionSupplement+instance Extension EquityOptionTransactionSupplement EquityDerivativeShortFormBase+instance Extension EquityOptionTransactionSupplement EquityDerivativeBase+instance Extension EquityOptionTransactionSupplement Product+ +-- | A type for defining PrePayment. +data PrePayment+instance Eq PrePayment+instance Show PrePayment+instance SchemaType PrePayment+instance Extension PrePayment PaymentBase+ +-- | A component describing a Broker View of an Equity Option. +elementBrokerEquityOption :: XMLParser BrokerEquityOption+elementToXMLBrokerEquityOption :: BrokerEquityOption -> [Content ()]+ +-- | A component describing an Equity Forward product. +elementEquityForward :: XMLParser EquityForward+elementToXMLEquityForward :: EquityForward -> [Content ()]+ +-- | A component describing an Equity Option product. +elementEquityOption :: XMLParser EquityOption+elementToXMLEquityOption :: EquityOption -> [Content ()]+ +-- | A component describing an Equity Option Transaction +-- Supplement. +elementEquityOptionTransactionSupplement :: XMLParser EquityOptionTransactionSupplement+elementToXMLEquityOptionTransactionSupplement :: EquityOptionTransactionSupplement -> [Content ()]+
+ Data/FpML/V53/Events/Business.hs view
@@ -0,0 +1,1268 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Events.Business+ ( module Data.FpML.V53.Events.Business+ , module Data.FpML.V53.Msg+ , 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.Msg+import Data.FpML.V53.Asset+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | A type defining an event identifier issued by the indicated +-- party.+data BusinessEventIdentifier = BusinessEventIdentifier+ { busEventIdent_ID :: Maybe Xsd.ID+ , busEventIdent_choice0 :: OneOf2 PartyId (PartyReference,(Maybe (AccountReference)))+ -- ^ Choice between:+ -- + -- (1) issuer+ -- + -- (2) Sequence of:+ -- + -- * Reference to a party.+ -- + -- * Reference to an account.+ , busEventIdent_eventId :: EventId+ }+ deriving (Eq,Show)+instance SchemaType BusinessEventIdentifier where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (BusinessEventIdentifier a0)+ `apply` oneOf' [ ("PartyId", fmap OneOf2 (parseSchemaType "issuer"))+ , ("PartyReference Maybe AccountReference", fmap TwoOf2 (return (,) `apply` parseSchemaType "partyReference"+ `apply` optional (parseSchemaType "accountReference")))+ ]+ `apply` parseSchemaType "eventId"+ schemaTypeToXML s x@BusinessEventIdentifier{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ busEventIdent_ID x+ ]+ [ foldOneOf2 (schemaTypeToXML "issuer")+ (\ (a,b) -> concat [ schemaTypeToXML "partyReference" a+ , maybe [] (schemaTypeToXML "accountReference") b+ ])+ $ busEventIdent_choice0 x+ , schemaTypeToXML "eventId" $ busEventIdent_eventId x+ ]+ +-- | A post-trade event reference identifier allocated by a +-- party. FpML does not define the domain values associated +-- with this element. Note that the domain values for this +-- element are not strictly an enumerated list.+data EventId = EventId Scheme EventIdAttributes deriving (Eq,Show)+data EventIdAttributes = EventIdAttributes+ { eventIdAttrib_eventIdScheme :: Maybe Xsd.AnyURI+ , eventIdAttrib_ID :: Maybe Xsd.ID+ }+ deriving (Eq,Show)+instance SchemaType EventId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "eventIdScheme" e pos+ a1 <- optional $ getAttribute "id" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ EventId v (EventIdAttributes a0 a1)+ schemaTypeToXML s (EventId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "eventIdScheme") $ eventIdAttrib_eventIdScheme at+ , maybe [] (toXMLAttribute "id") $ eventIdAttrib_ID at+ ]+ $ schemaTypeToXML s bt+instance Extension EventId Scheme where+ supertype (EventId s _) = s+ +-- | Abstract base type for all events.+data AbstractEvent+ = AbstractEvent_TradeNovationContent TradeNovationContent+ | AbstractEvent_TradeChangeBase TradeChangeBase+ | AbstractEvent_TradeAmendmentContent TradeAmendmentContent+ | AbstractEvent_OptionExpiry OptionExpiry+ | AbstractEvent_OptionExercise OptionExercise+ | AbstractEvent_ChangeEvent ChangeEvent+ | AbstractEvent_AdditionalEvent AdditionalEvent+ + deriving (Eq,Show)+instance SchemaType AbstractEvent where+ parseSchemaType s = do+ (fmap AbstractEvent_TradeNovationContent $ parseSchemaType s)+ `onFail`+ (fmap AbstractEvent_TradeChangeBase $ parseSchemaType s)+ `onFail`+ (fmap AbstractEvent_TradeAmendmentContent $ parseSchemaType s)+ `onFail`+ (fmap AbstractEvent_OptionExpiry $ parseSchemaType s)+ `onFail`+ (fmap AbstractEvent_OptionExercise $ parseSchemaType s)+ `onFail`+ (fmap AbstractEvent_ChangeEvent $ parseSchemaType s)+ `onFail`+ (fmap AbstractEvent_AdditionalEvent $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of AbstractEvent,\n\+\ namely one of:\n\+\TradeNovationContent,TradeChangeBase,TradeAmendmentContent,OptionExpiry,OptionExercise,ChangeEvent,AdditionalEvent"+ schemaTypeToXML _s (AbstractEvent_TradeNovationContent x) = schemaTypeToXML "tradeNovationContent" x+ schemaTypeToXML _s (AbstractEvent_TradeChangeBase x) = schemaTypeToXML "tradeChangeBase" x+ schemaTypeToXML _s (AbstractEvent_TradeAmendmentContent x) = schemaTypeToXML "tradeAmendmentContent" x+ schemaTypeToXML _s (AbstractEvent_OptionExpiry x) = schemaTypeToXML "optionExpiry" x+ schemaTypeToXML _s (AbstractEvent_OptionExercise x) = schemaTypeToXML "optionExercise" x+ schemaTypeToXML _s (AbstractEvent_ChangeEvent x) = schemaTypeToXML "changeEvent" x+ schemaTypeToXML _s (AbstractEvent_AdditionalEvent x) = schemaTypeToXML "additionalEvent" x+ +-- | Abstract base type for an extension/substitution point to +-- customize FpML and add additional events.+-- (There are no subtypes defined for this abstract type.)+data AdditionalEvent = AdditionalEvent deriving (Eq,Show)+instance SchemaType AdditionalEvent where+ parseSchemaType s = fail "Parse failed when expecting an extension type of AdditionalEvent:\n No extension types are known."+ schemaTypeToXML s _ = toXMLElement s [] []+instance Extension AdditionalEvent AbstractEvent where+ supertype v = AbstractEvent_AdditionalEvent v+ +-- | Abstract base type for non-negotiated trade change +-- descriptions+data ChangeEvent+ = ChangeEvent_IndexChange IndexChange+ + deriving (Eq,Show)+instance SchemaType ChangeEvent where+ parseSchemaType s = do+ (fmap ChangeEvent_IndexChange $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of ChangeEvent,\n\+\ namely one of:\n\+\IndexChange"+ schemaTypeToXML _s (ChangeEvent_IndexChange x) = schemaTypeToXML "indexChange" x+instance Extension ChangeEvent AbstractEvent where+ supertype v = AbstractEvent_ChangeEvent v+ +-- | A type that shows how multiple trades have been combined +-- into a result.+data CompressionActivity = CompressionActivity+ { comprActiv_compressionType :: Maybe CompressionType+ , comprActiv_choice1 :: (Maybe (OneOf2 ((Maybe (TradeIdentifier)),[TradeIdentifier]) ((Maybe (TradeId)),[TradeId])))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * replacementTradeIdentifier+ -- + -- * originatingTradeIdentifier+ -- + -- (2) Sequence of:+ -- + -- * replacementTradeId+ -- + -- * originatingTradeId+ }+ deriving (Eq,Show)+instance SchemaType CompressionActivity where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CompressionActivity+ `apply` optional (parseSchemaType "compressionType")+ `apply` optional (oneOf' [ ("Maybe TradeIdentifier [TradeIdentifier]", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "replacementTradeIdentifier")+ `apply` many (parseSchemaType "originatingTradeIdentifier")))+ , ("Maybe TradeId [TradeId]", fmap TwoOf2 (return (,) `apply` optional (parseSchemaType "replacementTradeId")+ `apply` many (parseSchemaType "originatingTradeId")))+ ])+ schemaTypeToXML s x@CompressionActivity{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "compressionType") $ comprActiv_compressionType x+ , maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "replacementTradeIdentifier") a+ , concatMap (schemaTypeToXML "originatingTradeIdentifier") b+ ])+ (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "replacementTradeId") a+ , concatMap (schemaTypeToXML "originatingTradeId") b+ ])+ ) $ comprActiv_choice1 x+ ]+ +-- | A type that identifies the type of trade amalgamation, for +-- example netting or portfolio compression.+data CompressionType = CompressionType Scheme CompressionTypeAttributes deriving (Eq,Show)+data CompressionTypeAttributes = CompressionTypeAttributes+ { comprTypeAttrib_compressionTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CompressionType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "compressionTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CompressionType v (CompressionTypeAttributes a0)+ schemaTypeToXML s (CompressionType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "compressionTypeScheme") $ comprTypeAttrib_compressionTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CompressionType Scheme where+ supertype (CompressionType s _) = s+ +-- | A structure describing an de-clear event.+data DeClear = DeClear+ { deClear_tradeIdentifier :: [PartyTradeIdentifier]+ , deClear_effectiveDate :: Maybe Xsd.Date+ }+ deriving (Eq,Show)+instance SchemaType DeClear where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DeClear+ `apply` many (parseSchemaType "tradeIdentifier")+ `apply` optional (parseSchemaType "effectiveDate")+ schemaTypeToXML s x@DeClear{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "tradeIdentifier") $ deClear_tradeIdentifier x+ , maybe [] (schemaTypeToXML "effectiveDate") $ deClear_effectiveDate x+ ]+ +-- | A structure describing the removal of a trade from a +-- service, such as a reporting service.+data Withdrawal = Withdrawal+ { withdrawal_partyTradeIdentifier :: [PartyTradeIdentifier]+ , withdrawal_effectiveDate :: Maybe Xsd.Date+ , withdrawal_requestedAction :: Maybe RequestedWithdrawalAction+ , withdrawal_reason :: Maybe WithdrawalReason+ }+ deriving (Eq,Show)+instance SchemaType Withdrawal where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Withdrawal+ `apply` many (parseSchemaType "partyTradeIdentifier")+ `apply` optional (parseSchemaType "effectiveDate")+ `apply` optional (parseSchemaType "requestedAction")+ `apply` optional (parseSchemaType "reason")+ schemaTypeToXML s x@Withdrawal{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "partyTradeIdentifier") $ withdrawal_partyTradeIdentifier x+ , maybe [] (schemaTypeToXML "effectiveDate") $ withdrawal_effectiveDate x+ , maybe [] (schemaTypeToXML "requestedAction") $ withdrawal_requestedAction x+ , maybe [] (schemaTypeToXML "reason") $ withdrawal_reason x+ ]+ +-- | A type that describes what the requester would like to see +-- done to implement the withdrawal, e.g. ExpungeRecords, +-- RetainRecords.+data RequestedWithdrawalAction = RequestedWithdrawalAction Scheme RequestedWithdrawalActionAttributes deriving (Eq,Show)+data RequestedWithdrawalActionAttributes = RequestedWithdrawalActionAttributes+ { rwaa_requestedWithdrawalActionScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType RequestedWithdrawalAction where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "requestedWithdrawalActionScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ RequestedWithdrawalAction v (RequestedWithdrawalActionAttributes a0)+ schemaTypeToXML s (RequestedWithdrawalAction bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "requestedWithdrawalActionScheme") $ rwaa_requestedWithdrawalActionScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension RequestedWithdrawalAction Scheme where+ supertype (RequestedWithdrawalAction s _) = s+ +-- | A type that describes why a trade was withdrawn.+data WithdrawalReason = WithdrawalReason Scheme WithdrawalReasonAttributes deriving (Eq,Show)+data WithdrawalReasonAttributes = WithdrawalReasonAttributes+ { withdrReasonAttrib_withdrawalReasonScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType WithdrawalReason where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "withdrawalReasonScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ WithdrawalReason v (WithdrawalReasonAttributes a0)+ schemaTypeToXML s (WithdrawalReason bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "withdrawalReasonScheme") $ withdrReasonAttrib_withdrawalReasonScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension WithdrawalReason Scheme where+ supertype (WithdrawalReason s _) = s+ +-- | A structure that describes a proposed match between trades +-- or post-trade event reports.+data EventProposedMatch = EventProposedMatch+ { eventProposMatch_choice0 :: (Maybe (OneOf10 ((Maybe (OriginatingEvent)),(Maybe (Trade))) TradeAmendmentContent TradeNotionalChange ((Maybe (TerminatingEvent)),(Maybe (TradeNotionalChange))) TradeNovationContent OptionExercise [OptionExpiry] DeClear Withdrawal AdditionalEvent))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * originatingEvent+ -- + -- * trade+ -- + -- (2) amendment+ -- + -- (3) increase+ -- + -- (4) Sequence of:+ -- + -- * terminatingEvent+ -- + -- * termination+ -- + -- (5) novation+ -- + -- (6) optionExercise+ -- + -- (7) optionExpiry+ -- + -- (8) deClear+ -- + -- (9) withdrawal+ -- + -- (10) The additionalEvent element is an + -- extension/substitution point to customize FpML and add + -- additional events.+ , eventProposMatch_matchId :: Maybe MatchId+ -- ^ A unique identifier assigned by the matching service to + -- each set of matched positions.+ , eventProposMatch_difference :: [TradeDifference]+ -- ^ A type used to record the details of a difference between + -- two sides of a business event.+ , eventProposMatch_matchScore :: Maybe Xsd.Decimal+ -- ^ Numeric score to represent the quality of the match.+ }+ deriving (Eq,Show)+instance SchemaType EventProposedMatch where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return EventProposedMatch+ `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` optional (parseSchemaType "matchId")+ `apply` many (parseSchemaType "difference")+ `apply` optional (parseSchemaType "matchScore")+ schemaTypeToXML s x@EventProposedMatch{} =+ toXMLElement s []+ [ 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)+ ) $ eventProposMatch_choice0 x+ , maybe [] (schemaTypeToXML "matchId") $ eventProposMatch_matchId x+ , concatMap (schemaTypeToXML "difference") $ eventProposMatch_difference x+ , maybe [] (schemaTypeToXML "matchScore") $ eventProposMatch_matchScore x+ ]+ +data EventsChoice = EventsChoice+ { eventsChoice_choice0 :: (Maybe (OneOf10 ((Maybe (OriginatingEvent)),(Maybe (Trade))) TradeAmendmentContent TradeNotionalChange ((Maybe (TerminatingEvent)),(Maybe (TradeNotionalChange))) TradeNovationContent OptionExercise [OptionExpiry] DeClear Withdrawal AdditionalEvent))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * originatingEvent+ -- + -- * trade+ -- + -- (2) amendment+ -- + -- (3) increase+ -- + -- (4) Sequence of:+ -- + -- * terminatingEvent+ -- + -- * termination+ -- + -- (5) novation+ -- + -- (6) optionExercise+ -- + -- (7) optionExpiry+ -- + -- (8) deClear+ -- + -- (9) withdrawal+ -- + -- (10) The additionalEvent element is an + -- extension/substitution point to customize FpML and add + -- additional events.+ }+ deriving (Eq,Show)+instance SchemaType EventsChoice where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return EventsChoice+ `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))+ ])+ schemaTypeToXML s x@EventsChoice{} =+ toXMLElement s []+ [ 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)+ ) $ eventsChoice_choice0 x+ ]+ +-- | A structure describing the effect of a change to an index.+data IndexChange = IndexChange+ { indexChange_eventIdentifier :: [BusinessEventIdentifier]+ , indexChange_indexFactor :: Maybe Xsd.Decimal+ , indexChange_factoredCalculationAmount :: Maybe Money+ }+ deriving (Eq,Show)+instance SchemaType IndexChange where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return IndexChange+ `apply` many (parseSchemaType "eventIdentifier")+ `apply` optional (parseSchemaType "indexFactor")+ `apply` optional (parseSchemaType "factoredCalculationAmount")+ schemaTypeToXML s x@IndexChange{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "eventIdentifier") $ indexChange_eventIdentifier x+ , maybe [] (schemaTypeToXML "indexFactor") $ indexChange_indexFactor x+ , maybe [] (schemaTypeToXML "factoredCalculationAmount") $ indexChange_factoredCalculationAmount x+ ]+instance Extension IndexChange ChangeEvent where+ supertype v = ChangeEvent_IndexChange v+instance Extension IndexChange AbstractEvent where+ supertype = (supertype :: ChangeEvent -> AbstractEvent)+ . (supertype :: IndexChange -> ChangeEvent)+ + +-- | A structure describing an option exercise.+data OptionExercise = OptionExercise+ { optionExerc_eventIdentifier :: [BusinessEventIdentifier]+ , optionExerc_optionSeller :: Maybe PartyReference+ , optionExerc_optionBuyer :: Maybe PartyReference+ , optionExerc_tradeIdentifier :: [PartyTradeIdentifier]+ , optionExerc_exerciseDate :: Maybe Xsd.Date+ , optionExerc_exerciseTime :: Maybe Xsd.Time+ , optionExerc_choice6 :: (Maybe (OneOf5 Xsd.Boolean Xsd.Boolean ((Maybe (Money)),(Maybe (Money))) ((Maybe (Xsd.Decimal)),(Maybe (Xsd.Decimal))) ((Maybe (Xsd.Decimal)),(Maybe (Xsd.Decimal)))))+ -- ^ Choice between:+ -- + -- (1) expiry+ -- + -- (2) fullExercise+ -- + -- (3) Sequence of:+ -- + -- * Specifies the fixed amount by which the option + -- should be exercised expressed as notional amount.+ -- + -- * Specifies the Notional amount after the Change+ -- + -- (4) Sequence of:+ -- + -- * Specifies the fixed amount by which the option + -- should be exercised expressed as number of options.+ -- + -- * Specifies the Number of Options after the Change.+ -- + -- (5) Sequence of:+ -- + -- * Specifies the fixed amount by which the option + -- should be exercised express as number of units.+ -- + -- * Specifies the Number of Units+ , optionExerc_choice7 :: (Maybe (OneOf3 SettlementTypeEnum SimplePayment PhysicalSettlement))+ -- ^ Choice between:+ -- + -- (1) settlementType+ -- + -- (2) cashSettlement+ -- + -- (3) physicalSettlement+ , optionExerc_payment :: Maybe NonNegativePayment+ }+ deriving (Eq,Show)+instance SchemaType OptionExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OptionExercise+ `apply` many (parseSchemaType "eventIdentifier")+ `apply` optional (parseSchemaType "optionSeller")+ `apply` optional (parseSchemaType "optionBuyer")+ `apply` many (parseSchemaType "tradeIdentifier")+ `apply` optional (parseSchemaType "exerciseDate")+ `apply` optional (parseSchemaType "exerciseTime")+ `apply` optional (oneOf' [ ("Xsd.Boolean", fmap OneOf5 (parseSchemaType "expiry"))+ , ("Xsd.Boolean", fmap TwoOf5 (parseSchemaType "fullExercise"))+ , ("Maybe Money Maybe Money", fmap ThreeOf5 (return (,) `apply` optional (parseSchemaType "exerciseInNotionalAmount")+ `apply` optional (parseSchemaType "outstandingNotionalAmount")))+ , ("Maybe Xsd.Decimal Maybe Xsd.Decimal", fmap FourOf5 (return (,) `apply` optional (parseSchemaType "exerciseInNumberOfOptions")+ `apply` optional (parseSchemaType "outstandingNumberOfOptions")))+ , ("Maybe Xsd.Decimal Maybe Xsd.Decimal", fmap FiveOf5 (return (,) `apply` optional (parseSchemaType "exerciseInNumberOfUnits")+ `apply` optional (parseSchemaType "outstandingNumberOfUnits")))+ ])+ `apply` optional (oneOf' [ ("SettlementTypeEnum", fmap OneOf3 (parseSchemaType "settlementType"))+ , ("SimplePayment", fmap TwoOf3 (parseSchemaType "cashSettlement"))+ , ("PhysicalSettlement", fmap ThreeOf3 (parseSchemaType "physicalSettlement"))+ ])+ `apply` optional (parseSchemaType "payment")+ schemaTypeToXML s x@OptionExercise{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "eventIdentifier") $ optionExerc_eventIdentifier x+ , maybe [] (schemaTypeToXML "optionSeller") $ optionExerc_optionSeller x+ , maybe [] (schemaTypeToXML "optionBuyer") $ optionExerc_optionBuyer x+ , concatMap (schemaTypeToXML "tradeIdentifier") $ optionExerc_tradeIdentifier x+ , maybe [] (schemaTypeToXML "exerciseDate") $ optionExerc_exerciseDate x+ , maybe [] (schemaTypeToXML "exerciseTime") $ optionExerc_exerciseTime x+ , maybe [] (foldOneOf5 (schemaTypeToXML "expiry")+ (schemaTypeToXML "fullExercise")+ (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "exerciseInNotionalAmount") a+ , maybe [] (schemaTypeToXML "outstandingNotionalAmount") b+ ])+ (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "exerciseInNumberOfOptions") a+ , maybe [] (schemaTypeToXML "outstandingNumberOfOptions") b+ ])+ (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "exerciseInNumberOfUnits") a+ , maybe [] (schemaTypeToXML "outstandingNumberOfUnits") b+ ])+ ) $ optionExerc_choice6 x+ , maybe [] (foldOneOf3 (schemaTypeToXML "settlementType")+ (schemaTypeToXML "cashSettlement")+ (schemaTypeToXML "physicalSettlement")+ ) $ optionExerc_choice7 x+ , maybe [] (schemaTypeToXML "payment") $ optionExerc_payment x+ ]+instance Extension OptionExercise AbstractEvent where+ supertype v = AbstractEvent_OptionExercise v+ +-- | A structure describing an option expiring (i.e. passing its +-- last exercise time and becoming worthless.)+data OptionExpiry = OptionExpiry+ { optionExpiry_eventIdentifier :: [BusinessEventIdentifier]+ , optionExpiry_tradeIdentifier :: [PartyTradeIdentifier]+ , optionExpiry_date :: Maybe Xsd.Date+ , optionExpiry_time :: Maybe Xsd.Time+ , optionExpiry_exerciseProcedure :: Maybe ExerciseProcedureOption+ }+ deriving (Eq,Show)+instance SchemaType OptionExpiry where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OptionExpiry+ `apply` many (parseSchemaType "eventIdentifier")+ `apply` many (parseSchemaType "tradeIdentifier")+ `apply` optional (parseSchemaType "date")+ `apply` optional (parseSchemaType "time")+ `apply` optional (parseSchemaType "exerciseProcedure")+ schemaTypeToXML s x@OptionExpiry{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "eventIdentifier") $ optionExpiry_eventIdentifier x+ , concatMap (schemaTypeToXML "tradeIdentifier") $ optionExpiry_tradeIdentifier x+ , maybe [] (schemaTypeToXML "date") $ optionExpiry_date x+ , maybe [] (schemaTypeToXML "time") $ optionExpiry_time x+ , maybe [] (schemaTypeToXML "exerciseProcedure") $ optionExpiry_exerciseProcedure x+ ]+instance Extension OptionExpiry AbstractEvent where+ supertype v = AbstractEvent_OptionExpiry v+ +-- | A structure describing an option expiring.+data OptionExpiryBase = OptionExpiryBase+ { optionExpiryBase_tradeIdentifier :: [PartyTradeIdentifier]+ , optionExpiryBase_date :: Maybe Xsd.Date+ , optionExpiryBase_time :: Maybe Xsd.Time+ }+ deriving (Eq,Show)+instance SchemaType OptionExpiryBase where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OptionExpiryBase+ `apply` many (parseSchemaType "tradeIdentifier")+ `apply` optional (parseSchemaType "date")+ `apply` optional (parseSchemaType "time")+ schemaTypeToXML s x@OptionExpiryBase{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "tradeIdentifier") $ optionExpiryBase_tradeIdentifier x+ , maybe [] (schemaTypeToXML "date") $ optionExpiryBase_date x+ , maybe [] (schemaTypeToXML "time") $ optionExpiryBase_time x+ ]+ +-- | A structure that describes how an option settles into a +-- physical trade.+data PhysicalSettlement = PhysicalSettlement+ { physicSettl_choice0 :: (Maybe (OneOf3 PartyTradeIdentifier Trade Product))+ -- ^ Choice between:+ -- + -- (1) The ID of the trade that resulted from the physical + -- settlement.+ -- + -- (2) The trade that resulted from the physical settlement.+ -- + -- (3) An abstract element used as a place holder for the + -- substituting product elements.+ }+ deriving (Eq,Show)+instance SchemaType PhysicalSettlement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PhysicalSettlement+ `apply` optional (oneOf' [ ("PartyTradeIdentifier", fmap OneOf3 (parseSchemaType "resultingTradeIdentifier"))+ , ("Trade", fmap TwoOf3 (parseSchemaType "resultingTrade"))+ , ("Product", fmap ThreeOf3 (elementProduct))+ ])+ schemaTypeToXML s x@PhysicalSettlement{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "resultingTradeIdentifier")+ (schemaTypeToXML "resultingTrade")+ (elementToXMLProduct)+ ) $ physicSettl_choice0 x+ ]+ +data PhysicalExercise = PhysicalExercise+ { physicExerc_choice0 :: (Maybe (OneOf2 Trade PartyTradeIdentifiers))+ -- ^ Choice between:+ -- + -- (1) An element that allows the full details of the trade to + -- be used as a mechanism for identifying the trade for + -- which the post-trade event pertains+ -- + -- (2) A container since an individual trade can be referenced + -- by two or more different partyTradeIdentifier elements + -- - each allocated by a different party.+ }+ deriving (Eq,Show)+instance SchemaType PhysicalExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PhysicalExercise+ `apply` optional (oneOf' [ ("Trade", fmap OneOf2 (parseSchemaType "trade"))+ , ("PartyTradeIdentifiers", fmap TwoOf2 (parseSchemaType "tradeReference"))+ ])+ schemaTypeToXML s x@PhysicalExercise{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "trade")+ (schemaTypeToXML "tradeReference")+ ) $ physicExerc_choice0 x+ ]+ +-- | A type that describes why a trade terminated.+data TerminatingEvent = TerminatingEvent Scheme TerminatingEventAttributes deriving (Eq,Show)+data TerminatingEventAttributes = TerminatingEventAttributes+ { terminEventAttrib_terminatingEventScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType TerminatingEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "terminatingEventScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ TerminatingEvent v (TerminatingEventAttributes a0)+ schemaTypeToXML s (TerminatingEvent bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "terminatingEventScheme") $ terminEventAttrib_terminatingEventScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension TerminatingEvent Scheme where+ supertype (TerminatingEvent s _) = s+ +-- | A structure describing a negotiated amendment.+data TradeAmendmentContent = TradeAmendmentContent+ { tradeAmendmContent_eventIdentifier :: [BusinessEventIdentifier]+ , tradeAmendmContent_trade :: Maybe Trade+ -- ^ A fulll description of the amended trade (i.e. the trade + -- after the amendment).+ , tradeAmendmContent_agreementDate :: Maybe Xsd.Date+ -- ^ The date on which the change was agreed.+ , tradeAmendmContent_executionDateTime :: ExecutionDateTime+ -- ^ The date and time at which the negotiated change to the + -- terms of the original contract was agreed, such as via + -- telephone or electronic trading system (i.e., agreement + -- date/time).+ , tradeAmendmContent_effectiveDate :: Maybe Xsd.Date+ -- ^ The date on which the change become effective.+ , tradeAmendmContent_payment :: Maybe Payment+ -- ^ Describes a payment made in settlement of the change.+ }+ deriving (Eq,Show)+instance SchemaType TradeAmendmentContent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return TradeAmendmentContent+ `apply` many (parseSchemaType "eventIdentifier")+ `apply` optional (parseSchemaType "trade")+ `apply` optional (parseSchemaType "agreementDate")+ `apply` parseSchemaType "executionDateTime"+ `apply` optional (parseSchemaType "effectiveDate")+ `apply` optional (parseSchemaType "payment")+ schemaTypeToXML s x@TradeAmendmentContent{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "eventIdentifier") $ tradeAmendmContent_eventIdentifier x+ , maybe [] (schemaTypeToXML "trade") $ tradeAmendmContent_trade x+ , maybe [] (schemaTypeToXML "agreementDate") $ tradeAmendmContent_agreementDate x+ , schemaTypeToXML "executionDateTime" $ tradeAmendmContent_executionDateTime x+ , maybe [] (schemaTypeToXML "effectiveDate") $ tradeAmendmContent_effectiveDate x+ , maybe [] (schemaTypeToXML "payment") $ tradeAmendmContent_payment x+ ]+instance Extension TradeAmendmentContent AbstractEvent where+ supertype v = AbstractEvent_TradeAmendmentContent v+ +-- | A structure describing a trade change.+data TradeChangeBase = TradeChangeBase+ { tradeChangeBase_eventIdentifier :: [BusinessEventIdentifier]+ , tradeChangeBase_choice1 :: OneOf2 [PartyTradeIdentifier] Trade+ -- ^ Choice between:+ -- + -- (1) tradeIdentifier+ -- + -- (2) originalTrade+ , tradeChangeBase_agreementDate :: Maybe Xsd.Date+ -- ^ The date on which the change was agreed.+ , tradeChangeBase_executionDateTime :: ExecutionDateTime+ -- ^ The date and time at which the negotiated change to the + -- terms of the original contract was agreed, such as via + -- telephone or electronic trading system (i.e., agreement + -- date/time).+ , tradeChangeBase_effectiveDate :: Maybe Xsd.Date+ -- ^ The date on which the change become effective.+ , tradeChangeBase_payment :: Maybe Payment+ -- ^ Describes a payment made in settlement of the change.+ }+ deriving (Eq,Show)+instance SchemaType TradeChangeBase where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return TradeChangeBase+ `apply` many (parseSchemaType "eventIdentifier")+ `apply` oneOf' [ ("[PartyTradeIdentifier]", fmap OneOf2 (many1 (parseSchemaType "tradeIdentifier")))+ , ("Trade", fmap TwoOf2 (parseSchemaType "originalTrade"))+ ]+ `apply` optional (parseSchemaType "agreementDate")+ `apply` parseSchemaType "executionDateTime"+ `apply` optional (parseSchemaType "effectiveDate")+ `apply` optional (parseSchemaType "payment")+ schemaTypeToXML s x@TradeChangeBase{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "eventIdentifier") $ tradeChangeBase_eventIdentifier x+ , foldOneOf2 (concatMap (schemaTypeToXML "tradeIdentifier"))+ (schemaTypeToXML "originalTrade")+ $ tradeChangeBase_choice1 x+ , maybe [] (schemaTypeToXML "agreementDate") $ tradeChangeBase_agreementDate x+ , schemaTypeToXML "executionDateTime" $ tradeChangeBase_executionDateTime x+ , maybe [] (schemaTypeToXML "effectiveDate") $ tradeChangeBase_effectiveDate x+ , maybe [] (schemaTypeToXML "payment") $ tradeChangeBase_payment x+ ]+instance Extension TradeChangeBase AbstractEvent where+ supertype v = AbstractEvent_TradeChangeBase v+ +-- | A structure describing a non-negotiated trade resulting +-- from a market event.+data TradeChangeContent = TradeChangeContent+ { tradeChangeContent_choice0 :: (Maybe (OneOf2 PartyTradeIdentifier Trade))+ -- ^ Choice between:+ -- + -- (1) The original qualified trade identifier.+ -- + -- (2) The original trade details.+ , tradeChangeContent_trade :: Maybe Trade+ -- ^ A full description of the amended trade.+ , tradeChangeContent_effectiveDate :: Maybe Xsd.Date+ -- ^ The date on which the change become effective+ , tradeChangeContent_changeEvent :: Maybe ChangeEvent+ -- ^ Abstract substitutable place holder for specific change + -- details.+ , tradeChangeContent_payment :: Maybe Payment+ -- ^ Describes a payment made in settlement of the change.+ }+ deriving (Eq,Show)+instance SchemaType TradeChangeContent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return TradeChangeContent+ `apply` optional (oneOf' [ ("PartyTradeIdentifier", fmap OneOf2 (parseSchemaType "oldTradeIdentifier"))+ , ("Trade", fmap TwoOf2 (parseSchemaType "oldTrade"))+ ])+ `apply` optional (parseSchemaType "trade")+ `apply` optional (parseSchemaType "effectiveDate")+ `apply` optional (elementChangeEvent)+ `apply` optional (parseSchemaType "payment")+ schemaTypeToXML s x@TradeChangeContent{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "oldTradeIdentifier")+ (schemaTypeToXML "oldTrade")+ ) $ tradeChangeContent_choice0 x+ , maybe [] (schemaTypeToXML "trade") $ tradeChangeContent_trade x+ , maybe [] (schemaTypeToXML "effectiveDate") $ tradeChangeContent_effectiveDate x+ , maybe [] (elementToXMLChangeEvent) $ tradeChangeContent_changeEvent x+ , maybe [] (schemaTypeToXML "payment") $ tradeChangeContent_payment x+ ]+ +-- | A structure describing a trade maturing.+data TradeMaturity = TradeMaturity+ { tradeMatur_tradeIdentifier :: [PartyTradeIdentifier]+ , tradeMatur_date :: Maybe Xsd.Date+ }+ deriving (Eq,Show)+instance SchemaType TradeMaturity where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return TradeMaturity+ `apply` many (parseSchemaType "tradeIdentifier")+ `apply` optional (parseSchemaType "date")+ schemaTypeToXML s x@TradeMaturity{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "tradeIdentifier") $ tradeMatur_tradeIdentifier x+ , maybe [] (schemaTypeToXML "date") $ tradeMatur_date x+ ]+ +-- | A structure describing a change to the trade notional.+data TradeNotionalChange = TradeNotionalChange+ { tradeNotionChange_eventIdentifier :: [BusinessEventIdentifier]+ , tradeNotionChange_choice1 :: OneOf2 [PartyTradeIdentifier] Trade+ -- ^ Choice between:+ -- + -- (1) tradeIdentifier+ -- + -- (2) originalTrade+ , tradeNotionChange_agreementDate :: Maybe Xsd.Date+ -- ^ The date on which the change was agreed.+ , tradeNotionChange_executionDateTime :: ExecutionDateTime+ -- ^ The date and time at which the negotiated change to the + -- terms of the original contract was agreed, such as via + -- telephone or electronic trading system (i.e., agreement + -- date/time).+ , tradeNotionChange_effectiveDate :: Maybe Xsd.Date+ -- ^ The date on which the change become effective.+ , tradeNotionChange_payment :: Maybe Payment+ -- ^ Describes a payment made in settlement of the change.+ , tradeNotionChange_choice6 :: (Maybe (OneOf3 ((Maybe (NonNegativeMoney)),(Maybe (Money))) ((Maybe (Xsd.Decimal)),(Maybe (Xsd.Decimal))) ((Maybe (Xsd.Decimal)),(Maybe (Xsd.Decimal)))))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * Specifies the fixed amount by which the Notional + -- Amount changes. The direction of the change + -- (increase or decrease) is specified by the event + -- type (Termination => reduction, Increase => + -- greater.)+ -- + -- * Specifies the Notional amount after the Change+ -- + -- (2) Sequence of:+ -- + -- * Specifies the fixed amount by which the Number of + -- Options changes+ -- + -- * Specifies the Number of Options after the Change.+ -- + -- (3) Sequence of:+ -- + -- * Specifies the fixed amount by which the Number of + -- Units changes+ -- + -- * Specifies the Number of Units+ }+ deriving (Eq,Show)+instance SchemaType TradeNotionalChange where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return TradeNotionalChange+ `apply` many (parseSchemaType "eventIdentifier")+ `apply` oneOf' [ ("[PartyTradeIdentifier]", fmap OneOf2 (many1 (parseSchemaType "tradeIdentifier")))+ , ("Trade", fmap TwoOf2 (parseSchemaType "originalTrade"))+ ]+ `apply` optional (parseSchemaType "agreementDate")+ `apply` parseSchemaType "executionDateTime"+ `apply` optional (parseSchemaType "effectiveDate")+ `apply` optional (parseSchemaType "payment")+ `apply` optional (oneOf' [ ("Maybe NonNegativeMoney Maybe Money", fmap OneOf3 (return (,) `apply` optional (parseSchemaType "changeInNotionalAmount")+ `apply` optional (parseSchemaType "outstandingNotionalAmount")))+ , ("Maybe Xsd.Decimal Maybe Xsd.Decimal", fmap TwoOf3 (return (,) `apply` optional (parseSchemaType "changeInNumberOfOptions")+ `apply` optional (parseSchemaType "outstandingNumberOfOptions")))+ , ("Maybe Xsd.Decimal Maybe Xsd.Decimal", fmap ThreeOf3 (return (,) `apply` optional (parseSchemaType "changeInNumberOfUnits")+ `apply` optional (parseSchemaType "outstandingNumberOfUnits")))+ ])+ schemaTypeToXML s x@TradeNotionalChange{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "eventIdentifier") $ tradeNotionChange_eventIdentifier x+ , foldOneOf2 (concatMap (schemaTypeToXML "tradeIdentifier"))+ (schemaTypeToXML "originalTrade")+ $ tradeNotionChange_choice1 x+ , maybe [] (schemaTypeToXML "agreementDate") $ tradeNotionChange_agreementDate x+ , schemaTypeToXML "executionDateTime" $ tradeNotionChange_executionDateTime x+ , maybe [] (schemaTypeToXML "effectiveDate") $ tradeNotionChange_effectiveDate x+ , maybe [] (schemaTypeToXML "payment") $ tradeNotionChange_payment x+ , maybe [] (foldOneOf3 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "changeInNotionalAmount") a+ , maybe [] (schemaTypeToXML "outstandingNotionalAmount") b+ ])+ (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "changeInNumberOfOptions") a+ , maybe [] (schemaTypeToXML "outstandingNumberOfOptions") b+ ])+ (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "changeInNumberOfUnits") a+ , maybe [] (schemaTypeToXML "outstandingNumberOfUnits") b+ ])+ ) $ tradeNotionChange_choice6 x+ ]+instance Extension TradeNotionalChange TradeChangeBase where+ supertype (TradeNotionalChange e0 e1 e2 e3 e4 e5 e6) =+ TradeChangeBase e0 e1 e2 e3 e4 e5+instance Extension TradeNotionalChange AbstractEvent where+ supertype = (supertype :: TradeChangeBase -> AbstractEvent)+ . (supertype :: TradeNotionalChange -> TradeChangeBase)+ + +-- | A structure describing a novation.+data TradeNovationContent = TradeNovationContent+ { tradeNovatContent_eventIdentifier :: [BusinessEventIdentifier]+ , tradeNovatContent_choice1 :: (Maybe (OneOf2 [PartyTradeIdentifier] Trade))+ -- ^ Choice between:+ -- + -- (1) Indicates a reference to the original trade between the + -- transferor and the remaining party.+ -- + -- (2) Indicates the original trade between the transferor and + -- the remaining party.+ , tradeNovatContent_choice2 :: (Maybe (OneOf2 [PartyTradeIdentifier] Trade))+ -- ^ Choice between identification and representation of the new + -- contract.+ -- + -- Choice between:+ -- + -- (1) Indicates a reference to the new trade between the + -- transferee and the remaining party.+ -- + -- (2) Indicates the original trade between the transferor and + -- the remaining party.+ , tradeNovatContent_transferor :: Maybe PartyReference+ -- ^ A pointer style reference to a party identifier defined + -- elsewhere in the document. In a three-way novation the + -- party referenced is the Transferor (outgoing party) in the + -- novation. The Transferor means a party which transfers by + -- novation to a Transferee all of its rights, liabilities, + -- duties and obligations with respect to a Remaining Party. + -- In a four-way novation the party referenced is Transferor 1 + -- which transfers by novation to Transferee 1 all of its + -- rights, liabilities, duties and obligations with respect to + -- Transferor 2. ISDA 2004 Novation Term: Transferor + -- (three-way novation) or Transferor 1 (four-way novation).+ , tradeNovatContent_transferorAccount :: Maybe AccountReference+ , tradeNovatContent_transferee :: Maybe PartyReference+ -- ^ A pointer style reference to a party identifier defined + -- elsewhere in the document. In a three-way novation the + -- party referenced is the Transferee (incoming party) in the + -- novation. Transferee means a party which accepts by way of + -- novation all rights, liabilities, duties and obligations of + -- a Transferor with respect to a Remaining Party. In a + -- four-way novation the party referenced is Transferee 1 + -- which accepts by way of novation the rights, liabilities, + -- duties and obligations of Transferor 1. ISDA 2004 Novation + -- Term: Transferee (three-way novation) or Transferee 1 + -- (four-way novation).+ , tradeNovatContent_transfereeAccount :: Maybe AccountReference+ , tradeNovatContent_remainingParty :: Maybe PartyReference+ -- ^ A pointer style reference to a party identifier defined + -- elsewhere in the document. In a three-way novation the + -- party referenced is the Remaining Party in the novation. + -- Remaining Party means a party which consents to a + -- Transferor's transfer by novation and the acceptance + -- thereof by the Transferee of all of the Transferor's + -- rights, liabilities, duties and obligations with respect to + -- such Remaining Party under and with respect of the Novated + -- Amount of a transaction. In a four-way novation the party + -- referenced is Transferor 2 per the ISDA definition and acts + -- in the role of a Transferor. Transferor 2 transfers by + -- novation to Transferee 2 all of its rights, liabilities, + -- duties and obligations with respect to Transferor 1. ISDA + -- 2004 Novation Term: Remaining Party (three-way novation) or + -- Transferor 2 (four-way novation).+ , tradeNovatContent_remainingPartyAccount :: Maybe AccountReference+ , tradeNovatContent_otherRemainingParty :: Maybe PartyReference+ -- ^ A pointer style reference to a party identifier defined + -- elsewhere in the document. This element is not applicable + -- in a three-way novation and should be omitted. In a + -- four-way novation the party referenced is Transferee 2. + -- Transferee 2 means a party which accepts by way of novation + -- the rights, liabilities, duties and obligations of + -- Transferor 2. ISDA 2004 Novation Term: Transferee 2 + -- (four-way novation).+ , tradeNovatContent_otherRemainingPartyAccount :: Maybe AccountReference+ , tradeNovatContent_novationDate :: Xsd.Date+ -- ^ Specifies the date that one party's legal obligations with + -- regard to a trade are transferred to another party. It + -- corresponds to the Novation Date section of the 2004 ISDA + -- Novation Definitions, section 1.16.+ , tradeNovatContent_executionDateTime :: ExecutionDateTime+ -- ^ The date and time at which the change was agreed.+ , tradeNovatContent_novationTradeDate :: Xsd.Date+ -- ^ Specifies the date the parties agree to assign or novate a + -- Contract. If this element is not specified, the + -- novationContractDate will be deemed to be the novationDate. + -- It corresponds to the Novation Trade Date section of the + -- 2004 ISDA Novation Definitions, section 1.17.+ , tradeNovatContent_choice14 :: (Maybe (OneOf3 ((Maybe (Money)),(Maybe (Money))) ((Maybe (Xsd.Decimal)),(Maybe (Xsd.Decimal))) ((Maybe (Xsd.Decimal)),(Maybe (Xsd.Decimal)))))+ -- ^ Choice for expressing the novated amount as either a money + -- amount, number of options, or number of units, according + -- the the financial product which is being novated.+ -- + -- Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The amount which represents the portion of the Old + -- Contract being novated.+ -- + -- * The amount which represents the portion of the Old + -- Contract not being novated.+ -- + -- (2) Sequence of:+ -- + -- * The number of options which represent the portion + -- of the Old Contract being novated.+ -- + -- * The number of options which represent the portion + -- of the Old Contract not being novated.+ -- + -- (3) Sequence of:+ -- + -- * The number of options which represent the portion + -- of the Old Contract being novated.+ -- + -- * The number of options which represent the portion + -- of the Old Contract not being novated.+ , tradeNovatContent_fullFirstCalculationPeriod :: Maybe Xsd.Boolean+ -- ^ This element corresponds to the applicability of the Full + -- First Calculation Period as defined in the 2004 ISDA + -- Novation Definitions, section 1.20.+ , tradeNovatContent_firstPeriodStartDate :: [FirstPeriodStartDate]+ -- ^ Element that is used to be able to make sense of the “new + -- transaction” without requiring reference back to the + -- “old transaction”. In the case of interest rate + -- products there are potentially 2 “first period start + -- dates” to reference – one with respect to each party to + -- the new transaction. For Credit Default Swaps there is just + -- the one with respect to the party that is the fixed rate + -- payer.+ , tradeNovatContent_nonReliance :: Maybe Empty+ -- ^ This element corresponds to the non-Reliance section in the + -- 2004 ISDA Novation Definitions, section 2.1 (c) (i). The + -- element appears in the instance document when non-Reliance + -- is applicable.+ , tradeNovatContent_creditDerivativesNotices :: Maybe CreditDerivativesNotices+ -- ^ This element should be specified if one or more of either a + -- Credit Event Notice, Notice of Publicly Available + -- Information, Notice of Physical Settlement or Notice of + -- Intended Physical Settlement, as applicable, has been + -- delivered by or to the Transferor or the Remaining Party. + -- The type of notice or notices that have been delivered + -- should be indicated by setting the relevant boolean element + -- value(s) to true. The absence of the element means that no + -- Credit Event Notice, Notice of Publicly Available + -- Information, Notice of Physical Settlement or Notice of + -- Intended Physical Settlement, as applicable, has been + -- delivered by or to the Transferor or the Remaining Party.+ , tradeNovatContent_contractualDefinitions :: [ContractualDefinitions]+ -- ^ The definitions (such as those published by ISDA) that will + -- define the terms of the novation transaction.+ , tradeNovatContent_contractualTermsSupplement :: [ContractualTermsSupplement]+ -- ^ A contractual supplement (such as those published by ISDA) + -- that will apply to the trade.+ , tradeNovatContent_payment :: Maybe Payment+ -- ^ Describes a payment made in settlement of the novation.+ }+ deriving (Eq,Show)+instance SchemaType TradeNovationContent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return TradeNovationContent+ `apply` many (parseSchemaType "eventIdentifier")+ `apply` optional (oneOf' [ ("[PartyTradeIdentifier]", fmap OneOf2 (many1 (parseSchemaType "oldTradeIdentifier")))+ , ("Trade", fmap TwoOf2 (parseSchemaType "oldTrade"))+ ])+ `apply` optional (oneOf' [ ("[PartyTradeIdentifier]", fmap OneOf2 (many1 (parseSchemaType "newTradeIdentifier")))+ , ("Trade", fmap TwoOf2 (parseSchemaType "newTrade"))+ ])+ `apply` optional (parseSchemaType "transferor")+ `apply` optional (parseSchemaType "transferorAccount")+ `apply` optional (parseSchemaType "transferee")+ `apply` optional (parseSchemaType "transfereeAccount")+ `apply` optional (parseSchemaType "remainingParty")+ `apply` optional (parseSchemaType "remainingPartyAccount")+ `apply` optional (parseSchemaType "otherRemainingParty")+ `apply` optional (parseSchemaType "otherRemainingPartyAccount")+ `apply` parseSchemaType "novationDate"+ `apply` parseSchemaType "executionDateTime"+ `apply` parseSchemaType "novationTradeDate"+ `apply` optional (oneOf' [ ("Maybe Money Maybe Money", fmap OneOf3 (return (,) `apply` optional (parseSchemaType "novatedAmount")+ `apply` optional (parseSchemaType "remainingAmount")))+ , ("Maybe Xsd.Decimal Maybe Xsd.Decimal", fmap TwoOf3 (return (,) `apply` optional (parseSchemaType "novatedNumberOfOptions")+ `apply` optional (parseSchemaType "remainingNumberOfOptions")))+ , ("Maybe Xsd.Decimal Maybe Xsd.Decimal", fmap ThreeOf3 (return (,) `apply` optional (parseSchemaType "novatedNumberOfUnits")+ `apply` optional (parseSchemaType "remainingNumberOfUnits")))+ ])+ `apply` optional (parseSchemaType "fullFirstCalculationPeriod")+ `apply` between (Occurs (Just 0) (Just 2))+ (parseSchemaType "firstPeriodStartDate")+ `apply` optional (parseSchemaType "nonReliance")+ `apply` optional (parseSchemaType "creditDerivativesNotices")+ `apply` many (parseSchemaType "contractualDefinitions")+ `apply` many (parseSchemaType "contractualTermsSupplement")+ `apply` optional (parseSchemaType "payment")+ schemaTypeToXML s x@TradeNovationContent{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "eventIdentifier") $ tradeNovatContent_eventIdentifier x+ , maybe [] (foldOneOf2 (concatMap (schemaTypeToXML "oldTradeIdentifier"))+ (schemaTypeToXML "oldTrade")+ ) $ tradeNovatContent_choice1 x+ , maybe [] (foldOneOf2 (concatMap (schemaTypeToXML "newTradeIdentifier"))+ (schemaTypeToXML "newTrade")+ ) $ tradeNovatContent_choice2 x+ , maybe [] (schemaTypeToXML "transferor") $ tradeNovatContent_transferor x+ , maybe [] (schemaTypeToXML "transferorAccount") $ tradeNovatContent_transferorAccount x+ , maybe [] (schemaTypeToXML "transferee") $ tradeNovatContent_transferee x+ , maybe [] (schemaTypeToXML "transfereeAccount") $ tradeNovatContent_transfereeAccount x+ , maybe [] (schemaTypeToXML "remainingParty") $ tradeNovatContent_remainingParty x+ , maybe [] (schemaTypeToXML "remainingPartyAccount") $ tradeNovatContent_remainingPartyAccount x+ , maybe [] (schemaTypeToXML "otherRemainingParty") $ tradeNovatContent_otherRemainingParty x+ , maybe [] (schemaTypeToXML "otherRemainingPartyAccount") $ tradeNovatContent_otherRemainingPartyAccount x+ , schemaTypeToXML "novationDate" $ tradeNovatContent_novationDate x+ , schemaTypeToXML "executionDateTime" $ tradeNovatContent_executionDateTime x+ , schemaTypeToXML "novationTradeDate" $ tradeNovatContent_novationTradeDate x+ , maybe [] (foldOneOf3 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "novatedAmount") a+ , maybe [] (schemaTypeToXML "remainingAmount") b+ ])+ (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "novatedNumberOfOptions") a+ , maybe [] (schemaTypeToXML "remainingNumberOfOptions") b+ ])+ (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "novatedNumberOfUnits") a+ , maybe [] (schemaTypeToXML "remainingNumberOfUnits") b+ ])+ ) $ tradeNovatContent_choice14 x+ , maybe [] (schemaTypeToXML "fullFirstCalculationPeriod") $ tradeNovatContent_fullFirstCalculationPeriod x+ , concatMap (schemaTypeToXML "firstPeriodStartDate") $ tradeNovatContent_firstPeriodStartDate x+ , maybe [] (schemaTypeToXML "nonReliance") $ tradeNovatContent_nonReliance x+ , maybe [] (schemaTypeToXML "creditDerivativesNotices") $ tradeNovatContent_creditDerivativesNotices x+ , concatMap (schemaTypeToXML "contractualDefinitions") $ tradeNovatContent_contractualDefinitions x+ , concatMap (schemaTypeToXML "contractualTermsSupplement") $ tradeNovatContent_contractualTermsSupplement x+ , maybe [] (schemaTypeToXML "payment") $ tradeNovatContent_payment x+ ]+instance Extension TradeNovationContent AbstractEvent where+ supertype v = AbstractEvent_TradeNovationContent v+ +-- | Defines a type that allows trade identifiers and/or trade +-- information to be represented for a trade.+data TradeReferenceInformation = TradeReferenceInformation+ { tradeRefInfo_choice0 :: (Maybe (OneOf2 OriginatingEvent TerminatingEvent))+ -- ^ Choice between:+ -- + -- (1) originatingEvent+ -- + -- (2) terminatingEvent+ , tradeRefInfo_partyTradeIdentifier :: [PartyTradeIdentifier]+ -- ^ This allows the acknowledging party to supply additional + -- trade identifiers for a trade underlying a request relating + -- to a business event.+ , tradeRefInfo_partyTradeInformation :: [PartyTradeInformation]+ -- ^ This allows the acknowledging party to supply additional + -- trade information about a trade underlying a request + -- relating to a business event.+ , tradeRefInfo_productType :: Maybe ProductType+ , tradeRefInfo_productId :: Maybe ProductId+ }+ deriving (Eq,Show)+instance SchemaType TradeReferenceInformation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return TradeReferenceInformation+ `apply` optional (oneOf' [ ("OriginatingEvent", fmap OneOf2 (parseSchemaType "originatingEvent"))+ , ("TerminatingEvent", fmap TwoOf2 (parseSchemaType "terminatingEvent"))+ ])+ `apply` many (parseSchemaType "partyTradeIdentifier")+ `apply` many (parseSchemaType "partyTradeInformation")+ `apply` optional (parseSchemaType "productType")+ `apply` optional (parseSchemaType "productId")+ schemaTypeToXML s x@TradeReferenceInformation{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "originatingEvent")+ (schemaTypeToXML "terminatingEvent")+ ) $ tradeRefInfo_choice0 x+ , concatMap (schemaTypeToXML "partyTradeIdentifier") $ tradeRefInfo_partyTradeIdentifier x+ , concatMap (schemaTypeToXML "partyTradeInformation") $ tradeRefInfo_partyTradeInformation x+ , maybe [] (schemaTypeToXML "productType") $ tradeRefInfo_productType x+ , maybe [] (schemaTypeToXML "productId") $ tradeRefInfo_productId x+ ]+ +-- | The additionalEvent element is an extension/substitution +-- point to customize FpML and add additional events.+-- (There are no elements in any substitution group for this element.)+elementAdditionalEvent :: XMLParser AdditionalEvent+elementAdditionalEvent = fail "Parse failed when expecting an element in the substitution group for\n\+\ <additionalEvent>,\n\+\ There are no substitutable elements."+elementToXMLAdditionalEvent :: AdditionalEvent -> [Content ()]+elementToXMLAdditionalEvent = schemaTypeToXML "additionalEvent"+ +-- | Abstract substitutable place holder for specific change +-- details.+elementChangeEvent :: XMLParser ChangeEvent+elementChangeEvent = parseSchemaType "changeEvent"+elementToXMLChangeEvent :: ChangeEvent -> [Content ()]+elementToXMLChangeEvent = schemaTypeToXML "changeEvent"+ +-- | Describes a change due to an index component being +-- adjusted.+elementIndexChange :: XMLParser IndexChange+elementIndexChange = parseSchemaType "indexChange"+elementToXMLIndexChange :: IndexChange -> [Content ()]+elementToXMLIndexChange = schemaTypeToXML "indexChange"+ + + + + + + + + +
+ Data/FpML/V53/Events/Business.hs-boot view
@@ -0,0 +1,244 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Events.Business+ ( module Data.FpML.V53.Events.Business+ , module Data.FpML.V53.Msg+ , 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 qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Msg+import {-# SOURCE #-} Data.FpML.V53.Asset+ +-- | A type defining an event identifier issued by the indicated +-- party. +data BusinessEventIdentifier+instance Eq BusinessEventIdentifier+instance Show BusinessEventIdentifier+instance SchemaType BusinessEventIdentifier+ +-- | A post-trade event reference identifier allocated by a +-- party. FpML does not define the domain values associated +-- with this element. Note that the domain values for this +-- element are not strictly an enumerated list. +data EventId+data EventIdAttributes+instance Eq EventId+instance Eq EventIdAttributes+instance Show EventId+instance Show EventIdAttributes+instance SchemaType EventId+instance Extension EventId Scheme+ +-- | Abstract base type for all events. +data AbstractEvent+instance Eq AbstractEvent+instance Show AbstractEvent+instance SchemaType AbstractEvent+ +-- | Abstract base type for an extension/substitution point to +-- customize FpML and add additional events. +data AdditionalEvent+instance Eq AdditionalEvent+instance Show AdditionalEvent+instance SchemaType AdditionalEvent+instance Extension AdditionalEvent AbstractEvent+ +-- | Abstract base type for non-negotiated trade change +-- descriptions +data ChangeEvent+instance Eq ChangeEvent+instance Show ChangeEvent+instance SchemaType ChangeEvent+instance Extension ChangeEvent AbstractEvent+ +-- | A type that shows how multiple trades have been combined +-- into a result. +data CompressionActivity+instance Eq CompressionActivity+instance Show CompressionActivity+instance SchemaType CompressionActivity+ +-- | A type that identifies the type of trade amalgamation, for +-- example netting or portfolio compression. +data CompressionType+data CompressionTypeAttributes+instance Eq CompressionType+instance Eq CompressionTypeAttributes+instance Show CompressionType+instance Show CompressionTypeAttributes+instance SchemaType CompressionType+instance Extension CompressionType Scheme+ +-- | A structure describing an de-clear event. +data DeClear+instance Eq DeClear+instance Show DeClear+instance SchemaType DeClear+ +-- | A structure describing the removal of a trade from a +-- service, such as a reporting service. +data Withdrawal+instance Eq Withdrawal+instance Show Withdrawal+instance SchemaType Withdrawal+ +-- | A type that describes what the requester would like to see +-- done to implement the withdrawal, e.g. ExpungeRecords, +-- RetainRecords. +data RequestedWithdrawalAction+data RequestedWithdrawalActionAttributes+instance Eq RequestedWithdrawalAction+instance Eq RequestedWithdrawalActionAttributes+instance Show RequestedWithdrawalAction+instance Show RequestedWithdrawalActionAttributes+instance SchemaType RequestedWithdrawalAction+instance Extension RequestedWithdrawalAction Scheme+ +-- | A type that describes why a trade was withdrawn. +data WithdrawalReason+data WithdrawalReasonAttributes+instance Eq WithdrawalReason+instance Eq WithdrawalReasonAttributes+instance Show WithdrawalReason+instance Show WithdrawalReasonAttributes+instance SchemaType WithdrawalReason+instance Extension WithdrawalReason Scheme+ +-- | A structure that describes a proposed match between trades +-- or post-trade event reports. +data EventProposedMatch+instance Eq EventProposedMatch+instance Show EventProposedMatch+instance SchemaType EventProposedMatch+ +data EventsChoice+instance Eq EventsChoice+instance Show EventsChoice+instance SchemaType EventsChoice+ +-- | A structure describing the effect of a change to an index. +data IndexChange+instance Eq IndexChange+instance Show IndexChange+instance SchemaType IndexChange+instance Extension IndexChange ChangeEvent+instance Extension IndexChange AbstractEvent+ +-- | A structure describing an option exercise. +data OptionExercise+instance Eq OptionExercise+instance Show OptionExercise+instance SchemaType OptionExercise+instance Extension OptionExercise AbstractEvent+ +-- | A structure describing an option expiring (i.e. passing its +-- last exercise time and becoming worthless.) +data OptionExpiry+instance Eq OptionExpiry+instance Show OptionExpiry+instance SchemaType OptionExpiry+instance Extension OptionExpiry AbstractEvent+ +-- | A structure describing an option expiring. +data OptionExpiryBase+instance Eq OptionExpiryBase+instance Show OptionExpiryBase+instance SchemaType OptionExpiryBase+ +-- | A structure that describes how an option settles into a +-- physical trade. +data PhysicalSettlement+instance Eq PhysicalSettlement+instance Show PhysicalSettlement+instance SchemaType PhysicalSettlement+ +data PhysicalExercise+instance Eq PhysicalExercise+instance Show PhysicalExercise+instance SchemaType PhysicalExercise+ +-- | A type that describes why a trade terminated. +data TerminatingEvent+data TerminatingEventAttributes+instance Eq TerminatingEvent+instance Eq TerminatingEventAttributes+instance Show TerminatingEvent+instance Show TerminatingEventAttributes+instance SchemaType TerminatingEvent+instance Extension TerminatingEvent Scheme+ +-- | A structure describing a negotiated amendment. +data TradeAmendmentContent+instance Eq TradeAmendmentContent+instance Show TradeAmendmentContent+instance SchemaType TradeAmendmentContent+instance Extension TradeAmendmentContent AbstractEvent+ +-- | A structure describing a trade change. +data TradeChangeBase+instance Eq TradeChangeBase+instance Show TradeChangeBase+instance SchemaType TradeChangeBase+instance Extension TradeChangeBase AbstractEvent+ +-- | A structure describing a non-negotiated trade resulting +-- from a market event. +data TradeChangeContent+instance Eq TradeChangeContent+instance Show TradeChangeContent+instance SchemaType TradeChangeContent+ +-- | A structure describing a trade maturing. +data TradeMaturity+instance Eq TradeMaturity+instance Show TradeMaturity+instance SchemaType TradeMaturity+ +-- | A structure describing a change to the trade notional. +data TradeNotionalChange+instance Eq TradeNotionalChange+instance Show TradeNotionalChange+instance SchemaType TradeNotionalChange+instance Extension TradeNotionalChange TradeChangeBase+instance Extension TradeNotionalChange AbstractEvent+ +-- | A structure describing a novation. +data TradeNovationContent+instance Eq TradeNovationContent+instance Show TradeNovationContent+instance SchemaType TradeNovationContent+instance Extension TradeNovationContent AbstractEvent+ +-- | Defines a type that allows trade identifiers and/or trade +-- information to be represented for a trade. +data TradeReferenceInformation+instance Eq TradeReferenceInformation+instance Show TradeReferenceInformation+instance SchemaType TradeReferenceInformation+ +-- | The additionalEvent element is an extension/substitution +-- point to customize FpML and add additional events. +elementAdditionalEvent :: XMLParser AdditionalEvent+ +-- | Abstract substitutable place holder for specific change +-- details. +elementChangeEvent :: XMLParser ChangeEvent+elementToXMLChangeEvent :: ChangeEvent -> [Content ()]+ +-- | Describes a change due to an index component being +-- adjusted. +elementIndexChange :: XMLParser IndexChange+elementToXMLIndexChange :: IndexChange -> [Content ()]+ + + + + + + + + +
+ Data/FpML/V53/FX.hs view
@@ -0,0 +1,1650 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.FX+ ( module Data.FpML.V53.FX+ , module Data.FpML.V53.Shared.Option+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import Text.XML.HaXml.OneOfN+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import Data.FpML.V53.Shared.Option+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | Constrains the forward point tick/pip factor to 1, 0.1, +-- 0.01, 0.001, etc.+newtype PointValue = PointValue Xsd.Decimal deriving (Eq,Show)+instance Restricts PointValue Xsd.Decimal where+ restricts (PointValue x) = x+instance SchemaType PointValue where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s (PointValue x) = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType PointValue where+ acceptingParser = fmap PointValue acceptingParser+ -- XXX should enforce the restrictions somehow?+ -- The restrictions are:+ -- (Pattern 1)+ -- (Pattern 0.0*1)+ simpleTypeText (PointValue x) = simpleTypeText x+ +-- | A type that is used for including the currency exchange +-- rates used to cross between the traded currencies for +-- non-base currency FX contracts.+data CrossRate = CrossRate+ { crossRate_currency1 :: Maybe Currency+ -- ^ The first currency specified when a pair of currencies is + -- to be evaluated.+ , crossRate_currency2 :: Maybe Currency+ -- ^ The second currency specified when a pair of currencies is + -- to be evaluated.+ , crossRate_quoteBasis :: Maybe QuoteBasisEnum+ -- ^ The method by which the exchange rate is quoted.+ , crossRate_rate :: Maybe PositiveDecimal+ -- ^ The exchange rate used to cross between the traded + -- currencies.+ , crossRate_spotRate :: Maybe PositiveDecimal+ -- ^ An optional element used for FX forwards and certain types + -- of FX OTC options. For deals consumated in the FX Forwards + -- Market, this represents the current market rate for a + -- particular currency pair.+ , crossRate_forwardPoints :: Maybe Xsd.Decimal+ -- ^ An optional element used for deals consumated in the FX + -- Forwards market. Forward points represent the interest rate + -- differential between the two currencies traded and are + -- quoted as a preminum or a discount. Forward points are + -- added to, or subtracted from, the spot rate to create the + -- rate of the forward trade.+ }+ deriving (Eq,Show)+instance SchemaType CrossRate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CrossRate+ `apply` optional (parseSchemaType "currency1")+ `apply` optional (parseSchemaType "currency2")+ `apply` optional (parseSchemaType "quoteBasis")+ `apply` optional (parseSchemaType "rate")+ `apply` optional (parseSchemaType "spotRate")+ `apply` optional (parseSchemaType "forwardPoints")+ schemaTypeToXML s x@CrossRate{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "currency1") $ crossRate_currency1 x+ , maybe [] (schemaTypeToXML "currency2") $ crossRate_currency2 x+ , maybe [] (schemaTypeToXML "quoteBasis") $ crossRate_quoteBasis x+ , maybe [] (schemaTypeToXML "rate") $ crossRate_rate x+ , maybe [] (schemaTypeToXML "spotRate") $ crossRate_spotRate x+ , maybe [] (schemaTypeToXML "forwardPoints") $ crossRate_forwardPoints x+ ]+instance Extension CrossRate QuotedCurrencyPair where+ supertype (CrossRate e0 e1 e2 e3 e4 e5) =+ QuotedCurrencyPair e0 e1 e2+ +-- | Allows for an expiryDateTime cut to be described by name.+data CutName = CutName Scheme CutNameAttributes deriving (Eq,Show)+data CutNameAttributes = CutNameAttributes+ { cutNameAttrib_cutNameScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CutName where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "cutNameScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CutName v (CutNameAttributes a0)+ schemaTypeToXML s (CutName bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "cutNameScheme") $ cutNameAttrib_cutNameScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CutName Scheme where+ supertype (CutName s _) = s+ +-- | Describes the parameters for a dual currency deposit.+data DualCurrencyFeature = DualCurrencyFeature+ { dualCurrenFeature_currency :: Maybe Currency+ -- ^ The currency in which the principal and interest will be + -- repaid.+ , dualCurrenFeature_fixingDate :: Maybe Xsd.Date+ -- ^ The date on which the decion on delivery currency will be + -- made.+ , dualCurrenFeature_fixingTime :: Maybe BusinessCenterTime+ -- ^ Time at which the option expires on the expiry date.+ , dualCurrenFeature_strike :: Maybe DualCurrencyStrikePrice+ -- ^ The strike rate at which the deposit will be converted.+ , dualCurrenFeature_spotRate :: Maybe Xsd.Decimal+ -- ^ The spot rate at the time the trade was agreed.+ , dualCurrenFeature_interestAtRisk :: Maybe Xsd.Boolean+ -- ^ Specifies whether the interest component of the redemption + -- amount is subject to conversion to the Alternate currency, + -- in the event that the spot rate is strictly lower than the + -- strike level at the specified fixing date and time.+ }+ deriving (Eq,Show)+instance SchemaType DualCurrencyFeature where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DualCurrencyFeature+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "fixingDate")+ `apply` optional (parseSchemaType "fixingTime")+ `apply` optional (parseSchemaType "strike")+ `apply` optional (parseSchemaType "spotRate")+ `apply` optional (parseSchemaType "interestAtRisk")+ schemaTypeToXML s x@DualCurrencyFeature{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "currency") $ dualCurrenFeature_currency x+ , maybe [] (schemaTypeToXML "fixingDate") $ dualCurrenFeature_fixingDate x+ , maybe [] (schemaTypeToXML "fixingTime") $ dualCurrenFeature_fixingTime x+ , maybe [] (schemaTypeToXML "strike") $ dualCurrenFeature_strike x+ , maybe [] (schemaTypeToXML "spotRate") $ dualCurrenFeature_spotRate x+ , maybe [] (schemaTypeToXML "interestAtRisk") $ dualCurrenFeature_interestAtRisk x+ ]+ +-- | A type that describes the rate of exchange at which the +-- embedded option in a Dual Currency Deposit has been struck.+data DualCurrencyStrikePrice = DualCurrencyStrikePrice+ { dualCurrenStrikePrice_rate :: Maybe PositiveDecimal+ -- ^ The rate of exchange between the two currencies of the leg + -- of a deal.+ , dualCurrenStrikePrice_strikeQuoteBasis :: Maybe DualCurrencyStrikeQuoteBasisEnum+ -- ^ The method by which the strike rate is quoted, in terms of + -- the deposit (principal) and alternate currencies.+ }+ deriving (Eq,Show)+instance SchemaType DualCurrencyStrikePrice where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DualCurrencyStrikePrice+ `apply` optional (parseSchemaType "rate")+ `apply` optional (parseSchemaType "strikeQuoteBasis")+ schemaTypeToXML s x@DualCurrencyStrikePrice{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "rate") $ dualCurrenStrikePrice_rate x+ , maybe [] (schemaTypeToXML "strikeQuoteBasis") $ dualCurrenStrikePrice_strikeQuoteBasis x+ ]+ +-- | A type that is used for describing the exchange rate for a +-- particular transaction.+data ExchangeRate = ExchangeRate+ { exchangeRate_quotedCurrencyPair :: Maybe QuotedCurrencyPair+ -- ^ Defines the two currencies for an FX trade and the + -- quotation relationship between the two currencies.+ , exchangeRate_rate :: Maybe PositiveDecimal+ -- ^ The rate of exchange between the two currencies of the leg + -- of a deal. Must be specified with a quote basis.+ , exchangeRate_spotRate :: Maybe PositiveDecimal+ -- ^ An element used for FX forwards and certain types of FX OTC + -- options. For deals consumated in the FX Forwards Market, + -- this represents the current market rate for a particular + -- currency pair. For barrier and digital/binary options, it + -- can be useful to include the spot rate at the time the + -- option was executed to make it easier to know whether the + -- option needs to move "up" or "down" to be triggered.+ , exchangeRate_forwardPoints :: Maybe Xsd.Decimal+ -- ^ An optional element used for deals consumated in the FX + -- Forwards market. Forward points represent the interest rate + -- differential between the two currencies traded and are + -- quoted as a preminum or a discount. Forward points are + -- added to, or subtracted from, the spot rate to create the + -- rate of the forward trade.+ , exchangeRate_pointValue :: Maybe PointValue+ -- ^ An optional element that documents the size of point (pip) + -- in which a rate was quoted (or in this case, forwardPoints + -- are calculated). Point (pip) size varies by currency pair: + -- major currencies are all traded in points of 0.0001, with + -- the exception of JPY which has a point size of 0.01.+ , exchangeRate_crossRate :: [CrossRate]+ -- ^ An optional element that allow for definition of the + -- currency exchange rates used to cross between the traded + -- currencies for non-base currency FX contracts.+ }+ deriving (Eq,Show)+instance SchemaType ExchangeRate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ExchangeRate+ `apply` optional (parseSchemaType "quotedCurrencyPair")+ `apply` optional (parseSchemaType "rate")+ `apply` optional (parseSchemaType "spotRate")+ `apply` optional (parseSchemaType "forwardPoints")+ `apply` optional (parseSchemaType "pointValue")+ `apply` many (parseSchemaType "crossRate")+ schemaTypeToXML s x@ExchangeRate{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "quotedCurrencyPair") $ exchangeRate_quotedCurrencyPair x+ , maybe [] (schemaTypeToXML "rate") $ exchangeRate_rate x+ , maybe [] (schemaTypeToXML "spotRate") $ exchangeRate_spotRate x+ , maybe [] (schemaTypeToXML "forwardPoints") $ exchangeRate_forwardPoints x+ , maybe [] (schemaTypeToXML "pointValue") $ exchangeRate_pointValue x+ , concatMap (schemaTypeToXML "crossRate") $ exchangeRate_crossRate x+ ]+ +-- | Describes the characteristics for american exercise of FX +-- products.+data FxAmericanExercise = FxAmericanExercise+ { fxAmericExerc_ID :: Maybe Xsd.ID+ , fxAmericExerc_commencementDate :: Maybe AdjustableOrRelativeDate+ -- ^ The earliest date on which the option can be exercised.+ , fxAmericExerc_expiryDate :: Maybe Xsd.Date+ -- ^ The latest date on which the option can be exercised.+ , fxAmericExerc_expiryTime :: Maybe BusinessCenterTime+ -- ^ Time at which the option expires on the expiry date.+ , fxAmericExerc_cutName :: Maybe CutName+ -- ^ The code by which the expiry time is known in the market.+ , fxAmericExerc_latestValueDate :: Maybe Xsd.Date+ -- ^ The latest date on which both currencies traded will + -- settle.+ , fxAmericExerc_multipleExercise :: Maybe FxMultipleExercise+ -- ^ Characteristics for multiple exercise.+ }+ deriving (Eq,Show)+instance SchemaType FxAmericanExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FxAmericanExercise a0)+ `apply` optional (parseSchemaType "commencementDate")+ `apply` optional (parseSchemaType "expiryDate")+ `apply` optional (parseSchemaType "expiryTime")+ `apply` optional (parseSchemaType "cutName")+ `apply` optional (parseSchemaType "latestValueDate")+ `apply` optional (parseSchemaType "multipleExercise")+ schemaTypeToXML s x@FxAmericanExercise{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxAmericExerc_ID x+ ]+ [ maybe [] (schemaTypeToXML "commencementDate") $ fxAmericExerc_commencementDate x+ , maybe [] (schemaTypeToXML "expiryDate") $ fxAmericExerc_expiryDate x+ , maybe [] (schemaTypeToXML "expiryTime") $ fxAmericExerc_expiryTime x+ , maybe [] (schemaTypeToXML "cutName") $ fxAmericExerc_cutName x+ , maybe [] (schemaTypeToXML "latestValueDate") $ fxAmericExerc_latestValueDate x+ , maybe [] (schemaTypeToXML "multipleExercise") $ fxAmericExerc_multipleExercise x+ ]+instance Extension FxAmericanExercise FxDigitalAmericanExercise where+ supertype (FxAmericanExercise a0 e0 e1 e2 e3 e4 e5) =+ FxDigitalAmericanExercise a0 e0 e1 e2 e3 e4+instance Extension FxAmericanExercise Exercise where+ supertype = (supertype :: FxDigitalAmericanExercise -> Exercise)+ . (supertype :: FxAmericanExercise -> FxDigitalAmericanExercise)+ + +-- | Descibes the averaging period properties for an asian +-- option.+data FxAsianFeature = FxAsianFeature+ { fxAsianFeature_primaryRateSource :: Maybe InformationSource+ -- ^ The primary source for where the rate observation will + -- occur. Will typically be either a page or a reference bank + -- published rate.+ , fxAsianFeature_secondaryRateSource :: Maybe InformationSource+ -- ^ An alternative, or secondary, source for where the rate + -- observation will occur. Will typically be either a page or + -- a reference bank published rate.+ , fxAsianFeature_fixingTime :: Maybe BusinessCenterTime+ -- ^ The time at which the spot currency exchange rate will be + -- observed. It is specified as a time in a business day + -- calendar location, e.g. 11:00am London time.+ , fxAsianFeature_observationSchedule :: Maybe FxAverageRateObservationSchedule+ -- ^ Parametric schedule of rate observations.+ , fxAsianFeature_rateObservation :: [FxAverageRateObservation]+ -- ^ One or more specific rate observation dates.+ , fxAsianFeature_rateObservationQuoteBasis :: Maybe StrikeQuoteBasisEnum+ -- ^ The method by which observed rate values are quoted, in + -- terms of the option put/call currencies. In the absence of + -- this element, rate observations are assumed to be quoted as + -- per the option strikeQuoteBasis.+ , fxAsianFeature_payoutFormula :: Maybe Xsd.XsdString+ -- ^ The description of the mathematical computation for how the + -- payout is computed.+ , fxAsianFeature_precision :: Maybe Xsd.NonNegativeInteger+ -- ^ Specifies the rounding precision in terms of a number of + -- decimal places. Note how a percentage rate rounding of 5 + -- decimal places is expressed as a rounding precision of 7 in + -- the FpML document since the percentage is expressed as a + -- decimal, e.g. 9.876543% (or 0.09876543) being rounded to + -- the nearest 5 decimal places is 9.87654% (or 0.0987654).+ }+ deriving (Eq,Show)+instance SchemaType FxAsianFeature where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxAsianFeature+ `apply` optional (parseSchemaType "primaryRateSource")+ `apply` optional (parseSchemaType "secondaryRateSource")+ `apply` optional (parseSchemaType "fixingTime")+ `apply` optional (parseSchemaType "observationSchedule")+ `apply` many (parseSchemaType "rateObservation")+ `apply` optional (parseSchemaType "rateObservationQuoteBasis")+ `apply` optional (parseSchemaType "payoutFormula")+ `apply` optional (parseSchemaType "precision")+ schemaTypeToXML s x@FxAsianFeature{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "primaryRateSource") $ fxAsianFeature_primaryRateSource x+ , maybe [] (schemaTypeToXML "secondaryRateSource") $ fxAsianFeature_secondaryRateSource x+ , maybe [] (schemaTypeToXML "fixingTime") $ fxAsianFeature_fixingTime x+ , maybe [] (schemaTypeToXML "observationSchedule") $ fxAsianFeature_observationSchedule x+ , concatMap (schemaTypeToXML "rateObservation") $ fxAsianFeature_rateObservation x+ , maybe [] (schemaTypeToXML "rateObservationQuoteBasis") $ fxAsianFeature_rateObservationQuoteBasis x+ , maybe [] (schemaTypeToXML "payoutFormula") $ fxAsianFeature_payoutFormula x+ , maybe [] (schemaTypeToXML "precision") $ fxAsianFeature_precision x+ ]+ +-- | A type that, for average rate options, is used to describe +-- each specific observation date, as opposed to a parametric +-- frequency of rate observations.+data FxAverageRateObservation = FxAverageRateObservation+ { fxAverageRateObserv_date :: Maybe Xsd.Date+ -- ^ A specific date for which an observation against a + -- particular rate will be made and will be used for + -- subsequent computations.+ , fxAverageRateObserv_averageRateWeightingFactor :: Maybe Xsd.Decimal+ -- ^ An optional factor that can be used for weighting certain + -- observation dates. Typically, firms will weight each date + -- with a factor of 1 if there are standard, unweighted + -- adjustments.+ , fxAverageRateObserv_rate :: Maybe NonNegativeDecimal+ -- ^ The observed rate of exchange between the two option + -- currencies. In the absence of rateObservationQuoteBasis, + -- the rate is assumed to be quoted as per option + -- strike/strikeQuoteBasis.+ }+ deriving (Eq,Show)+instance SchemaType FxAverageRateObservation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxAverageRateObservation+ `apply` optional (parseSchemaType "date")+ `apply` optional (parseSchemaType "averageRateWeightingFactor")+ `apply` optional (parseSchemaType "rate")+ schemaTypeToXML s x@FxAverageRateObservation{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "date") $ fxAverageRateObserv_date x+ , maybe [] (schemaTypeToXML "averageRateWeightingFactor") $ fxAverageRateObserv_averageRateWeightingFactor x+ , maybe [] (schemaTypeToXML "rate") $ fxAverageRateObserv_rate x+ ]+ +-- | A type that describes average rate options rate +-- observations. This is used to describe a parametric +-- frequency of rate observations against a particular rate. +-- Typical frequencies might include daily, every Friday, etc.+data FxAverageRateObservationSchedule = FxAverageRateObservationSchedule+ { fxAverageRateObservSched_startDate :: Maybe Xsd.Date+ -- ^ The start of the period over which observations are made to + -- determine whether a trigger has occurred.+ , fxAverageRateObservSched_endDate :: Maybe Xsd.Date+ -- ^ The end of the period over which observations are made to + -- determine whether a trigger event has occurred.+ , fxAverageRateObservSched_calculationPeriodFrequency :: Maybe CalculationPeriodFrequency+ -- ^ The frequency at which calculation period end dates occur + -- with the regular part of the calculation period schedule + -- and their roll date convention.+ }+ deriving (Eq,Show)+instance SchemaType FxAverageRateObservationSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxAverageRateObservationSchedule+ `apply` optional (parseSchemaType "startDate")+ `apply` optional (parseSchemaType "endDate")+ `apply` optional (parseSchemaType "calculationPeriodFrequency")+ schemaTypeToXML s x@FxAverageRateObservationSchedule{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "startDate") $ fxAverageRateObservSched_startDate x+ , maybe [] (schemaTypeToXML "endDate") $ fxAverageRateObservSched_endDate x+ , maybe [] (schemaTypeToXML "calculationPeriodFrequency") $ fxAverageRateObservSched_calculationPeriodFrequency x+ ]+ +-- | Describes the properties of an Fx barrier.+data FxBarrierFeature = FxBarrierFeature+ { fxBarrierFeature_barrierType :: Maybe FxBarrierTypeEnum+ -- ^ This specifies whether the option becomes effective + -- ("knock-in") or is annulled ("knock-out") when the + -- respective trigger event occurs.+ , fxBarrierFeature_quotedCurrencyPair :: Maybe QuotedCurrencyPair+ -- ^ Defines the two currencies for an FX trade and the + -- quotation relationship between the two currencies.+ , fxBarrierFeature_triggerRate :: Maybe PositiveDecimal+ -- ^ The market rate is observed relative to the trigger rate, + -- and if it is found to be on the predefined side of (above + -- or below) the trigger rate, a trigger event is deemed to + -- have occurred.+ , fxBarrierFeature_informationSource :: [InformationSource]+ -- ^ The information source where a published or displayed + -- market rate will be obtained, e.g. Telerate Page 3750.+ , fxBarrierFeature_observationStartDate :: Maybe Xsd.Date+ -- ^ The start of the period over which observations are made to + -- determine whether a trigger has occurred.+ , fxBarrierFeature_observationEndDate :: Maybe Xsd.Date+ -- ^ The end of the period over which observations are made to + -- determine whether a trigger event has occurred.+ }+ deriving (Eq,Show)+instance SchemaType FxBarrierFeature where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxBarrierFeature+ `apply` optional (parseSchemaType "barrierType")+ `apply` optional (parseSchemaType "quotedCurrencyPair")+ `apply` optional (parseSchemaType "triggerRate")+ `apply` many (parseSchemaType "informationSource")+ `apply` optional (parseSchemaType "observationStartDate")+ `apply` optional (parseSchemaType "observationEndDate")+ schemaTypeToXML s x@FxBarrierFeature{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "barrierType") $ fxBarrierFeature_barrierType x+ , maybe [] (schemaTypeToXML "quotedCurrencyPair") $ fxBarrierFeature_quotedCurrencyPair x+ , maybe [] (schemaTypeToXML "triggerRate") $ fxBarrierFeature_triggerRate x+ , concatMap (schemaTypeToXML "informationSource") $ fxBarrierFeature_informationSource x+ , maybe [] (schemaTypeToXML "observationStartDate") $ fxBarrierFeature_observationStartDate x+ , maybe [] (schemaTypeToXML "observationEndDate") $ fxBarrierFeature_observationEndDate x+ ]+ +-- | Describes a precise boundary value.+data FxBoundary = FxBoundary+ { fxBoundary_choice0 :: (Maybe (OneOf2 Inclusive Exclusive))+ -- ^ Choice between:+ -- + -- (1) inclusive+ -- + -- (2) exclusive+ }+ deriving (Eq,Show)+instance SchemaType FxBoundary where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxBoundary+ `apply` optional (oneOf' [ ("Inclusive", fmap OneOf2 elementInclusive)+ , ("Exclusive", fmap TwoOf2 elementExclusive)+ ])+ schemaTypeToXML s x@FxBoundary{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (elementToXMLInclusive)+ (elementToXMLExclusive)+ ) $ fxBoundary_choice0 x+ ]++data Inclusive = Inclusive deriving (Eq,Show)+data Exclusive = Exclusive deriving (Eq,Show)+elementInclusive = do element ["inclusive"]; return Inclusive+elementExclusive = do element ["exclusive"]; return Exclusive+elementToXMLInclusive Inclusive = toXMLElement "inclusive" [] []+elementToXMLExclusive Exclusive = toXMLElement "exclusive" [] []++ +-- | Descrines the characteristics for American exercise in FX +-- digital options.+data FxDigitalAmericanExercise = FxDigitalAmericanExercise+ { fxDigitalAmericExerc_ID :: Maybe Xsd.ID+ , fxDigitalAmericExerc_commencementDate :: Maybe AdjustableOrRelativeDate+ -- ^ The earliest date on which the option can be exercised.+ , fxDigitalAmericExerc_expiryDate :: Maybe Xsd.Date+ -- ^ The latest date on which the option can be exercised.+ , fxDigitalAmericExerc_expiryTime :: Maybe BusinessCenterTime+ -- ^ Time at which the option expires on the expiry date.+ , fxDigitalAmericExerc_cutName :: Maybe CutName+ -- ^ The code by which the expiry time is known in the market.+ , fxDigitalAmericExerc_latestValueDate :: Maybe Xsd.Date+ -- ^ The latest date on which both currencies traded will + -- settle.+ }+ deriving (Eq,Show)+instance SchemaType FxDigitalAmericanExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FxDigitalAmericanExercise a0)+ `apply` optional (parseSchemaType "commencementDate")+ `apply` optional (parseSchemaType "expiryDate")+ `apply` optional (parseSchemaType "expiryTime")+ `apply` optional (parseSchemaType "cutName")+ `apply` optional (parseSchemaType "latestValueDate")+ schemaTypeToXML s x@FxDigitalAmericanExercise{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxDigitalAmericExerc_ID x+ ]+ [ maybe [] (schemaTypeToXML "commencementDate") $ fxDigitalAmericExerc_commencementDate x+ , maybe [] (schemaTypeToXML "expiryDate") $ fxDigitalAmericExerc_expiryDate x+ , maybe [] (schemaTypeToXML "expiryTime") $ fxDigitalAmericExerc_expiryTime x+ , maybe [] (schemaTypeToXML "cutName") $ fxDigitalAmericExerc_cutName x+ , maybe [] (schemaTypeToXML "latestValueDate") $ fxDigitalAmericExerc_latestValueDate x+ ]+instance Extension FxDigitalAmericanExercise Exercise where+ supertype v = Exercise_FxDigitalAmericanExercise v+ +-- | Describes an option having a triggerable fixed payout.+data FxDigitalOption = FxDigitalOption+ { fxDigitalOption_ID :: Maybe Xsd.ID+ , fxDigitalOption_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , fxDigitalOption_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , fxDigitalOption_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , fxDigitalOption_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , fxDigitalOption_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , fxDigitalOption_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , fxDigitalOption_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , fxDigitalOption_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , fxDigitalOption_effectiveDate :: Maybe AdjustableOrRelativeDate+ -- ^ Effective date for a forward starting derivative. If this + -- element is not present, the effective date is the trade + -- date.+ , fxDigitalOption_tenorPeriod :: Maybe Period+ -- ^ A tenor expressed as a period type and multiplier (e.g. 1D, + -- 1Y, etc.)+ , fxDigitalOption_choice10 :: (Maybe (OneOf2 ((Maybe (FxDigitalAmericanExercise)),[FxTouch]) ((Maybe (FxEuropeanExercise)),[FxTrigger])))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The parameters for defining the exercise period for + -- an American style option.+ -- + -- * Defines one or more conditions underwhich the + -- option will payout if exercisable.+ -- + -- (2) Sequence of:+ -- + -- * The parameters for defining the exercise period for + -- an European style option.+ -- + -- * Defines one or more conditions underwhich the + -- option will payout if exercisable.+ , fxDigitalOption_exerciseProcedure :: Maybe ExerciseProcedure+ -- ^ A set of parameters defining procedures associated with the + -- exercise.+ , fxDigitalOption_payout :: Maybe FxOptionPayout+ -- ^ The amount of currency which becomes payable if and when a + -- trigger event occurs.+ , fxDigitalOption_premium :: [FxOptionPremium]+ -- ^ Premium amount or premium installment amount for an option.+ }+ deriving (Eq,Show)+instance SchemaType FxDigitalOption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FxDigitalOption 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 (parseSchemaType "effectiveDate")+ `apply` optional (parseSchemaType "tenorPeriod")+ `apply` optional (oneOf' [ ("Maybe FxDigitalAmericanExercise [FxTouch]", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "americanExercise")+ `apply` many (parseSchemaType "touch")))+ , ("Maybe FxEuropeanExercise [FxTrigger]", fmap TwoOf2 (return (,) `apply` optional (parseSchemaType "europeanExercise")+ `apply` many (parseSchemaType "trigger")))+ ])+ `apply` optional (parseSchemaType "exerciseProcedure")+ `apply` optional (parseSchemaType "payout")+ `apply` many (parseSchemaType "premium")+ schemaTypeToXML s x@FxDigitalOption{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxDigitalOption_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ fxDigitalOption_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ fxDigitalOption_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ fxDigitalOption_productType x+ , concatMap (schemaTypeToXML "productId") $ fxDigitalOption_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ fxDigitalOption_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ fxDigitalOption_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ fxDigitalOption_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ fxDigitalOption_sellerAccountReference x+ , maybe [] (schemaTypeToXML "effectiveDate") $ fxDigitalOption_effectiveDate x+ , maybe [] (schemaTypeToXML "tenorPeriod") $ fxDigitalOption_tenorPeriod x+ , maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "americanExercise") a+ , concatMap (schemaTypeToXML "touch") b+ ])+ (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "europeanExercise") a+ , concatMap (schemaTypeToXML "trigger") b+ ])+ ) $ fxDigitalOption_choice10 x+ , maybe [] (schemaTypeToXML "exerciseProcedure") $ fxDigitalOption_exerciseProcedure x+ , maybe [] (schemaTypeToXML "payout") $ fxDigitalOption_payout x+ , concatMap (schemaTypeToXML "premium") $ fxDigitalOption_premium x+ ]+instance Extension FxDigitalOption Option where+ supertype v = Option_FxDigitalOption v+instance Extension FxDigitalOption Product where+ supertype = (supertype :: Option -> Product)+ . (supertype :: FxDigitalOption -> Option)+ + +-- | Describes the characteristics for European exercise of FX +-- products.+data FxEuropeanExercise = FxEuropeanExercise+ { fxEuropExerc_ID :: Maybe Xsd.ID+ , fxEuropExerc_expiryDate :: Maybe Xsd.Date+ -- ^ Represents a standard expiry date as defined for an FX OTC + -- option.+ , fxEuropExerc_expiryTime :: Maybe BusinessCenterTime+ -- ^ Time at which the option expires on the expiry date.+ , fxEuropExerc_cutName :: Maybe CutName+ -- ^ The code by which the expiry time is known in the market.+ , fxEuropExerc_valueDate :: Maybe Xsd.Date+ -- ^ The date on which both currencies traded will settle.+ }+ deriving (Eq,Show)+instance SchemaType FxEuropeanExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FxEuropeanExercise a0)+ `apply` optional (parseSchemaType "expiryDate")+ `apply` optional (parseSchemaType "expiryTime")+ `apply` optional (parseSchemaType "cutName")+ `apply` optional (parseSchemaType "valueDate")+ schemaTypeToXML s x@FxEuropeanExercise{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxEuropExerc_ID x+ ]+ [ maybe [] (schemaTypeToXML "expiryDate") $ fxEuropExerc_expiryDate x+ , maybe [] (schemaTypeToXML "expiryTime") $ fxEuropExerc_expiryTime x+ , maybe [] (schemaTypeToXML "cutName") $ fxEuropExerc_cutName x+ , maybe [] (schemaTypeToXML "valueDate") $ fxEuropExerc_valueDate x+ ]+instance Extension FxEuropeanExercise Exercise where+ supertype v = Exercise_FxEuropeanExercise v+ +-- | Describes the limits on the size of notional when multiple +-- exercise is allowed.+data FxMultipleExercise = FxMultipleExercise+ { fxMultiExerc_minimumNotionalAmount :: Maybe NonNegativeMoney+ -- ^ The minimum amount of notional that can be exercised.+ , fxMultiExerc_maximumNotionalAmount :: Maybe NonNegativeMoney+ -- ^ The maximum amount of notiional that can be exercised.+ }+ deriving (Eq,Show)+instance SchemaType FxMultipleExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxMultipleExercise+ `apply` optional (parseSchemaType "minimumNotionalAmount")+ `apply` optional (parseSchemaType "maximumNotionalAmount")+ schemaTypeToXML s x@FxMultipleExercise{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "minimumNotionalAmount") $ fxMultiExerc_minimumNotionalAmount x+ , maybe [] (schemaTypeToXML "maximumNotionalAmount") $ fxMultiExerc_maximumNotionalAmount x+ ]+ +-- | Describes an FX option with optional asian and barrier +-- features.+data FxOption = FxOption+ { fxOption_ID :: Maybe Xsd.ID+ , fxOption_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , fxOption_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , fxOption_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , fxOption_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , fxOption_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , fxOption_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , fxOption_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , fxOption_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , fxOption_effectiveDate :: Maybe AdjustableOrRelativeDate+ -- ^ Effective date for a forward starting derivative. If this + -- element is not present, the effective date is the trade + -- date.+ , fxOption_tenorPeriod :: Maybe Period+ -- ^ A tenor expressed as a period type and multiplier (e.g. 1D, + -- 1Y, etc.)+ , fxOption_choice10 :: OneOf2 FxAmericanExercise FxEuropeanExercise+ -- ^ Choice between:+ -- + -- (1) The parameters for defining the exercise period for an + -- American style option.+ -- + -- (2) The parameters for defining the exercise period for an + -- European style option.+ , fxOption_exerciseProcedure :: Maybe ExerciseProcedure+ -- ^ A set of parameters defining procedures associated with the + -- exercise.+ , fxOption_putCurrencyAmount :: NonNegativeMoney+ -- ^ The currency amount that the option gives the right to + -- sell.+ , fxOption_callCurrencyAmount :: NonNegativeMoney+ -- ^ The currency amount that the option gives the right to buy.+ , fxOption_soldAs :: Maybe PutCallEnum+ -- ^ Indicates how the product was original sold as a Put or a + -- Call.+ , fxOption_strike :: FxStrikePrice+ -- ^ Defines the option strike price.+ , fxOption_spotRate :: Maybe PositiveDecimal+ -- ^ An optional element used for FX forwards and certain types + -- of FX OTC options. For deals consumated in the FX Forwards + -- Market, this represents the current market rate for a + -- particular currency pair. For barrier and digital/binary + -- options, it can be useful to include the spot rate at the + -- time the option was executed to make it easier to know + -- whether the option needs to move "up" or "down" to be + -- triggered.+ , fxOption_features :: Maybe FxOptionFeatures+ -- ^ Describes additional features within the option.+ , fxOption_premium :: FxOptionPremium+ -- ^ Premium amount or premium installment amount for an option.+ , fxOption_cashSettlement :: Maybe FxCashSettlement+ -- ^ Specifies the currency and fixing details for cash + -- settlement. This optional element is produced only where it + -- has been specified at execution time that the option wlll + -- be settled into a single cash payment - for example, in the + -- case of a non-deliverable option (although note that an Fx + -- option may be contractually cash settled, without + -- necessarily being non-deliverable).+ }+ deriving (Eq,Show)+instance SchemaType FxOption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FxOption 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 (parseSchemaType "effectiveDate")+ `apply` optional (parseSchemaType "tenorPeriod")+ `apply` oneOf' [ ("FxAmericanExercise", fmap OneOf2 (parseSchemaType "americanExercise"))+ , ("FxEuropeanExercise", fmap TwoOf2 (parseSchemaType "europeanExercise"))+ ]+ `apply` optional (parseSchemaType "exerciseProcedure")+ `apply` parseSchemaType "putCurrencyAmount"+ `apply` parseSchemaType "callCurrencyAmount"+ `apply` optional (parseSchemaType "soldAs")+ `apply` parseSchemaType "strike"+ `apply` optional (parseSchemaType "spotRate")+ `apply` optional (parseSchemaType "features")+ `apply` parseSchemaType "premium"+ `apply` optional (parseSchemaType "cashSettlement")+ schemaTypeToXML s x@FxOption{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxOption_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ fxOption_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ fxOption_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ fxOption_productType x+ , concatMap (schemaTypeToXML "productId") $ fxOption_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ fxOption_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ fxOption_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ fxOption_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ fxOption_sellerAccountReference x+ , maybe [] (schemaTypeToXML "effectiveDate") $ fxOption_effectiveDate x+ , maybe [] (schemaTypeToXML "tenorPeriod") $ fxOption_tenorPeriod x+ , foldOneOf2 (schemaTypeToXML "americanExercise")+ (schemaTypeToXML "europeanExercise")+ $ fxOption_choice10 x+ , maybe [] (schemaTypeToXML "exerciseProcedure") $ fxOption_exerciseProcedure x+ , schemaTypeToXML "putCurrencyAmount" $ fxOption_putCurrencyAmount x+ , schemaTypeToXML "callCurrencyAmount" $ fxOption_callCurrencyAmount x+ , maybe [] (schemaTypeToXML "soldAs") $ fxOption_soldAs x+ , schemaTypeToXML "strike" $ fxOption_strike x+ , maybe [] (schemaTypeToXML "spotRate") $ fxOption_spotRate x+ , maybe [] (schemaTypeToXML "features") $ fxOption_features x+ , schemaTypeToXML "premium" $ fxOption_premium x+ , maybe [] (schemaTypeToXML "cashSettlement") $ fxOption_cashSettlement x+ ]+instance Extension FxOption Option where+ supertype v = Option_FxOption v+instance Extension FxOption Product where+ supertype = (supertype :: Option -> Product)+ . (supertype :: FxOption -> Option)+ + +-- | A type describing the features that may be present in an FX +-- option.+data FxOptionFeatures = FxOptionFeatures+ { fxOptionFeatur_choice0 :: OneOf2 (FxAsianFeature,[FxBarrierFeature]) [FxBarrierFeature]+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * asian+ -- + -- * barrier+ -- + -- (2) barrier+ }+ deriving (Eq,Show)+instance SchemaType FxOptionFeatures where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxOptionFeatures+ `apply` oneOf' [ ("FxAsianFeature [FxBarrierFeature]", fmap OneOf2 (return (,) `apply` parseSchemaType "asian"+ `apply` many (parseSchemaType "barrier")))+ , ("[FxBarrierFeature]", fmap TwoOf2 (many1 (parseSchemaType "barrier")))+ ]+ schemaTypeToXML s x@FxOptionFeatures{} =+ toXMLElement s []+ [ foldOneOf2 (\ (a,b) -> concat [ schemaTypeToXML "asian" a+ , concatMap (schemaTypeToXML "barrier") b+ ])+ (concatMap (schemaTypeToXML "barrier"))+ $ fxOptionFeatur_choice0 x+ ]+ +-- | A type that contains full details of a predefined fixed +-- payout which may occur (or not) in a Barrier Option or +-- Digital Option when a trigger event occurs (or not).+data FxOptionPayout = FxOptionPayout+ { fxOptionPayout_ID :: Maybe Xsd.ID+ , fxOptionPayout_currency :: Currency+ -- ^ The currency in which an amount is denominated.+ , fxOptionPayout_amount :: NonNegativeDecimal+ -- ^ The non negative monetary quantity in currency units.+ , fxOptionPayout_payoutStyle :: Maybe PayoutEnum+ -- ^ The trigger event and payout may be asynchonous. A payout + -- may become due on the trigger event, or the payout may (by + -- agreeement at initiation) be deferred (for example) to the + -- maturity date.+ , fxOptionPayout_settlementInformation :: Maybe SettlementInformation+ -- ^ The information required to settle a currency payment that + -- results from a trade.+ }+ deriving (Eq,Show)+instance SchemaType FxOptionPayout where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FxOptionPayout a0)+ `apply` parseSchemaType "currency"+ `apply` parseSchemaType "amount"+ `apply` optional (parseSchemaType "payoutStyle")+ `apply` optional (parseSchemaType "settlementInformation")+ schemaTypeToXML s x@FxOptionPayout{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxOptionPayout_ID x+ ]+ [ schemaTypeToXML "currency" $ fxOptionPayout_currency x+ , schemaTypeToXML "amount" $ fxOptionPayout_amount x+ , maybe [] (schemaTypeToXML "payoutStyle") $ fxOptionPayout_payoutStyle x+ , maybe [] (schemaTypeToXML "settlementInformation") $ fxOptionPayout_settlementInformation x+ ]+instance Extension FxOptionPayout NonNegativeMoney where+ supertype (FxOptionPayout a0 e0 e1 e2 e3) =+ NonNegativeMoney a0 e0 e1+instance Extension FxOptionPayout MoneyBase where+ supertype = (supertype :: NonNegativeMoney -> MoneyBase)+ . (supertype :: FxOptionPayout -> NonNegativeMoney)+ + +-- | A type that specifies the premium exchanged for a single +-- option trade or option strategy.+data FxOptionPremium = FxOptionPremium+ { fxOptionPremium_ID :: Maybe Xsd.ID+ , fxOptionPremium_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , fxOptionPremium_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , fxOptionPremium_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , fxOptionPremium_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , fxOptionPremium_paymentDate :: Maybe AdjustableOrRelativeDate+ -- ^ The payment date, which can be expressed as either an + -- adjustable or relative date.+ , fxOptionPremium_paymentAmount :: Maybe NonNegativeMoney+ -- ^ Non negative payment amount.+ , fxOptionPremium_settlementInformation :: Maybe SettlementInformation+ -- ^ The information required to settle a currency payment that + -- results from a trade.+ , fxOptionPremium_quote :: Maybe PremiumQuote+ -- ^ This is the option premium as quoted. It is expected to be + -- consistent with the premiumAmount and is for information + -- only.+ }+ deriving (Eq,Show)+instance SchemaType FxOptionPremium where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FxOptionPremium a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "paymentDate")+ `apply` optional (parseSchemaType "paymentAmount")+ `apply` optional (parseSchemaType "settlementInformation")+ `apply` optional (parseSchemaType "quote")+ schemaTypeToXML s x@FxOptionPremium{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxOptionPremium_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ fxOptionPremium_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ fxOptionPremium_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ fxOptionPremium_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ fxOptionPremium_receiverAccountReference x+ , maybe [] (schemaTypeToXML "paymentDate") $ fxOptionPremium_paymentDate x+ , maybe [] (schemaTypeToXML "paymentAmount") $ fxOptionPremium_paymentAmount x+ , maybe [] (schemaTypeToXML "settlementInformation") $ fxOptionPremium_settlementInformation x+ , maybe [] (schemaTypeToXML "quote") $ fxOptionPremium_quote x+ ]+instance Extension FxOptionPremium NonNegativePayment where+ supertype (FxOptionPremium a0 e0 e1 e2 e3 e4 e5 e6 e7) =+ NonNegativePayment a0 e0 e1 e2 e3 e4 e5+instance Extension FxOptionPremium PaymentBaseExtended where+ supertype = (supertype :: NonNegativePayment -> PaymentBaseExtended)+ . (supertype :: FxOptionPremium -> NonNegativePayment)+ +instance Extension FxOptionPremium PaymentBase where+ supertype = (supertype :: PaymentBaseExtended -> PaymentBase)+ . (supertype :: NonNegativePayment -> PaymentBaseExtended)+ . (supertype :: FxOptionPremium -> NonNegativePayment)+ + +-- | A type defining either a spot or forward FX transactions.+data FxSingleLeg = FxSingleLeg+ { fxSingleLeg_ID :: Maybe Xsd.ID+ , fxSingleLeg_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , fxSingleLeg_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , fxSingleLeg_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , fxSingleLeg_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , fxSingleLeg_exchangedCurrency1 :: Payment+ -- ^ This is the first of the two currency flows that define a + -- single leg of a standard foreign exchange transaction.+ , fxSingleLeg_exchangedCurrency2 :: Payment+ -- ^ This is the second of the two currency flows that define a + -- single leg of a standard foreign exchange transaction.+ , fxSingleLeg_dealtCurrency :: Maybe DealtCurrencyEnum+ -- ^ Indicates which currency was dealt.+ , fxSingleLeg_choice7 :: (Maybe (OneOf2 FxTenorPeriodEnum Period))+ -- ^ Choice between:+ -- + -- (1) A tenor expressed with a standard business term (i.e. + -- Spot, TomorrowNext, etc.)+ -- + -- (2) A tenor expressed as a period type and multiplier (e.g. + -- 1D, 1Y, etc.)+ , fxSingleLeg_choice8 :: OneOf2 Xsd.Date (Xsd.Date,Xsd.Date)+ -- ^ Choice between:+ -- + -- (1) The date on which both currencies traded will settle.+ -- + -- (2) Sequence of:+ -- + -- * The date on which the currency1 amount will be + -- settled. To be used in a split value date scenario.+ -- + -- * The date on which the currency2 amount will be + -- settled. To be used in a split value date scenario.+ , fxSingleLeg_exchangeRate :: ExchangeRate+ -- ^ The rate of exchange between the two currencies.+ , fxSingleLeg_nonDeliverableSettlement :: Maybe FxCashSettlement+ -- ^ Used to describe a particular type of FX forward + -- transaction that is settled in a single currency (for + -- example, a non-deliverable forward).+ }+ deriving (Eq,Show)+instance SchemaType FxSingleLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FxSingleLeg a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` parseSchemaType "exchangedCurrency1"+ `apply` parseSchemaType "exchangedCurrency2"+ `apply` optional (parseSchemaType "dealtCurrency")+ `apply` optional (oneOf' [ ("FxTenorPeriodEnum", fmap OneOf2 (parseSchemaType "tenorName"))+ , ("Period", fmap TwoOf2 (parseSchemaType "tenorPeriod"))+ ])+ `apply` oneOf' [ ("Xsd.Date", fmap OneOf2 (parseSchemaType "valueDate"))+ , ("Xsd.Date Xsd.Date", fmap TwoOf2 (return (,) `apply` parseSchemaType "currency1ValueDate"+ `apply` parseSchemaType "currency2ValueDate"))+ ]+ `apply` parseSchemaType "exchangeRate"+ `apply` optional (parseSchemaType "nonDeliverableSettlement")+ schemaTypeToXML s x@FxSingleLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxSingleLeg_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ fxSingleLeg_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ fxSingleLeg_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ fxSingleLeg_productType x+ , concatMap (schemaTypeToXML "productId") $ fxSingleLeg_productId x+ , schemaTypeToXML "exchangedCurrency1" $ fxSingleLeg_exchangedCurrency1 x+ , schemaTypeToXML "exchangedCurrency2" $ fxSingleLeg_exchangedCurrency2 x+ , maybe [] (schemaTypeToXML "dealtCurrency") $ fxSingleLeg_dealtCurrency x+ , maybe [] (foldOneOf2 (schemaTypeToXML "tenorName")+ (schemaTypeToXML "tenorPeriod")+ ) $ fxSingleLeg_choice7 x+ , foldOneOf2 (schemaTypeToXML "valueDate")+ (\ (a,b) -> concat [ schemaTypeToXML "currency1ValueDate" a+ , schemaTypeToXML "currency2ValueDate" b+ ])+ $ fxSingleLeg_choice8 x+ , schemaTypeToXML "exchangeRate" $ fxSingleLeg_exchangeRate x+ , maybe [] (schemaTypeToXML "nonDeliverableSettlement") $ fxSingleLeg_nonDeliverableSettlement x+ ]+instance Extension FxSingleLeg Product where+ supertype v = Product_FxSingleLeg v+ +-- | A type that describes the rate of exchange at which the +-- option has been struck.+data FxStrikePrice = FxStrikePrice+ { fxStrikePrice_rate :: Maybe PositiveDecimal+ -- ^ The rate of exchange between the two currencies of the leg + -- of a deal.+ , fxStrikePrice_strikeQuoteBasis :: Maybe StrikeQuoteBasisEnum+ -- ^ The method by which the strike rate is quoted.+ }+ deriving (Eq,Show)+instance SchemaType FxStrikePrice where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxStrikePrice+ `apply` optional (parseSchemaType "rate")+ `apply` optional (parseSchemaType "strikeQuoteBasis")+ schemaTypeToXML s x@FxStrikePrice{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "rate") $ fxStrikePrice_rate x+ , maybe [] (schemaTypeToXML "strikeQuoteBasis") $ fxStrikePrice_strikeQuoteBasis x+ ]+ +-- | A type defining either a spot/forward or forward/forward FX +-- swap transaction.+data FxSwap = FxSwap+ { fxSwap_ID :: Maybe Xsd.ID+ , fxSwap_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , fxSwap_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , fxSwap_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , fxSwap_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , fxSwap_nearLeg :: FxSwapLeg+ -- ^ The FX transaction with the earliest value date.+ , fxSwap_farLeg :: FxSwapLeg+ -- ^ The FX transaction with the latest value date.+ }+ deriving (Eq,Show)+instance SchemaType FxSwap where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FxSwap a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` parseSchemaType "nearLeg"+ `apply` parseSchemaType "farLeg"+ schemaTypeToXML s x@FxSwap{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxSwap_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ fxSwap_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ fxSwap_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ fxSwap_productType x+ , concatMap (schemaTypeToXML "productId") $ fxSwap_productId x+ , schemaTypeToXML "nearLeg" $ fxSwap_nearLeg x+ , schemaTypeToXML "farLeg" $ fxSwap_farLeg x+ ]+instance Extension FxSwap Product where+ supertype v = Product_FxSwap v+ +-- | A type defining the details for one of the transactions in +-- an FX swap.+data FxSwapLeg = FxSwapLeg+ { fxSwapLeg_ID :: Maybe Xsd.ID+ , fxSwapLeg_exchangedCurrency1 :: Payment+ -- ^ This is the first of the two currency flows that define a + -- single leg of a standard foreign exchange transaction.+ , fxSwapLeg_exchangedCurrency2 :: Payment+ -- ^ This is the second of the two currency flows that define a + -- single leg of a standard foreign exchange transaction.+ , fxSwapLeg_dealtCurrency :: Maybe DealtCurrencyEnum+ -- ^ Indicates which currency was dealt.+ , fxSwapLeg_choice3 :: (Maybe (OneOf2 FxTenorPeriodEnum Period))+ -- ^ Choice between:+ -- + -- (1) A tenor expressed with a standard business term (i.e. + -- Spot, TomorrowNext, etc.)+ -- + -- (2) A tenor expressed as a period type and multiplier (e.g. + -- 1D, 1Y, etc.)+ , fxSwapLeg_choice4 :: OneOf2 Xsd.Date (Xsd.Date,Xsd.Date)+ -- ^ Choice between:+ -- + -- (1) The date on which both currencies traded will settle.+ -- + -- (2) Sequence of:+ -- + -- * The date on which the currency1 amount will be + -- settled. To be used in a split value date scenario.+ -- + -- * The date on which the currency2 amount will be + -- settled. To be used in a split value date scenario.+ , fxSwapLeg_exchangeRate :: ExchangeRate+ -- ^ The rate of exchange between the two currencies.+ , fxSwapLeg_nonDeliverableSettlement :: Maybe FxCashSettlement+ -- ^ Used to describe a particular type of FX forward + -- transaction that is settled in a single currency (for + -- example, a non-deliverable forward).+ }+ deriving (Eq,Show)+instance SchemaType FxSwapLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FxSwapLeg a0)+ `apply` parseSchemaType "exchangedCurrency1"+ `apply` parseSchemaType "exchangedCurrency2"+ `apply` optional (parseSchemaType "dealtCurrency")+ `apply` optional (oneOf' [ ("FxTenorPeriodEnum", fmap OneOf2 (parseSchemaType "tenorName"))+ , ("Period", fmap TwoOf2 (parseSchemaType "tenorPeriod"))+ ])+ `apply` oneOf' [ ("Xsd.Date", fmap OneOf2 (parseSchemaType "valueDate"))+ , ("Xsd.Date Xsd.Date", fmap TwoOf2 (return (,) `apply` parseSchemaType "currency1ValueDate"+ `apply` parseSchemaType "currency2ValueDate"))+ ]+ `apply` parseSchemaType "exchangeRate"+ `apply` optional (parseSchemaType "nonDeliverableSettlement")+ schemaTypeToXML s x@FxSwapLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxSwapLeg_ID x+ ]+ [ schemaTypeToXML "exchangedCurrency1" $ fxSwapLeg_exchangedCurrency1 x+ , schemaTypeToXML "exchangedCurrency2" $ fxSwapLeg_exchangedCurrency2 x+ , maybe [] (schemaTypeToXML "dealtCurrency") $ fxSwapLeg_dealtCurrency x+ , maybe [] (foldOneOf2 (schemaTypeToXML "tenorName")+ (schemaTypeToXML "tenorPeriod")+ ) $ fxSwapLeg_choice3 x+ , foldOneOf2 (schemaTypeToXML "valueDate")+ (\ (a,b) -> concat [ schemaTypeToXML "currency1ValueDate" a+ , schemaTypeToXML "currency2ValueDate" b+ ])+ $ fxSwapLeg_choice4 x+ , schemaTypeToXML "exchangeRate" $ fxSwapLeg_exchangeRate x+ , maybe [] (schemaTypeToXML "nonDeliverableSettlement") $ fxSwapLeg_nonDeliverableSettlement x+ ]+instance Extension FxSwapLeg Leg where+ supertype v = Leg_FxSwapLeg v+ +-- | Describes an FX touch condition.+data FxTouch = FxTouch+ { fxTouch_touchCondition :: Maybe TouchConditionEnum+ -- ^ The binary condition that applies to an American-style + -- trigger. There can only be two domain values for this + -- element: "touch" or "no touch".+ , fxTouch_quotedCurrencyPair :: Maybe QuotedCurrencyPair+ -- ^ Defines the two currencies for an FX trade and the + -- quotation relationship between the two currencies.+ , fxTouch_triggerRate :: Maybe PositiveDecimal+ -- ^ The market rate is observed relative to the trigger rate, + -- and if it is found to be on the predefined side of (above + -- or below) the trigger rate, a trigger event is deemed to + -- have occurred.+ , fxTouch_spotRate :: Maybe PositiveDecimal+ -- ^ An optional element used for FX forwards and certain types + -- of FX OTC options. For deals consumated in the FX Forwards + -- Market, this represents the current market rate for a + -- particular currency pair. For barrier and digital/binary + -- options, it can be useful to include the spot rate at the + -- time the option was executed to make it easier to know + -- whether the option needs to move "up" or "down" to be + -- triggered.+ , fxTouch_informationSource :: [InformationSource]+ -- ^ The information source where a published or displayed + -- market rate will be obtained, e.g. Telerate Page 3750.+ , fxTouch_observationStartDate :: Maybe Xsd.Date+ -- ^ The start of the period over which observations are made to + -- determine whether a trigger has occurred.+ , fxTouch_observationEndDate :: Maybe Xsd.Date+ -- ^ The end of the period over which observations are made to + -- determine whether a trigger event has occurred.+ }+ deriving (Eq,Show)+instance SchemaType FxTouch where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxTouch+ `apply` optional (parseSchemaType "touchCondition")+ `apply` optional (parseSchemaType "quotedCurrencyPair")+ `apply` optional (parseSchemaType "triggerRate")+ `apply` optional (parseSchemaType "spotRate")+ `apply` many (parseSchemaType "informationSource")+ `apply` optional (parseSchemaType "observationStartDate")+ `apply` optional (parseSchemaType "observationEndDate")+ schemaTypeToXML s x@FxTouch{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "touchCondition") $ fxTouch_touchCondition x+ , maybe [] (schemaTypeToXML "quotedCurrencyPair") $ fxTouch_quotedCurrencyPair x+ , maybe [] (schemaTypeToXML "triggerRate") $ fxTouch_triggerRate x+ , maybe [] (schemaTypeToXML "spotRate") $ fxTouch_spotRate x+ , concatMap (schemaTypeToXML "informationSource") $ fxTouch_informationSource x+ , maybe [] (schemaTypeToXML "observationStartDate") $ fxTouch_observationStartDate x+ , maybe [] (schemaTypeToXML "observationEndDate") $ fxTouch_observationEndDate x+ ]+ +-- | Describes an FX trigger condition.+data FxTrigger = FxTrigger+ { fxTrigger_triggerCondition :: Maybe TriggerConditionEnum+ -- ^ The condition that applies to a European-style trigger. It + -- determines where the rate at expiry date and time at must + -- be relative to the triggerRate for the option to be + -- exercisable. The allowed values are "Above" and "Below".+ , fxTrigger_quotedCurrencyPair :: Maybe QuotedCurrencyPair+ -- ^ Defines the two currencies for an FX trade and the + -- quotation relationship between the two currencies.+ , fxTrigger_triggerRate :: Maybe PositiveDecimal+ -- ^ The market rate is observed relative to the trigger rate, + -- and if it is found to be on the predefined side of (above + -- or below) the trigger rate, a trigger event is deemed to + -- have occurred.+ , fxTrigger_spotRate :: Maybe PositiveDecimal+ -- ^ An optional element used for FX forwards and certain types + -- of FX OTC options. For deals consumated in the FX Forwards + -- Market, this represents the current market rate for a + -- particular currency pair. For barrier and digital/binary + -- options, it can be useful to include the spot rate at the + -- time the option was executed to make it easier to know + -- whether the option needs to move "up" or "down" to be + -- triggered.+ , fxTrigger_informationSource :: [InformationSource]+ -- ^ The information source where a published or displayed + -- market rate will be obtained, e.g. Telerate Page 3750.+ }+ deriving (Eq,Show)+instance SchemaType FxTrigger where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxTrigger+ `apply` optional (parseSchemaType "triggerCondition")+ `apply` optional (parseSchemaType "quotedCurrencyPair")+ `apply` optional (parseSchemaType "triggerRate")+ `apply` optional (parseSchemaType "spotRate")+ `apply` many (parseSchemaType "informationSource")+ schemaTypeToXML s x@FxTrigger{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "triggerCondition") $ fxTrigger_triggerCondition x+ , maybe [] (schemaTypeToXML "quotedCurrencyPair") $ fxTrigger_quotedCurrencyPair x+ , maybe [] (schemaTypeToXML "triggerRate") $ fxTrigger_triggerRate x+ , maybe [] (schemaTypeToXML "spotRate") $ fxTrigger_spotRate x+ , concatMap (schemaTypeToXML "informationSource") $ fxTrigger_informationSource x+ ]+ +data LowerBound = LowerBound+ { lowerBound_choice0 :: (Maybe (OneOf2 PositiveDecimal PositiveDecimal))+ -- ^ Choice between:+ -- + -- (1) minimumInclusive+ -- + -- (2) minimumExclusive+ }+ deriving (Eq,Show)+instance SchemaType LowerBound where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return LowerBound+ `apply` optional (oneOf' [ ("PositiveDecimal", fmap OneOf2 (parseSchemaType "minimumInclusive"))+ , ("PositiveDecimal", fmap TwoOf2 (parseSchemaType "minimumExclusive"))+ ])+ schemaTypeToXML s x@LowerBound{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "minimumInclusive")+ (schemaTypeToXML "minimumExclusive")+ ) $ lowerBound_choice0 x+ ]+ +-- | References a Money instance.+data MoneyReference = MoneyReference+ { moneyRef_href :: Maybe Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType MoneyReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "href" e pos+ commit $ interior e $ return (MoneyReference a0)+ schemaTypeToXML s x@MoneyReference{} =+ toXMLElement s [ maybe [] (toXMLAttribute "href") $ moneyRef_href x+ ]+ []+instance Extension MoneyReference Reference where+ supertype v = Reference_MoneyReference v+ +data ObservationSchedule = ObservationSchedule+ { observSched_startDate :: Maybe Xsd.Date+ -- ^ The start of the period over which observations are made to + -- determine whether a condition has occurred.+ , observSched_endDate :: Maybe Xsd.Date+ -- ^ The end of the period over which observations are made to + -- determine whether a condition has occurred.+ , observSched_observationPeriodFrequency :: Maybe Frequency+ -- ^ Describes how often observations are made.+ }+ deriving (Eq,Show)+instance SchemaType ObservationSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ObservationSchedule+ `apply` optional (parseSchemaType "startDate")+ `apply` optional (parseSchemaType "endDate")+ `apply` optional (parseSchemaType "observationPeriodFrequency")+ schemaTypeToXML s x@ObservationSchedule{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "startDate") $ observSched_startDate x+ , maybe [] (schemaTypeToXML "endDate") $ observSched_endDate x+ , maybe [] (schemaTypeToXML "observationPeriodFrequency") $ observSched_observationPeriodFrequency x+ ]+ +-- | A type that describes the option premium as quoted.+data PremiumQuote = PremiumQuote+ { premiumQuote_value :: Maybe Xsd.Decimal+ -- ^ The value of the premium quote. In general this will be + -- either a percentage or an explicit amount.+ , premiumQuote_quoteBasis :: Maybe PremiumQuoteBasisEnum+ -- ^ The method by which the option premium was quoted.+ }+ deriving (Eq,Show)+instance SchemaType PremiumQuote where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PremiumQuote+ `apply` optional (parseSchemaType "value")+ `apply` optional (parseSchemaType "quoteBasis")+ schemaTypeToXML s x@PremiumQuote{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "value") $ premiumQuote_value x+ , maybe [] (schemaTypeToXML "quoteBasis") $ premiumQuote_quoteBasis x+ ]+ +-- | A class defining the content model for a term deposit +-- product.+data TermDeposit = TermDeposit+ { termDeposit_ID :: Maybe Xsd.ID+ , termDeposit_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , termDeposit_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , termDeposit_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , termDeposit_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , termDeposit_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , termDeposit_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , termDeposit_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , termDeposit_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , termDeposit_startDate :: Maybe Xsd.Date+ -- ^ The start date of the calculation period.+ , termDeposit_maturityDate :: Maybe Xsd.Date+ -- ^ The end date of the calculation period. This date should + -- already be adjusted for any applicable business day + -- convention.+ , termDeposit_choice10 :: (Maybe (OneOf2 FxTenorPeriodEnum Period))+ -- ^ Choice between:+ -- + -- (1) A tenor expressed with a standard business term (i.e. + -- Spot, TomorrowNext, etc.)+ -- + -- (2) A tenor expressed as a period type and multiplier (e.g. + -- 1D, 1Y, etc.)+ , termDeposit_principal :: Maybe PositiveMoney+ -- ^ The principal amount of the trade.+ , termDeposit_fixedRate :: Maybe PositiveDecimal+ -- ^ The calculation period fixed rate. A per annum rate, + -- expressed as a decimal. A fixed rate of 5% would be + -- represented as 0.05.+ , termDeposit_dayCountFraction :: Maybe DayCountFraction+ -- ^ The day count fraction.+ , termDeposit_features :: Maybe TermDepositFeatures+ -- ^ An optional container that hold additional features of the + -- deposit (e.g. Dual Currency feature).+ , termDeposit_interest :: Maybe Money+ -- ^ The total interest of at maturity of the trade.+ , termDeposit_payment :: [Payment]+ -- ^ A known payment between two parties.+ }+ deriving (Eq,Show)+instance SchemaType TermDeposit where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (TermDeposit a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "startDate")+ `apply` optional (parseSchemaType "maturityDate")+ `apply` optional (oneOf' [ ("FxTenorPeriodEnum", fmap OneOf2 (parseSchemaType "tenorName"))+ , ("Period", fmap TwoOf2 (parseSchemaType "tenorPeriod"))+ ])+ `apply` optional (parseSchemaType "principal")+ `apply` optional (parseSchemaType "fixedRate")+ `apply` optional (parseSchemaType "dayCountFraction")+ `apply` optional (parseSchemaType "features")+ `apply` optional (parseSchemaType "interest")+ `apply` many (parseSchemaType "payment")+ schemaTypeToXML s x@TermDeposit{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ termDeposit_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ termDeposit_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ termDeposit_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ termDeposit_productType x+ , concatMap (schemaTypeToXML "productId") $ termDeposit_productId x+ , maybe [] (schemaTypeToXML "payerPartyReference") $ termDeposit_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ termDeposit_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ termDeposit_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ termDeposit_receiverAccountReference x+ , maybe [] (schemaTypeToXML "startDate") $ termDeposit_startDate x+ , maybe [] (schemaTypeToXML "maturityDate") $ termDeposit_maturityDate x+ , maybe [] (foldOneOf2 (schemaTypeToXML "tenorName")+ (schemaTypeToXML "tenorPeriod")+ ) $ termDeposit_choice10 x+ , maybe [] (schemaTypeToXML "principal") $ termDeposit_principal x+ , maybe [] (schemaTypeToXML "fixedRate") $ termDeposit_fixedRate x+ , maybe [] (schemaTypeToXML "dayCountFraction") $ termDeposit_dayCountFraction x+ , maybe [] (schemaTypeToXML "features") $ termDeposit_features x+ , maybe [] (schemaTypeToXML "interest") $ termDeposit_interest x+ , concatMap (schemaTypeToXML "payment") $ termDeposit_payment x+ ]+instance Extension TermDeposit Product where+ supertype v = Product_TermDeposit v+ +data TermDepositFeatures = TermDepositFeatures+ { termDepositFeatur_dualCurrency :: Maybe DualCurrencyFeature+ }+ deriving (Eq,Show)+instance SchemaType TermDepositFeatures where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return TermDepositFeatures+ `apply` optional (parseSchemaType "dualCurrency")+ schemaTypeToXML s x@TermDepositFeatures{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "dualCurrency") $ termDepositFeatur_dualCurrency x+ ]+ +data UpperBound = UpperBound+ { upperBound_choice0 :: (Maybe (OneOf2 PositiveDecimal PositiveDecimal))+ -- ^ Choice between:+ -- + -- (1) maximumInclusive+ -- + -- (2) maximumExclusive+ }+ deriving (Eq,Show)+instance SchemaType UpperBound where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return UpperBound+ `apply` optional (oneOf' [ ("PositiveDecimal", fmap OneOf2 (parseSchemaType "maximumInclusive"))+ , ("PositiveDecimal", fmap TwoOf2 (parseSchemaType "maximumExclusive"))+ ])+ schemaTypeToXML s x@UpperBound{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "maximumInclusive")+ (schemaTypeToXML "maximumExclusive")+ ) $ upperBound_choice0 x+ ]+ + + + +-- | A simple FX spot or forward transaction definition.+elementFxSingleLeg :: XMLParser FxSingleLeg+elementFxSingleLeg = parseSchemaType "fxSingleLeg"+elementToXMLFxSingleLeg :: FxSingleLeg -> [Content ()]+elementToXMLFxSingleLeg = schemaTypeToXML "fxSingleLeg"+ +-- | An FX Swap transaction definition.+elementFxSwap :: XMLParser FxSwap+elementFxSwap = parseSchemaType "fxSwap"+elementToXMLFxSwap :: FxSwap -> [Content ()]+elementToXMLFxSwap = schemaTypeToXML "fxSwap"+ +-- | An FX option transaction definition.+elementFxOption :: XMLParser FxOption+elementFxOption = parseSchemaType "fxOption"+elementToXMLFxOption :: FxOption -> [Content ()]+elementToXMLFxOption = schemaTypeToXML "fxOption"+ +-- | An FX digital option transaction definition.+elementFxDigitalOption :: XMLParser FxDigitalOption+elementFxDigitalOption = parseSchemaType "fxDigitalOption"+elementToXMLFxDigitalOption :: FxDigitalOption -> [Content ()]+elementToXMLFxDigitalOption = schemaTypeToXML "fxDigitalOption"+ +-- | A term deposit product definition.+elementTermDeposit :: XMLParser TermDeposit+elementTermDeposit = parseSchemaType "termDeposit"+elementToXMLTermDeposit :: TermDeposit -> [Content ()]+elementToXMLTermDeposit = schemaTypeToXML "termDeposit"
+ Data/FpML/V53/FX.hs-boot view
@@ -0,0 +1,277 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.FX+ ( module Data.FpML.V53.FX+ , module Data.FpML.V53.Shared.Option+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Shared.Option+ +-- | Constrains the forward point tick/pip factor to 1, 0.1, +-- 0.01, 0.001, etc. +newtype PointValue = PointValue Xsd.Decimal+instance Eq PointValue+instance Show PointValue+instance Restricts PointValue Xsd.Decimal+instance SchemaType PointValue+instance SimpleType PointValue+ +-- | A type that is used for including the currency exchange +-- rates used to cross between the traded currencies for +-- non-base currency FX contracts. +data CrossRate+instance Eq CrossRate+instance Show CrossRate+instance SchemaType CrossRate+instance Extension CrossRate QuotedCurrencyPair+ +-- | Allows for an expiryDateTime cut to be described by name. +data CutName+data CutNameAttributes+instance Eq CutName+instance Eq CutNameAttributes+instance Show CutName+instance Show CutNameAttributes+instance SchemaType CutName+instance Extension CutName Scheme+ +-- | Describes the parameters for a dual currency deposit. +data DualCurrencyFeature+instance Eq DualCurrencyFeature+instance Show DualCurrencyFeature+instance SchemaType DualCurrencyFeature+ +-- | A type that describes the rate of exchange at which the +-- embedded option in a Dual Currency Deposit has been struck. +data DualCurrencyStrikePrice+instance Eq DualCurrencyStrikePrice+instance Show DualCurrencyStrikePrice+instance SchemaType DualCurrencyStrikePrice+ +-- | A type that is used for describing the exchange rate for a +-- particular transaction. +data ExchangeRate+instance Eq ExchangeRate+instance Show ExchangeRate+instance SchemaType ExchangeRate+ +-- | Describes the characteristics for american exercise of FX +-- products. +data FxAmericanExercise+instance Eq FxAmericanExercise+instance Show FxAmericanExercise+instance SchemaType FxAmericanExercise+instance Extension FxAmericanExercise FxDigitalAmericanExercise+instance Extension FxAmericanExercise Exercise+ +-- | Descibes the averaging period properties for an asian +-- option. +data FxAsianFeature+instance Eq FxAsianFeature+instance Show FxAsianFeature+instance SchemaType FxAsianFeature+ +-- | A type that, for average rate options, is used to describe +-- each specific observation date, as opposed to a parametric +-- frequency of rate observations. +data FxAverageRateObservation+instance Eq FxAverageRateObservation+instance Show FxAverageRateObservation+instance SchemaType FxAverageRateObservation+ +-- | A type that describes average rate options rate +-- observations. This is used to describe a parametric +-- frequency of rate observations against a particular rate. +-- Typical frequencies might include daily, every Friday, etc. +data FxAverageRateObservationSchedule+instance Eq FxAverageRateObservationSchedule+instance Show FxAverageRateObservationSchedule+instance SchemaType FxAverageRateObservationSchedule+ +-- | Describes the properties of an Fx barrier. +data FxBarrierFeature+instance Eq FxBarrierFeature+instance Show FxBarrierFeature+instance SchemaType FxBarrierFeature+ +-- | Describes a precise boundary value. +data FxBoundary+instance Eq FxBoundary+instance Show FxBoundary+instance SchemaType FxBoundary+ +-- | Descrines the characteristics for American exercise in FX +-- digital options. +data FxDigitalAmericanExercise+instance Eq FxDigitalAmericanExercise+instance Show FxDigitalAmericanExercise+instance SchemaType FxDigitalAmericanExercise+instance Extension FxDigitalAmericanExercise Exercise+ +-- | Describes an option having a triggerable fixed payout. +data FxDigitalOption+instance Eq FxDigitalOption+instance Show FxDigitalOption+instance SchemaType FxDigitalOption+instance Extension FxDigitalOption Option+instance Extension FxDigitalOption Product+ +-- | Describes the characteristics for European exercise of FX +-- products. +data FxEuropeanExercise+instance Eq FxEuropeanExercise+instance Show FxEuropeanExercise+instance SchemaType FxEuropeanExercise+instance Extension FxEuropeanExercise Exercise+ +-- | Describes the limits on the size of notional when multiple +-- exercise is allowed. +data FxMultipleExercise+instance Eq FxMultipleExercise+instance Show FxMultipleExercise+instance SchemaType FxMultipleExercise+ +-- | Describes an FX option with optional asian and barrier +-- features. +data FxOption+instance Eq FxOption+instance Show FxOption+instance SchemaType FxOption+instance Extension FxOption Option+instance Extension FxOption Product+ +-- | A type describing the features that may be present in an FX +-- option. +data FxOptionFeatures+instance Eq FxOptionFeatures+instance Show FxOptionFeatures+instance SchemaType FxOptionFeatures+ +-- | A type that contains full details of a predefined fixed +-- payout which may occur (or not) in a Barrier Option or +-- Digital Option when a trigger event occurs (or not). +data FxOptionPayout+instance Eq FxOptionPayout+instance Show FxOptionPayout+instance SchemaType FxOptionPayout+instance Extension FxOptionPayout NonNegativeMoney+instance Extension FxOptionPayout MoneyBase+ +-- | A type that specifies the premium exchanged for a single +-- option trade or option strategy. +data FxOptionPremium+instance Eq FxOptionPremium+instance Show FxOptionPremium+instance SchemaType FxOptionPremium+instance Extension FxOptionPremium NonNegativePayment+instance Extension FxOptionPremium PaymentBaseExtended+instance Extension FxOptionPremium PaymentBase+ +-- | A type defining either a spot or forward FX transactions. +data FxSingleLeg+instance Eq FxSingleLeg+instance Show FxSingleLeg+instance SchemaType FxSingleLeg+instance Extension FxSingleLeg Product+ +-- | A type that describes the rate of exchange at which the +-- option has been struck. +data FxStrikePrice+instance Eq FxStrikePrice+instance Show FxStrikePrice+instance SchemaType FxStrikePrice+ +-- | A type defining either a spot/forward or forward/forward FX +-- swap transaction. +data FxSwap+instance Eq FxSwap+instance Show FxSwap+instance SchemaType FxSwap+instance Extension FxSwap Product+ +-- | A type defining the details for one of the transactions in +-- an FX swap. +data FxSwapLeg+instance Eq FxSwapLeg+instance Show FxSwapLeg+instance SchemaType FxSwapLeg+instance Extension FxSwapLeg Leg+ +-- | Describes an FX touch condition. +data FxTouch+instance Eq FxTouch+instance Show FxTouch+instance SchemaType FxTouch+ +-- | Describes an FX trigger condition. +data FxTrigger+instance Eq FxTrigger+instance Show FxTrigger+instance SchemaType FxTrigger+ +data LowerBound+instance Eq LowerBound+instance Show LowerBound+instance SchemaType LowerBound+ +-- | References a Money instance. +data MoneyReference+instance Eq MoneyReference+instance Show MoneyReference+instance SchemaType MoneyReference+instance Extension MoneyReference Reference+ +data ObservationSchedule+instance Eq ObservationSchedule+instance Show ObservationSchedule+instance SchemaType ObservationSchedule+ +-- | A type that describes the option premium as quoted. +data PremiumQuote+instance Eq PremiumQuote+instance Show PremiumQuote+instance SchemaType PremiumQuote+ +-- | A class defining the content model for a term deposit +-- product. +data TermDeposit+instance Eq TermDeposit+instance Show TermDeposit+instance SchemaType TermDeposit+instance Extension TermDeposit Product+ +data TermDepositFeatures+instance Eq TermDepositFeatures+instance Show TermDepositFeatures+instance SchemaType TermDepositFeatures+ +data UpperBound+instance Eq UpperBound+instance Show UpperBound+instance SchemaType UpperBound+ + + + +-- | A simple FX spot or forward transaction definition. +elementFxSingleLeg :: XMLParser FxSingleLeg+elementToXMLFxSingleLeg :: FxSingleLeg -> [Content ()]+ +-- | An FX Swap transaction definition. +elementFxSwap :: XMLParser FxSwap+elementToXMLFxSwap :: FxSwap -> [Content ()]+ +-- | An FX option transaction definition. +elementFxOption :: XMLParser FxOption+elementToXMLFxOption :: FxOption -> [Content ()]+ +-- | An FX digital option transaction definition. +elementFxDigitalOption :: XMLParser FxDigitalOption+elementToXMLFxDigitalOption :: FxDigitalOption -> [Content ()]+ +-- | A term deposit product definition. +elementTermDeposit :: XMLParser TermDeposit+elementToXMLTermDeposit :: TermDeposit -> [Content ()]
+ Data/FpML/V53/Generic.hs view
@@ -0,0 +1,266 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Generic+ ( module Data.FpML.V53.Generic+ , module Data.FpML.V53.Shared+ , 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.Shared+import Data.FpML.V53.Asset+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | A product to represent an OTC derivative transaction whose +-- economics are not fully described using an FpML schema.+elementGenericProduct :: XMLParser GenericProduct+elementGenericProduct = parseSchemaType "genericProduct"+elementToXMLGenericProduct :: GenericProduct -> [Content ()]+elementToXMLGenericProduct = schemaTypeToXML "genericProduct"+ +-- | A product to represent an OTC derivative transaction whose +-- economics are not fully described using an FpML schema.+elementNonSchemaProduct :: XMLParser GenericProduct+elementNonSchemaProduct = parseSchemaType "nonSchemaProduct"+elementToXMLNonSchemaProduct :: GenericProduct -> [Content ()]+elementToXMLNonSchemaProduct = schemaTypeToXML "nonSchemaProduct"+ +-- | Simple product representation providing key information +-- about a variety of different products+data GenericProduct = GenericProduct+ { genericProduct_ID :: Maybe Xsd.ID+ , genericProduct_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , genericProduct_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , genericProduct_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , genericProduct_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , genericProduct_multiLeg :: Maybe Xsd.Boolean+ -- ^ Indicates whether this transaction has multiple components, + -- not all of which may be reported.+ , genericProduct_choice5 :: (Maybe (OneOf2 ((Maybe (PartyReference)),(Maybe (AccountReference)),(Maybe (PartyReference)),(Maybe (AccountReference))) [PartyReference]))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * A reference to the party that buys this instrument, + -- ie. pays for this instrument and receives the + -- rights defined by it. See 2000 ISDA definitions + -- Article 11.1 (b). In the case of FRAs this the + -- fixed rate payer.+ -- + -- * A reference to the account that buys this + -- instrument.+ -- + -- * A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by + -- this instrument and in return receives a payment + -- for it. See 2000 ISDA definitions Article 11.1 (a). + -- In the case of FRAs this is the floating rate + -- payer.+ -- + -- * A reference to the account that sells this + -- instrument.+ -- + -- (2) counterpartyReference+ , genericProduct_premium :: Maybe SimplePayment+ , genericProduct_effectiveDate :: Maybe AdjustableDate2+ -- ^ The earliest of all the effective dates of all constituent + -- streams.+ , genericProduct_expirationDate :: Maybe AdjustableDate2+ -- ^ For options, the last exercise date of the option.+ , genericProduct_terminationDate :: Maybe AdjustableDate2+ -- ^ The latest of all of the termination (accrual end) dates of + -- the constituent or underlying streams.+ , genericProduct_underlyer :: [TradeUnderlyer2]+ -- ^ The set of underlyers to the trade that can be used in + -- computing the trade's cashflows. If this information is + -- needed to identify the trade, all of the trade's underlyers + -- should be specified, whether or not they figure into the + -- cashflow calculation. Otherwise, only those underlyers used + -- to compute this particular cashflow need be supplied.+ , genericProduct_notional :: [CashflowNotional]+ -- ^ The notional or notionals in effect on the last day of the + -- last calculation period in each stream.+ , genericProduct_optionType :: Maybe OptionType+ -- ^ For options, what type of option it is (e.g. butterfly).+ , genericProduct_settlementCurrency :: [IdentifiedCurrency]+ -- ^ The currency or currencies in which the product can settle.+ }+ deriving (Eq,Show)+instance SchemaType GenericProduct where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (GenericProduct a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` optional (parseSchemaType "multiLeg")+ `apply` optional (oneOf' [ ("Maybe PartyReference Maybe AccountReference Maybe PartyReference Maybe AccountReference", fmap OneOf2 (return (,,,) `apply` optional (parseSchemaType "buyerPartyReference")+ `apply` optional (parseSchemaType "buyerAccountReference")+ `apply` optional (parseSchemaType "sellerPartyReference")+ `apply` optional (parseSchemaType "sellerAccountReference")))+ , ("[PartyReference]", fmap TwoOf2 (between (Occurs (Just 1) (Just 2))+ (parseSchemaType "counterpartyReference")))+ ])+ `apply` optional (parseSchemaType "premium")+ `apply` optional (parseSchemaType "effectiveDate")+ `apply` optional (parseSchemaType "expirationDate")+ `apply` optional (parseSchemaType "terminationDate")+ `apply` many (parseSchemaType "underlyer")+ `apply` many (parseSchemaType "notional")+ `apply` optional (parseSchemaType "optionType")+ `apply` many (parseSchemaType "settlementCurrency")+ schemaTypeToXML s x@GenericProduct{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ genericProduct_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ genericProduct_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ genericProduct_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ genericProduct_productType x+ , concatMap (schemaTypeToXML "productId") $ genericProduct_productId x+ , maybe [] (schemaTypeToXML "multiLeg") $ genericProduct_multiLeg x+ , maybe [] (foldOneOf2 (\ (a,b,c,d) -> concat [ maybe [] (schemaTypeToXML "buyerPartyReference") a+ , maybe [] (schemaTypeToXML "buyerAccountReference") b+ , maybe [] (schemaTypeToXML "sellerPartyReference") c+ , maybe [] (schemaTypeToXML "sellerAccountReference") d+ ])+ (concatMap (schemaTypeToXML "counterpartyReference"))+ ) $ genericProduct_choice5 x+ , maybe [] (schemaTypeToXML "premium") $ genericProduct_premium x+ , maybe [] (schemaTypeToXML "effectiveDate") $ genericProduct_effectiveDate x+ , maybe [] (schemaTypeToXML "expirationDate") $ genericProduct_expirationDate x+ , maybe [] (schemaTypeToXML "terminationDate") $ genericProduct_terminationDate x+ , concatMap (schemaTypeToXML "underlyer") $ genericProduct_underlyer x+ , concatMap (schemaTypeToXML "notional") $ genericProduct_notional x+ , maybe [] (schemaTypeToXML "optionType") $ genericProduct_optionType x+ , concatMap (schemaTypeToXML "settlementCurrency") $ genericProduct_settlementCurrency x+ ]+instance Extension GenericProduct Product where+ supertype v = Product_GenericProduct v+ +-- | The underlying asset/index/reference price etc. whose +-- rate/price may be observed to compute the value of the +-- cashflow. It can be an index, fixed rate, listed security, +-- quoted currency pair, or a reference entity (for credit +-- derivatives).+data TradeUnderlyer2 = TradeUnderlyer2+ { tradeUnderl_ID :: Maybe Xsd.ID+ , tradeUnderl_choice0 :: (Maybe (OneOf5 FloatingRate Schedule Asset QuotedCurrencyPair LegalEntity))+ -- ^ Choice between:+ -- + -- (1) A floating rate.+ -- + -- (2) The fixed rate or fixed rate schedule expressed as + -- explicit fixed rates and dates. In the case of a + -- schedule, the step dates may be subject to adjustment + -- in accordance with any adjustments specified in + -- calculationPeriodDatesAdjustments.+ -- + -- (3) Define the underlying asset, either a listed security + -- or other instrument.+ -- + -- (4) Describes the composition of a rate that has been + -- quoted. This includes the two currencies and the + -- quotation relationship between the two currencies.+ -- + -- (5) The corporate or sovereign entity on which you are + -- buying or selling protection and any successor that + -- assumes all or substantially all of its contractual and + -- other obligations. It is vital to use the correct legal + -- name of the entity and to be careful not to choose a + -- subsidiary if you really want to trade protection on a + -- parent company. Please note, Reference Entities cannot + -- be senior or subordinated. It is the obligations of the + -- Reference Entities that can be senior or subordinated. + -- ISDA 2003 Term: Reference Entity+ , tradeUnderl_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , tradeUnderl_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , tradeUnderl_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , tradeUnderl_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ }+ deriving (Eq,Show)+instance SchemaType TradeUnderlyer2 where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (TradeUnderlyer2 a0)+ `apply` optional (oneOf' [ ("FloatingRate", fmap OneOf5 (parseSchemaType "floatingRate"))+ , ("Schedule", fmap TwoOf5 (parseSchemaType "fixedRate"))+ , ("Asset", fmap ThreeOf5 (elementUnderlyingAsset))+ , ("QuotedCurrencyPair", fmap FourOf5 (parseSchemaType "quotedCurrencyPair"))+ , ("LegalEntity", fmap FiveOf5 (parseSchemaType "referenceEntity"))+ ])+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ schemaTypeToXML s x@TradeUnderlyer2{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ tradeUnderl_ID x+ ]+ [ maybe [] (foldOneOf5 (schemaTypeToXML "floatingRate")+ (schemaTypeToXML "fixedRate")+ (elementToXMLUnderlyingAsset)+ (schemaTypeToXML "quotedCurrencyPair")+ (schemaTypeToXML "referenceEntity")+ ) $ tradeUnderl_choice0 x+ , maybe [] (schemaTypeToXML "payerPartyReference") $ tradeUnderl_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ tradeUnderl_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ tradeUnderl_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ tradeUnderl_receiverAccountReference x+ ]+ +-- | A flexible description of the type or characteristics of an +-- option or strategy, e.g. butterfly, condor, chooser.+data OptionType = OptionType Scheme OptionTypeAttributes deriving (Eq,Show)+data OptionTypeAttributes = OptionTypeAttributes+ { optionTypeAttrib_optionTypeScheme :: Maybe Xsd.AnyURI+ -- ^ The type scheme used with this option type.+ }+ deriving (Eq,Show)+instance SchemaType OptionType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "optionTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ OptionType v (OptionTypeAttributes a0)+ schemaTypeToXML s (OptionType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "optionTypeScheme") $ optionTypeAttrib_optionTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension OptionType Scheme where+ supertype (OptionType s _) = s
+ Data/FpML/V53/Generic.hs-boot view
@@ -0,0 +1,52 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Generic+ ( module Data.FpML.V53.Generic+ , module Data.FpML.V53.Shared+ , 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 qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Shared+import {-# SOURCE #-} Data.FpML.V53.Asset+ +-- | A product to represent an OTC derivative transaction whose +-- economics are not fully described using an FpML schema. +elementGenericProduct :: XMLParser GenericProduct+elementToXMLGenericProduct :: GenericProduct -> [Content ()]+ +-- | A product to represent an OTC derivative transaction whose +-- economics are not fully described using an FpML schema. +elementNonSchemaProduct :: XMLParser GenericProduct+elementToXMLNonSchemaProduct :: GenericProduct -> [Content ()]+ +-- | Simple product representation providing key information +-- about a variety of different products +data GenericProduct+instance Eq GenericProduct+instance Show GenericProduct+instance SchemaType GenericProduct+instance Extension GenericProduct Product+ +-- | The underlying asset/index/reference price etc. whose +-- rate/price may be observed to compute the value of the +-- cashflow. It can be an index, fixed rate, listed security, +-- quoted currency pair, or a reference entity (for credit +-- derivatives). +data TradeUnderlyer2+instance Eq TradeUnderlyer2+instance Show TradeUnderlyer2+instance SchemaType TradeUnderlyer2+ +-- | A flexible description of the type or characteristics of an +-- option or strategy, e.g. butterfly, condor, chooser. +data OptionType+data OptionTypeAttributes+instance Eq OptionType+instance Eq OptionTypeAttributes+instance Show OptionType+instance Show OptionTypeAttributes+instance SchemaType OptionType+instance Extension OptionType Scheme
+ Data/FpML/V53/IRD.hs view
@@ -0,0 +1,3117 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.IRD+ ( module Data.FpML.V53.IRD+ , 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+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | A type including a reference to a bond to support the +-- representation of an asset swap or Condition Precedent +-- Bond.+data BondReference = BondReference+ { bondRef_bond :: Maybe Bond+ -- ^ Identifies the underlying asset when it is a series or a + -- class of bonds.+ , bondRef_conditionPrecedentBond :: Maybe Xsd.Boolean+ -- ^ To indicate whether the Condition Precedent Bond is + -- applicable. The swap contract is only valid if the bond is + -- issued and if there is any dispute over the terms of fixed + -- stream then the bond terms would be used.+ , bondRef_discrepancyClause :: Maybe Xsd.Boolean+ -- ^ To indicate whether the Discrepancy Clause is applicable.+ }+ deriving (Eq,Show)+instance SchemaType BondReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return BondReference+ `apply` optional (elementBond)+ `apply` optional (parseSchemaType "conditionPrecedentBond")+ `apply` optional (parseSchemaType "discrepancyClause")+ schemaTypeToXML s x@BondReference{} =+ toXMLElement s []+ [ maybe [] (elementToXMLBond) $ bondRef_bond x+ , maybe [] (schemaTypeToXML "conditionPrecedentBond") $ bondRef_conditionPrecedentBond x+ , maybe [] (schemaTypeToXML "discrepancyClause") $ bondRef_discrepancyClause x+ ]+ +-- | A product to represent a single cashflow.+data BulletPayment = BulletPayment+ { bulletPayment_ID :: Maybe Xsd.ID+ , bulletPayment_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , bulletPayment_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , bulletPayment_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , bulletPayment_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , bulletPayment_payment :: Maybe Payment+ -- ^ A known payment between two parties.+ }+ deriving (Eq,Show)+instance SchemaType BulletPayment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (BulletPayment a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` optional (parseSchemaType "payment")+ schemaTypeToXML s x@BulletPayment{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ bulletPayment_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ bulletPayment_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ bulletPayment_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ bulletPayment_productType x+ , concatMap (schemaTypeToXML "productId") $ bulletPayment_productId x+ , maybe [] (schemaTypeToXML "payment") $ bulletPayment_payment x+ ]+instance Extension BulletPayment Product where+ supertype v = Product_BulletPayment v+ +-- | A type definining the parameters used in the calculation of +-- fixed or floating calculation period amounts.+data Calculation = Calculation+ { calculation_choice0 :: OneOf2 Notional FxLinkedNotionalSchedule+ -- ^ Choice between:+ -- + -- (1) The notional amount or notional amount schedule.+ -- + -- (2) A notional amount schedule where each notional that + -- applied to a calculation period is calculated with + -- reference to a notional amount or notional amount + -- schedule in a different currency by means of a spot + -- currency exchange rate which is normally observed at + -- the beginning of each period.+ , calculation_choice1 :: OneOf2 (Schedule,(Maybe (FutureValueAmount))) Rate+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The fixed rate or fixed rate schedule expressed as + -- explicit fixed rates and dates. In the case of a + -- schedule, the step dates may be subject to + -- adjustment in accordance with any adjustments + -- specified in calculationPeriodDatesAdjustments.+ -- + -- * The future value notional is normally only required + -- for BRL CDI Swaps. The value is calculated as + -- follows: Future Value Notional = Notional Amount * + -- (1 + Fixed Rate) ^ (Fixed Rate Day Count Fraction). + -- The currency should always match that expressed in + -- the notional schedule. The value date should match + -- the adjusted termination date.+ -- + -- (2) The base element for the floating rate calculation + -- definitions.+ , calculation_dayCountFraction :: DayCountFraction+ -- ^ The day count fraction.+ , calculation_discounting :: Maybe Discounting+ -- ^ The parameters specifying any discounting conventions that + -- may apply. This element must only be included if + -- discounting applies.+ , calculation_compoundingMethod :: Maybe CompoundingMethodEnum+ -- ^ If more that one calculation period contributes to a single + -- payment amount this element specifies whether compounding + -- is applicable, and if so, what compounding method is to be + -- used. This element must only be included when more that one + -- calculation period contributes to a single payment amount.+ }+ deriving (Eq,Show)+instance SchemaType Calculation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Calculation+ `apply` oneOf' [ ("Notional", fmap OneOf2 (parseSchemaType "notionalSchedule"))+ , ("FxLinkedNotionalSchedule", fmap TwoOf2 (parseSchemaType "fxLinkedNotionalSchedule"))+ ]+ `apply` oneOf' [ ("Schedule Maybe FutureValueAmount", fmap OneOf2 (return (,) `apply` parseSchemaType "fixedRateSchedule"+ `apply` optional (parseSchemaType "futureValueNotional")))+ , ("Rate", fmap TwoOf2 (elementRateCalculation))+ ]+ `apply` parseSchemaType "dayCountFraction"+ `apply` optional (parseSchemaType "discounting")+ `apply` optional (parseSchemaType "compoundingMethod")+ schemaTypeToXML s x@Calculation{} =+ toXMLElement s []+ [ foldOneOf2 (schemaTypeToXML "notionalSchedule")+ (schemaTypeToXML "fxLinkedNotionalSchedule")+ $ calculation_choice0 x+ , foldOneOf2 (\ (a,b) -> concat [ schemaTypeToXML "fixedRateSchedule" a+ , maybe [] (schemaTypeToXML "futureValueNotional") b+ ])+ (elementToXMLRateCalculation)+ $ calculation_choice1 x+ , schemaTypeToXML "dayCountFraction" $ calculation_dayCountFraction x+ , maybe [] (schemaTypeToXML "discounting") $ calculation_discounting x+ , maybe [] (schemaTypeToXML "compoundingMethod") $ calculation_compoundingMethod x+ ]+ +-- | A type defining the parameters used in the calculation of a +-- fixed or floating rate calculation period amount. This type +-- forms part of cashflows representation of a swap stream.+data CalculationPeriod = CalculationPeriod+ { calcPeriod_ID :: Maybe Xsd.ID+ , calcPeriod_unadjustedStartDate :: Maybe Xsd.Date+ , calcPeriod_unadjustedEndDate :: Maybe Xsd.Date+ , calcPeriod_adjustedStartDate :: Maybe Xsd.Date+ -- ^ The calculation period start date, adjusted according to + -- any relevant business day convention.+ , calcPeriod_adjustedEndDate :: Maybe Xsd.Date+ -- ^ The calculation period end date, adjusted according to any + -- relevant business day convention.+ , calculationPeriod_numberOfDays :: Maybe Xsd.PositiveInteger+ -- ^ The number of days from the adjusted effective / start date + -- to the adjusted termination / end date calculated in + -- accordance with the applicable day count fraction.+ , calcPeriod_choice5 :: (Maybe (OneOf2 Xsd.Decimal FxLinkedNotionalAmount))+ -- ^ Choice between:+ -- + -- (1) The amount that a cashflow will accrue interest on.+ -- + -- (2) The amount that a cashflow will accrue interest on. + -- This is the calculated amount of the fx linked - ie the + -- other currency notional amount multiplied by the + -- appropriate fx spot rate.+ , calcPeriod_choice6 :: (Maybe (OneOf2 FloatingRateDefinition Xsd.Decimal))+ -- ^ Choice between:+ -- + -- (1) The floating rate reset information for the calculation + -- period.+ -- + -- (2) The calculation period fixed rate. A per annum rate, + -- expressed as a decimal. A fixed rate of 5% would be + -- represented as 0.05.+ , calcPeriod_dayCountYearFraction :: Maybe Xsd.Decimal+ -- ^ The year fraction value of the calculation period, result + -- of applying the ISDA rules for day count fraction defined + -- in the ISDA Annex.+ , calcPeriod_forecastAmount :: Maybe Money+ -- ^ The amount representing the forecast of the accrued value + -- of the calculation period. An intermediate value used to + -- generate the forecastPaymentAmount in the + -- PaymentCalculationPeriod.+ , calcPeriod_forecastRate :: Maybe Xsd.Decimal+ -- ^ A value representing the forecast rate used to calculate + -- the forecast future value of the accrual period. This is a + -- calculated rate determined based on averaging the rates in + -- the rateObservation elements, and incorporates all of the + -- rate treatment and averaging rules. A value of 1% should be + -- represented as 0.01+ }+ deriving (Eq,Show)+instance SchemaType CalculationPeriod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CalculationPeriod a0)+ `apply` optional (parseSchemaType "unadjustedStartDate")+ `apply` optional (parseSchemaType "unadjustedEndDate")+ `apply` optional (parseSchemaType "adjustedStartDate")+ `apply` optional (parseSchemaType "adjustedEndDate")+ `apply` optional (parseSchemaType "calculationPeriodNumberOfDays")+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "notionalAmount"))+ , ("FxLinkedNotionalAmount", fmap TwoOf2 (parseSchemaType "fxLinkedNotionalAmount"))+ ])+ `apply` optional (oneOf' [ ("FloatingRateDefinition", fmap OneOf2 (parseSchemaType "floatingRateDefinition"))+ , ("Xsd.Decimal", fmap TwoOf2 (parseSchemaType "fixedRate"))+ ])+ `apply` optional (parseSchemaType "dayCountYearFraction")+ `apply` optional (parseSchemaType "forecastAmount")+ `apply` optional (parseSchemaType "forecastRate")+ schemaTypeToXML s x@CalculationPeriod{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ calcPeriod_ID x+ ]+ [ maybe [] (schemaTypeToXML "unadjustedStartDate") $ calcPeriod_unadjustedStartDate x+ , maybe [] (schemaTypeToXML "unadjustedEndDate") $ calcPeriod_unadjustedEndDate x+ , maybe [] (schemaTypeToXML "adjustedStartDate") $ calcPeriod_adjustedStartDate x+ , maybe [] (schemaTypeToXML "adjustedEndDate") $ calcPeriod_adjustedEndDate x+ , maybe [] (schemaTypeToXML "calculationPeriodNumberOfDays") $ calculationPeriod_numberOfDays x+ , maybe [] (foldOneOf2 (schemaTypeToXML "notionalAmount")+ (schemaTypeToXML "fxLinkedNotionalAmount")+ ) $ calcPeriod_choice5 x+ , maybe [] (foldOneOf2 (schemaTypeToXML "floatingRateDefinition")+ (schemaTypeToXML "fixedRate")+ ) $ calcPeriod_choice6 x+ , maybe [] (schemaTypeToXML "dayCountYearFraction") $ calcPeriod_dayCountYearFraction x+ , maybe [] (schemaTypeToXML "forecastAmount") $ calcPeriod_forecastAmount x+ , maybe [] (schemaTypeToXML "forecastRate") $ calcPeriod_forecastRate x+ ]+ +-- | A type defining the parameters used in the calculation of +-- fixed or floating rate calculation period amounts or for +-- specifying a known calculation period amount or known +-- amount schedule.+data CalculationPeriodAmount = CalculationPeriodAmount+ { calcPeriodAmount_choice0 :: OneOf2 Calculation AmountSchedule+ -- ^ Choice between:+ -- + -- (1) The parameters used in the calculation of fixed or + -- floaring rate calculation period amounts.+ -- + -- (2) The known calculation period amount or a known amount + -- schedule expressed as explicit known amounts and dates. + -- In the case of a schedule, the step dates may be + -- subject to adjustment in accordance with any + -- adjustments specified in + -- calculationPeriodDatesAdjustments.+ }+ deriving (Eq,Show)+instance SchemaType CalculationPeriodAmount where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CalculationPeriodAmount+ `apply` oneOf' [ ("Calculation", fmap OneOf2 (parseSchemaType "calculation"))+ , ("AmountSchedule", fmap TwoOf2 (parseSchemaType "knownAmountSchedule"))+ ]+ schemaTypeToXML s x@CalculationPeriodAmount{} =+ toXMLElement s []+ [ foldOneOf2 (schemaTypeToXML "calculation")+ (schemaTypeToXML "knownAmountSchedule")+ $ calcPeriodAmount_choice0 x+ ]+ +-- | A type defining the parameters used to generate the +-- calculation period dates schedule, including the +-- specification of any initial or final stub calculation +-- periods. A calculation perod schedule consists of an +-- optional initial stub calculation period, one or more +-- regular calculation periods and an optional final stub +-- calculation period. In the absence of any initial or final +-- stub calculation periods, the regular part of the +-- calculation period schedule is assumed to be between the +-- effective date and the termination date. No implicit stubs +-- are allowed, i.e. stubs must be explicitly specified using +-- an appropriate combination of firstPeriodStateDate, +-- firstRegularPeriodStartDate and lastRegularPeriodEndDate.+data CalculationPeriodDates = CalculationPeriodDates+ { calcPeriodDates_ID :: Maybe Xsd.ID+ , calcPeriodDates_choice0 :: OneOf2 AdjustableDate AdjustedRelativeDateOffset+ -- ^ Choice between:+ -- + -- (1) The first day of the term of the trade. This day may be + -- subject to adjustment in accordance with a business day + -- convention.+ -- + -- (2) Defines the effective date.+ , calcPeriodDates_choice1 :: OneOf2 AdjustableDate RelativeDateOffset+ -- ^ Choice between:+ -- + -- (1) The last day of the term of the trade. This day may be + -- subject to adjustment in accordance with a business day + -- convention.+ -- + -- (2) The term/maturity of the swap, express as a tenor + -- (typically in years).+ , calculationPeriodDates_adjustments :: Maybe BusinessDayAdjustments+ -- ^ The business day convention to apply to each calculation + -- period end date if it would otherwise fall on a day that is + -- not a business day in the specified financial business + -- centers.+ , calcPeriodDates_firstPeriodStartDate :: Maybe AdjustableDate+ -- ^ The start date of the calculation period if the date falls + -- before the effective date. It must only be specified if it + -- is not equal to the effective date. This date may be + -- subject to adjustment in accordance with a business day + -- convention.+ , calcPeriodDates_firstRegularPeriodStartDate :: Maybe Xsd.Date+ -- ^ The start date of the regular part of the calculation + -- period schedule. It must only be specified if there is an + -- initial stub calculation period. This day may be subject to + -- adjustment in accordance with any adjustments specified in + -- calculationPeriodDatesAdjustments.+ , calcPeriodDates_firstCompoundingPeriodEndDate :: Maybe Xsd.Date+ -- ^ The end date of the initial compounding period when + -- compounding is applicable. It must only be specified when + -- the compoundingMethod element is present and not equal to a + -- value of None. This date may be subject to adjustment in + -- accordance with any adjustments specified in + -- calculationPeriodDatesAdjustments.+ , calcPeriodDates_lastRegularPeriodEndDate :: Maybe Xsd.Date+ -- ^ The end date of the regular part of the calculation period + -- schedule. It must only be specified if there is a final + -- stub calculation period. This day may be subject to + -- adjustment in accordance with any adjustments specified in + -- calculationPeriodDatesAdjustments.+ , calcPeriodDates_stubPeriodType :: Maybe StubPeriodTypeEnum+ -- ^ Method to allocate any irregular period remaining after + -- regular periods have been allocated between the effective + -- and termination date.+ , calcPeriodDates_calculationPeriodFrequency :: Maybe CalculationPeriodFrequency+ -- ^ The frequency at which calculation period end dates occur + -- with the regular part of the calculation period schedule + -- and their roll date convention.+ }+ deriving (Eq,Show)+instance SchemaType CalculationPeriodDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CalculationPeriodDates a0)+ `apply` oneOf' [ ("AdjustableDate", fmap OneOf2 (parseSchemaType "effectiveDate"))+ , ("AdjustedRelativeDateOffset", fmap TwoOf2 (parseSchemaType "relativeEffectiveDate"))+ ]+ `apply` oneOf' [ ("AdjustableDate", fmap OneOf2 (parseSchemaType "terminationDate"))+ , ("RelativeDateOffset", fmap TwoOf2 (parseSchemaType "relativeTerminationDate"))+ ]+ `apply` optional (parseSchemaType "calculationPeriodDatesAdjustments")+ `apply` optional (parseSchemaType "firstPeriodStartDate")+ `apply` optional (parseSchemaType "firstRegularPeriodStartDate")+ `apply` optional (parseSchemaType "firstCompoundingPeriodEndDate")+ `apply` optional (parseSchemaType "lastRegularPeriodEndDate")+ `apply` optional (parseSchemaType "stubPeriodType")+ `apply` optional (parseSchemaType "calculationPeriodFrequency")+ schemaTypeToXML s x@CalculationPeriodDates{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ calcPeriodDates_ID x+ ]+ [ foldOneOf2 (schemaTypeToXML "effectiveDate")+ (schemaTypeToXML "relativeEffectiveDate")+ $ calcPeriodDates_choice0 x+ , foldOneOf2 (schemaTypeToXML "terminationDate")+ (schemaTypeToXML "relativeTerminationDate")+ $ calcPeriodDates_choice1 x+ , maybe [] (schemaTypeToXML "calculationPeriodDatesAdjustments") $ calculationPeriodDates_adjustments x+ , maybe [] (schemaTypeToXML "firstPeriodStartDate") $ calcPeriodDates_firstPeriodStartDate x+ , maybe [] (schemaTypeToXML "firstRegularPeriodStartDate") $ calcPeriodDates_firstRegularPeriodStartDate x+ , maybe [] (schemaTypeToXML "firstCompoundingPeriodEndDate") $ calcPeriodDates_firstCompoundingPeriodEndDate x+ , maybe [] (schemaTypeToXML "lastRegularPeriodEndDate") $ calcPeriodDates_lastRegularPeriodEndDate x+ , maybe [] (schemaTypeToXML "stubPeriodType") $ calcPeriodDates_stubPeriodType x+ , maybe [] (schemaTypeToXML "calculationPeriodFrequency") $ calcPeriodDates_calculationPeriodFrequency x+ ]+ +-- | Reference to a calculation period dates component.+data CalculationPeriodDatesReference = CalculationPeriodDatesReference+ { calcPeriodDatesRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType CalculationPeriodDatesReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (CalculationPeriodDatesReference a0)+ schemaTypeToXML s x@CalculationPeriodDatesReference{} =+ toXMLElement s [ toXMLAttribute "href" $ calcPeriodDatesRef_href x+ ]+ []+instance Extension CalculationPeriodDatesReference Reference where+ supertype v = Reference_CalculationPeriodDatesReference v+ +-- | A type defining the right of a party to cancel a swap +-- transaction on the specified exercise dates. The provision +-- is for 'walkaway' cancellation (i.e. the fair value of the +-- swap is not paid). A fee payable on exercise can be +-- specified.+data CancelableProvision = CancelableProvision+ { cancelProvis_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , cancelProvis_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , cancelProvis_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , cancelProvis_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , cancelProvis_exercise :: Maybe Exercise+ -- ^ An placeholder for the actual option exercise definitions.+ , cancelProvis_exerciseNotice :: Maybe ExerciseNotice+ -- ^ Definition of the party to whom notice of exercise should + -- be given.+ , cancelProvis_followUpConfirmation :: Maybe Xsd.Boolean+ -- ^ A flag to indicate whether follow-up confirmation of + -- exercise (written or electronic) is required following + -- telephonic notice by the buyer to the seller or seller's + -- agent.+ , cancelableProvision_adjustedDates :: Maybe CancelableProvisionAdjustedDates+ -- ^ The adjusted dates associated with a cancelable provision. + -- These dates have been adjusted for any applicable business + -- day convention.+ , cancelProvis_finalCalculationPeriodDateAdjustment :: [FinalCalculationPeriodDateAdjustment]+ -- ^ Business date convention adjustment to final payment period + -- per leg (swapStream) upon exercise event. The adjustments + -- can be made in-line with leg level BDC's or they can be + -- specified seperately.+ , cancelProvis_initialFee :: Maybe SimplePayment+ -- ^ An initial fee for the cancelable option.+ }+ deriving (Eq,Show)+instance SchemaType CancelableProvision where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CancelableProvision+ `apply` optional (parseSchemaType "buyerPartyReference")+ `apply` optional (parseSchemaType "buyerAccountReference")+ `apply` optional (parseSchemaType "sellerPartyReference")+ `apply` optional (parseSchemaType "sellerAccountReference")+ `apply` optional (elementExercise)+ `apply` optional (parseSchemaType "exerciseNotice")+ `apply` optional (parseSchemaType "followUpConfirmation")+ `apply` optional (parseSchemaType "cancelableProvisionAdjustedDates")+ `apply` many (parseSchemaType "finalCalculationPeriodDateAdjustment")+ `apply` optional (parseSchemaType "initialFee")+ schemaTypeToXML s x@CancelableProvision{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "buyerPartyReference") $ cancelProvis_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ cancelProvis_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ cancelProvis_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ cancelProvis_sellerAccountReference x+ , maybe [] (elementToXMLExercise) $ cancelProvis_exercise x+ , maybe [] (schemaTypeToXML "exerciseNotice") $ cancelProvis_exerciseNotice x+ , maybe [] (schemaTypeToXML "followUpConfirmation") $ cancelProvis_followUpConfirmation x+ , maybe [] (schemaTypeToXML "cancelableProvisionAdjustedDates") $ cancelableProvision_adjustedDates x+ , concatMap (schemaTypeToXML "finalCalculationPeriodDateAdjustment") $ cancelProvis_finalCalculationPeriodDateAdjustment x+ , maybe [] (schemaTypeToXML "initialFee") $ cancelProvis_initialFee x+ ]+ +-- | A type to define the adjusted dates for a cancelable +-- provision on a swap transaction.+data CancelableProvisionAdjustedDates = CancelableProvisionAdjustedDates+ { cancelProvisAdjustDates_cancellationEvent :: [CancellationEvent]+ -- ^ The adjusted dates for an individual cancellation date.+ }+ deriving (Eq,Show)+instance SchemaType CancelableProvisionAdjustedDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CancelableProvisionAdjustedDates+ `apply` many (parseSchemaType "cancellationEvent")+ schemaTypeToXML s x@CancelableProvisionAdjustedDates{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "cancellationEvent") $ cancelProvisAdjustDates_cancellationEvent x+ ]+ +-- | The adjusted dates for a specific cancellation date, +-- including the adjusted exercise date and adjusted +-- termination date.+data CancellationEvent = CancellationEvent+ { cancelEvent_ID :: Maybe Xsd.ID+ , cancelEvent_adjustedExerciseDate :: Maybe Xsd.Date+ -- ^ The date on which option exercise takes place. This date + -- should already be adjusted for any applicable business day + -- convention.+ , cancelEvent_adjustedEarlyTerminationDate :: Maybe Xsd.Date+ -- ^ The early termination date that is applicable if an early + -- termination provision is exercised. This date should + -- already be adjusted for any applicable business day + -- convention.+ }+ deriving (Eq,Show)+instance SchemaType CancellationEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CancellationEvent a0)+ `apply` optional (parseSchemaType "adjustedExerciseDate")+ `apply` optional (parseSchemaType "adjustedEarlyTerminationDate")+ schemaTypeToXML s x@CancellationEvent{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ cancelEvent_ID x+ ]+ [ maybe [] (schemaTypeToXML "adjustedExerciseDate") $ cancelEvent_adjustedExerciseDate x+ , maybe [] (schemaTypeToXML "adjustedEarlyTerminationDate") $ cancelEvent_adjustedEarlyTerminationDate x+ ]+ +-- | A type defining an interest rate cap, floor, or cap/floor +-- strategy (e.g. collar) product.+data CapFloor = CapFloor+ { capFloor_ID :: Maybe Xsd.ID+ , capFloor_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , capFloor_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , capFloor_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , capFloor_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , capFloor_stream :: Maybe InterestRateStream+ , capFloor_premium :: [Payment]+ -- ^ The option premium amount payable by buyer to seller on the + -- specified payment date.+ , capFloor_additionalPayment :: [Payment]+ -- ^ Additional payments between the principal parties.+ , capFloor_earlyTerminationProvision :: Maybe EarlyTerminationProvision+ -- ^ Parameters specifying provisions relating to the optional + -- and mandatory early terminarion of a CapFloor transaction.+ }+ deriving (Eq,Show)+instance SchemaType CapFloor where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CapFloor a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` optional (parseSchemaType "capFloorStream")+ `apply` many (parseSchemaType "premium")+ `apply` many (parseSchemaType "additionalPayment")+ `apply` optional (parseSchemaType "earlyTerminationProvision")+ schemaTypeToXML s x@CapFloor{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ capFloor_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ capFloor_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ capFloor_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ capFloor_productType x+ , concatMap (schemaTypeToXML "productId") $ capFloor_productId x+ , maybe [] (schemaTypeToXML "capFloorStream") $ capFloor_stream x+ , concatMap (schemaTypeToXML "premium") $ capFloor_premium x+ , concatMap (schemaTypeToXML "additionalPayment") $ capFloor_additionalPayment x+ , maybe [] (schemaTypeToXML "earlyTerminationProvision") $ capFloor_earlyTerminationProvision x+ ]+instance Extension CapFloor Product where+ supertype v = Product_CapFloor v+ +-- | A type defining the cashflow representation of a swap +-- trade.+data Cashflows = Cashflows+ { cashflows_matchParameters :: Maybe Xsd.Boolean+ -- ^ A true/false flag to indicate whether the cashflows match + -- the parametric definition of the stream, i.e. whether the + -- cashflows could be regenerated from the parameters without + -- loss of information.+ , cashflows_principalExchange :: [PrincipalExchange]+ -- ^ The initial, intermediate and final principal exchange + -- amounts. Typically required on cross currency interest rate + -- swaps where actual exchanges of principal occur. A list of + -- principal exchange elements may be ordered in the document + -- by ascending adjusted principal exchange date. An FpML + -- document containing an unordered principal exchange list is + -- still regarded as a conformant document.+ , cashflows_paymentCalculationPeriod :: [PaymentCalculationPeriod]+ -- ^ The adjusted payment date and associated calculation period + -- parameters required to calculate the actual or projected + -- payment amount. A list of payment calculation period + -- elements may be ordered in the document by ascending + -- adjusted payment date. An FpML document containing an + -- unordered list of payment calculation periods is still + -- regarded as a conformant document.+ }+ deriving (Eq,Show)+instance SchemaType Cashflows where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Cashflows+ `apply` optional (parseSchemaType "cashflowsMatchParameters")+ `apply` many (parseSchemaType "principalExchange")+ `apply` many (parseSchemaType "paymentCalculationPeriod")+ schemaTypeToXML s x@Cashflows{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "cashflowsMatchParameters") $ cashflows_matchParameters x+ , concatMap (schemaTypeToXML "principalExchange") $ cashflows_principalExchange x+ , concatMap (schemaTypeToXML "paymentCalculationPeriod") $ cashflows_paymentCalculationPeriod x+ ]+ +-- | A type defining the parameters necessary for each of the +-- ISDA cash price methods for cash settlement.+data CashPriceMethod = CashPriceMethod+ { cashPriceMethod_cashSettlementReferenceBanks :: Maybe CashSettlementReferenceBanks+ -- ^ A container for a set of reference institutions. These + -- reference institutions may be called upon to provide rate + -- quotations as part of the method to determine the + -- applicable cash settlement amount. If institutions are not + -- specified, it is assumed that reference institutions will + -- be agreed between the parties on the exercise date, or in + -- the case of swap transaction to which mandatory early + -- termination is applicable, the cash settlement valuation + -- date.+ , cashPriceMethod_cashSettlementCurrency :: Maybe Currency+ -- ^ The currency in which the cash settlement amount will be + -- calculated and settled.+ , cashPriceMethod_quotationRateType :: Maybe QuotationRateTypeEnum+ -- ^ Which rate quote is to be observed, either Bid, Mid, Offer + -- or Exercising Party Pays. The meaning of Exercising Party + -- Pays is defined in the 2000 ISDA Definitions, Section 17.2. + -- Certain Definitions Relating to Cash Settlement, paragraph + -- (j)+ }+ deriving (Eq,Show)+instance SchemaType CashPriceMethod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CashPriceMethod+ `apply` optional (parseSchemaType "cashSettlementReferenceBanks")+ `apply` optional (parseSchemaType "cashSettlementCurrency")+ `apply` optional (parseSchemaType "quotationRateType")+ schemaTypeToXML s x@CashPriceMethod{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "cashSettlementReferenceBanks") $ cashPriceMethod_cashSettlementReferenceBanks x+ , maybe [] (schemaTypeToXML "cashSettlementCurrency") $ cashPriceMethod_cashSettlementCurrency x+ , maybe [] (schemaTypeToXML "quotationRateType") $ cashPriceMethod_quotationRateType x+ ]+ +-- | A type to define the cash settlement terms for a product +-- where cash settlement is applicable.+data CashSettlement = CashSettlement+ { cashSettl_ID :: Maybe Xsd.ID+ , cashSettlement_valuationTime :: Maybe BusinessCenterTime+ -- ^ The time of the cash settlement valuation date when the + -- cash settlement amount will be determined according to the + -- cash settlement method if the parties have not otherwise + -- been able to agree the cash settlement amount.+ , cashSettlement_valuationDate :: Maybe RelativeDateOffset+ -- ^ The date on which the cash settlement amount will be + -- determined according to the cash settlement method if the + -- parties have not otherwise been able to agree the cash + -- settlement amount.+ , cashSettlement_paymentDate :: Maybe CashSettlementPaymentDate+ -- ^ The date on which the cash settlement amount will be paid, + -- subject to adjustment in accordance with any applicable + -- business day convention. This component would not be + -- present for a mandatory early termination provision where + -- the cash settlement payment date is the mandatory early + -- termination date.+ , cashSettl_choice3 :: (Maybe (OneOf7 CashPriceMethod CashPriceMethod YieldCurveMethod YieldCurveMethod YieldCurveMethod CrossCurrencyMethod YieldCurveMethod))+ -- ^ Choice between:+ -- + -- (1) An ISDA defined cash settlement method used for the + -- determination of the applicable cash settlement amount. + -- The method is defined in the 2006 ISDA Definitions, + -- Section 18.3. Cash Settlement Methods, paragraph (a).+ -- + -- (2) An ISDA defined cash settlement method used for the + -- determination of the applicable cash settlement amount. + -- The method is defined in the 2006 ISDA Definitions, + -- Section 18.3. Cash Settlement Methods, paragraph (b).+ -- + -- (3) An ISDA defined cash settlement method used for the + -- determination of the applicable cash settlement amount. + -- The method is defined in the 2006 ISDA Definitions, + -- Section 18.3. Cash Settlement Methods, paragraph (c).+ -- + -- (4) An ISDA defined cash settlement method used for the + -- determination of the applicable cash settlement amount. + -- The method is defined in the 2006 ISDA Definitions, + -- Section 18.3. Cash Settlement Methods, paragraph (d).+ -- + -- (5) An ISDA defined cash settlement method used for the + -- determination of the applicable cash settlement amount. + -- The method is defined in the 2006 ISDA Definitions, + -- Section 18.3. Cash Settlement Methods, paragraph (e).+ -- + -- (6) An ISDA defined cash settlement method used for the + -- determination of the applicable cash settlement amount. + -- The method is defined in the 2006 ISDA Definitions, + -- Section 18.3. Cash Settlement Methods, paragraph (f) + -- (published in Supplement number 23).+ -- + -- (7) An ISDA defined cash settlement method used for the + -- determination of the applicable cash settlement amount. + -- The method is defined in the 2006 ISDA Definitions, + -- Section 18.3. Cash Settlement Methods, paragraph (g) + -- (published in Supplement number 28).+ }+ deriving (Eq,Show)+instance SchemaType CashSettlement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CashSettlement a0)+ `apply` optional (parseSchemaType "cashSettlementValuationTime")+ `apply` optional (parseSchemaType "cashSettlementValuationDate")+ `apply` optional (parseSchemaType "cashSettlementPaymentDate")+ `apply` optional (oneOf' [ ("CashPriceMethod", fmap OneOf7 (parseSchemaType "cashPriceMethod"))+ , ("CashPriceMethod", fmap TwoOf7 (parseSchemaType "cashPriceAlternateMethod"))+ , ("YieldCurveMethod", fmap ThreeOf7 (parseSchemaType "parYieldCurveAdjustedMethod"))+ , ("YieldCurveMethod", fmap FourOf7 (parseSchemaType "zeroCouponYieldAdjustedMethod"))+ , ("YieldCurveMethod", fmap FiveOf7 (parseSchemaType "parYieldCurveUnadjustedMethod"))+ , ("CrossCurrencyMethod", fmap SixOf7 (parseSchemaType "crossCurrencyMethod"))+ , ("YieldCurveMethod", fmap SevenOf7 (parseSchemaType "collateralizedCashPriceMethod"))+ ])+ schemaTypeToXML s x@CashSettlement{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ cashSettl_ID x+ ]+ [ maybe [] (schemaTypeToXML "cashSettlementValuationTime") $ cashSettlement_valuationTime x+ , maybe [] (schemaTypeToXML "cashSettlementValuationDate") $ cashSettlement_valuationDate x+ , maybe [] (schemaTypeToXML "cashSettlementPaymentDate") $ cashSettlement_paymentDate x+ , maybe [] (foldOneOf7 (schemaTypeToXML "cashPriceMethod")+ (schemaTypeToXML "cashPriceAlternateMethod")+ (schemaTypeToXML "parYieldCurveAdjustedMethod")+ (schemaTypeToXML "zeroCouponYieldAdjustedMethod")+ (schemaTypeToXML "parYieldCurveUnadjustedMethod")+ (schemaTypeToXML "crossCurrencyMethod")+ (schemaTypeToXML "collateralizedCashPriceMethod")+ ) $ cashSettl_choice3 x+ ]+ +-- | A type defining the cash settlement payment date(s) as +-- either a set of explicit dates, together with applicable +-- adjustments, or as a date relative to some other (anchor) +-- date, or as any date in a range of contiguous business +-- days.+data CashSettlementPaymentDate = CashSettlementPaymentDate+ { cashSettlPaymentDate_ID :: Maybe Xsd.ID+ , cashSettlPaymentDate_choice0 :: (Maybe (OneOf3 AdjustableDates RelativeDateOffset BusinessDateRange))+ -- ^ Choice between:+ -- + -- (1) A series of dates that shall be subject to adjustment + -- if they would otherwise fall on a day that is not a + -- business day in the specified business centers, + -- together with the convention for adjusting the date.+ -- + -- (2) A date specified as some offset to another date (the + -- anchor date).+ -- + -- (3) A range of contiguous business days.+ }+ deriving (Eq,Show)+instance SchemaType CashSettlementPaymentDate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CashSettlementPaymentDate a0)+ `apply` optional (oneOf' [ ("AdjustableDates", fmap OneOf3 (parseSchemaType "adjustableDates"))+ , ("RelativeDateOffset", fmap TwoOf3 (parseSchemaType "relativeDate"))+ , ("BusinessDateRange", fmap ThreeOf3 (parseSchemaType "businessDateRange"))+ ])+ schemaTypeToXML s x@CashSettlementPaymentDate{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ cashSettlPaymentDate_ID x+ ]+ [ maybe [] (foldOneOf3 (schemaTypeToXML "adjustableDates")+ (schemaTypeToXML "relativeDate")+ (schemaTypeToXML "businessDateRange")+ ) $ cashSettlPaymentDate_choice0 x+ ]+ +data CrossCurrencyMethod = CrossCurrencyMethod+ { crossCurrenMethod_cashSettlementReferenceBanks :: Maybe CashSettlementReferenceBanks+ -- ^ A container for a set of reference institutions. These + -- reference institutions may be called upon to provide rate + -- quotations as part of the method to determine the + -- applicable cash settlement amount. If institutions are not + -- specified, it is assumed that reference institutions will + -- be agreed between the parties on the exercise date, or in + -- the case of swap transaction to which mandatory early + -- termination is applicable, the cash settlement valuation + -- date.+ , crossCurrenMethod_cashSettlementCurrency :: [Currency]+ -- ^ The currency, or currencies, in which the cash settlement + -- amount(s) will be calculated and settled. While the order + -- in which the currencies are stated is unimportant, the cash + -- settlement currency or currencies must correspond to one or + -- both of the constituent currencies of the swap transaction.+ , crossCurrenMethod_quotationRateType :: Maybe QuotationRateTypeEnum+ -- ^ Which rate quote is to be observed, either Bid, Mid, Offer + -- or Exercising Party Pays. The meaning of Exercising Party + -- Pays is defined in the 2000 ISDA Definitions, Section 17.2. + -- Certain Definitions Relating to Cash Settlement, paragraph + -- (j)+ }+ deriving (Eq,Show)+instance SchemaType CrossCurrencyMethod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CrossCurrencyMethod+ `apply` optional (parseSchemaType "cashSettlementReferenceBanks")+ `apply` between (Occurs (Just 0) (Just 2))+ (parseSchemaType "cashSettlementCurrency")+ `apply` optional (parseSchemaType "quotationRateType")+ schemaTypeToXML s x@CrossCurrencyMethod{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "cashSettlementReferenceBanks") $ crossCurrenMethod_cashSettlementReferenceBanks x+ , concatMap (schemaTypeToXML "cashSettlementCurrency") $ crossCurrenMethod_cashSettlementCurrency x+ , maybe [] (schemaTypeToXML "quotationRateType") $ crossCurrenMethod_quotationRateType x+ ]+ +-- | A type to provide the ability to point to multiple payment +-- nodes in the document through the unbounded +-- paymentDatesReference.+data DateRelativeToCalculationPeriodDates = DateRelativeToCalculationPeriodDates+ { drtcpd_calculationPeriodDatesReference :: [CalculationPeriodDatesReference]+ -- ^ A set of href pointers to calculation period dates defined + -- somewhere else in the document.+ }+ deriving (Eq,Show)+instance SchemaType DateRelativeToCalculationPeriodDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DateRelativeToCalculationPeriodDates+ `apply` many (parseSchemaType "calculationPeriodDatesReference")+ schemaTypeToXML s x@DateRelativeToCalculationPeriodDates{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "calculationPeriodDatesReference") $ drtcpd_calculationPeriodDatesReference x+ ]+ +-- | A type to provide the ability to point to multiple payment +-- nodes in the document through the unbounded +-- paymentDatesReference.+data DateRelativeToPaymentDates = DateRelativeToPaymentDates+ { dateRelatToPaymentDates_paymentDatesReference :: [PaymentDatesReference]+ -- ^ A set of href pointers to payment dates defined somewhere + -- else in the document.+ }+ deriving (Eq,Show)+instance SchemaType DateRelativeToPaymentDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DateRelativeToPaymentDates+ `apply` many (parseSchemaType "paymentDatesReference")+ schemaTypeToXML s x@DateRelativeToPaymentDates{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "paymentDatesReference") $ dateRelatToPaymentDates_paymentDatesReference x+ ]+ +-- | A type defining discounting information. The 2000 ISDA +-- definitions, section 8.4. discounting (related to the +-- calculation of a discounted fixed amount or floating +-- amount) apply. This type must only be included if +-- discounting applies.+data Discounting = Discounting+ { discounting_type :: Maybe DiscountingTypeEnum+ -- ^ The discounting method that is applicable.+ , discounting_discountRate :: Maybe Xsd.Decimal+ -- ^ A discount rate, expressed as a decimal, to be used in the + -- calculation of a discounted amount. A discount amount of 5% + -- would be represented as 0.05.+ , discounting_discountRateDayCountFraction :: Maybe DayCountFraction+ -- ^ A discount day count fraction to be used in the calculation + -- of a discounted amount.+ }+ deriving (Eq,Show)+instance SchemaType Discounting where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Discounting+ `apply` optional (parseSchemaType "discountingType")+ `apply` optional (parseSchemaType "discountRate")+ `apply` optional (parseSchemaType "discountRateDayCountFraction")+ schemaTypeToXML s x@Discounting{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "discountingType") $ discounting_type x+ , maybe [] (schemaTypeToXML "discountRate") $ discounting_discountRate x+ , maybe [] (schemaTypeToXML "discountRateDayCountFraction") $ discounting_discountRateDayCountFraction x+ ]+ +-- | A type to define the adjusted dates associated with an +-- early termination provision.+data EarlyTerminationEvent = EarlyTerminationEvent+ { earlyTerminEvent_ID :: Maybe Xsd.ID+ , earlyTerminEvent_adjustedExerciseDate :: Maybe Xsd.Date+ -- ^ The date on which option exercise takes place. This date + -- should already be adjusted for any applicable business day + -- convention.+ , earlyTerminEvent_adjustedEarlyTerminationDate :: Maybe Xsd.Date+ -- ^ The early termination date that is applicable if an early + -- termination provision is exercised. This date should + -- already be adjusted for any applicable business day + -- convention.+ , earlyTerminEvent_adjustedCashSettlementValuationDate :: Maybe Xsd.Date+ -- ^ The date by which the cash settlement amount must be + -- agreed. This date should already be adjusted for any + -- applicable business day convention.+ , earlyTerminEvent_adjustedCashSettlementPaymentDate :: Maybe Xsd.Date+ -- ^ The date on which the cash settlement amount is paid. This + -- date should already be adjusted for any applicable business + -- dat convention.+ , earlyTerminEvent_adjustedExerciseFeePaymentDate :: Maybe Xsd.Date+ -- ^ The date on which the exercise fee amount is paid. This + -- date should already be adjusted for any applicable business + -- day convention.+ }+ deriving (Eq,Show)+instance SchemaType EarlyTerminationEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (EarlyTerminationEvent a0)+ `apply` optional (parseSchemaType "adjustedExerciseDate")+ `apply` optional (parseSchemaType "adjustedEarlyTerminationDate")+ `apply` optional (parseSchemaType "adjustedCashSettlementValuationDate")+ `apply` optional (parseSchemaType "adjustedCashSettlementPaymentDate")+ `apply` optional (parseSchemaType "adjustedExerciseFeePaymentDate")+ schemaTypeToXML s x@EarlyTerminationEvent{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ earlyTerminEvent_ID x+ ]+ [ maybe [] (schemaTypeToXML "adjustedExerciseDate") $ earlyTerminEvent_adjustedExerciseDate x+ , maybe [] (schemaTypeToXML "adjustedEarlyTerminationDate") $ earlyTerminEvent_adjustedEarlyTerminationDate x+ , maybe [] (schemaTypeToXML "adjustedCashSettlementValuationDate") $ earlyTerminEvent_adjustedCashSettlementValuationDate x+ , maybe [] (schemaTypeToXML "adjustedCashSettlementPaymentDate") $ earlyTerminEvent_adjustedCashSettlementPaymentDate x+ , maybe [] (schemaTypeToXML "adjustedExerciseFeePaymentDate") $ earlyTerminEvent_adjustedExerciseFeePaymentDate x+ ]+ +-- | A type defining an early termination provision for a swap. +-- This early termination is at fair value, i.e. on +-- termination the fair value of the product must be settled +-- between the parties.+data EarlyTerminationProvision = EarlyTerminationProvision+ { earlyTerminProvis_ID :: Maybe Xsd.ID+ , earlyTerminProvis_choice0 :: OneOf1 (((Maybe (OneOf1 ((Maybe (Period)),(Maybe (MandatoryEarlyTermination)))))),((Maybe (OneOf1 ((Maybe (ExercisePeriod)),(Maybe (OptionalEarlyTermination)))))))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * unknown+ -- + -- * unknown+ }+ deriving (Eq,Show)+instance SchemaType EarlyTerminationProvision where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (EarlyTerminationProvision a0)+ `apply` oneOf' [ ("(Maybe (OneOf1 ((Maybe (Period)),(Maybe (MandatoryEarlyTermination))))) (Maybe (OneOf1 ((Maybe (ExercisePeriod)),(Maybe (OptionalEarlyTermination)))))", fmap OneOf1 (return (,) `apply` optional (oneOf' [ ("Maybe Period Maybe MandatoryEarlyTermination", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "mandatoryEarlyTerminationDateTenor")+ `apply` optional (parseSchemaType "mandatoryEarlyTermination")))+ ])+ `apply` optional (oneOf' [ ("Maybe ExercisePeriod Maybe OptionalEarlyTermination", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "optionalEarlyTerminationParameters")+ `apply` optional (parseSchemaType "optionalEarlyTermination")))+ ])))+ ]+ schemaTypeToXML s x@EarlyTerminationProvision{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ earlyTerminProvis_ID x+ ]+ [ foldOneOf1 (\ (a,b) -> concat [ maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "mandatoryEarlyTerminationDateTenor") a+ , maybe [] (schemaTypeToXML "mandatoryEarlyTermination") b+ ])+ ) a+ , maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "optionalEarlyTerminationParameters") a+ , maybe [] (schemaTypeToXML "optionalEarlyTermination") b+ ])+ ) b+ ])+ $ earlyTerminProvis_choice0 x+ ]+ +-- | A type defining the adjusted dates associated with a +-- particular exercise event.+data ExerciseEvent = ExerciseEvent+ { exercEvent_ID :: Maybe Xsd.ID+ , exercEvent_adjustedExerciseDate :: Maybe Xsd.Date+ -- ^ The date on which option exercise takes place. This date + -- should already be adjusted for any applicable business day + -- convention.+ , exercEvent_adjustedRelevantSwapEffectiveDate :: Maybe Xsd.Date+ -- ^ The effective date of the underlying swap associated with a + -- given exercise date. This date should already be adjusted + -- for any applicable business day convention.+ , exercEvent_adjustedCashSettlementValuationDate :: Maybe Xsd.Date+ -- ^ The date by which the cash settlement amount must be + -- agreed. This date should already be adjusted for any + -- applicable business day convention.+ , exercEvent_adjustedCashSettlementPaymentDate :: Maybe Xsd.Date+ -- ^ The date on which the cash settlement amount is paid. This + -- date should already be adjusted for any applicable business + -- dat convention.+ , exercEvent_adjustedExerciseFeePaymentDate :: Maybe Xsd.Date+ -- ^ The date on which the exercise fee amount is paid. This + -- date should already be adjusted for any applicable business + -- day convention.+ }+ deriving (Eq,Show)+instance SchemaType ExerciseEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ExerciseEvent a0)+ `apply` optional (parseSchemaType "adjustedExerciseDate")+ `apply` optional (parseSchemaType "adjustedRelevantSwapEffectiveDate")+ `apply` optional (parseSchemaType "adjustedCashSettlementValuationDate")+ `apply` optional (parseSchemaType "adjustedCashSettlementPaymentDate")+ `apply` optional (parseSchemaType "adjustedExerciseFeePaymentDate")+ schemaTypeToXML s x@ExerciseEvent{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ exercEvent_ID x+ ]+ [ maybe [] (schemaTypeToXML "adjustedExerciseDate") $ exercEvent_adjustedExerciseDate x+ , maybe [] (schemaTypeToXML "adjustedRelevantSwapEffectiveDate") $ exercEvent_adjustedRelevantSwapEffectiveDate x+ , maybe [] (schemaTypeToXML "adjustedCashSettlementValuationDate") $ exercEvent_adjustedCashSettlementValuationDate x+ , maybe [] (schemaTypeToXML "adjustedCashSettlementPaymentDate") $ exercEvent_adjustedCashSettlementPaymentDate x+ , maybe [] (schemaTypeToXML "adjustedExerciseFeePaymentDate") $ exercEvent_adjustedExerciseFeePaymentDate x+ ]+ +-- | This defines the time interval to the start of the exercise +-- period, i.e. the earliest exercise date, and the frequency +-- of subsequent exercise dates (if any).+data ExercisePeriod = ExercisePeriod+ { exercPeriod_ID :: Maybe Xsd.ID+ , exercPeriod_earliestExerciseDateTenor :: Maybe Period+ -- ^ The time interval to the first (and possibly only) exercise + -- date in the exercise period.+ , exercPeriod_exerciseFrequency :: Maybe Period+ -- ^ The frequency of subsequent exercise dates in the exercise + -- period following the earliest exercise date. An interval of + -- 1 day should be used to indicate an American style exercise + -- period.+ }+ deriving (Eq,Show)+instance SchemaType ExercisePeriod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ExercisePeriod a0)+ `apply` optional (parseSchemaType "earliestExerciseDateTenor")+ `apply` optional (parseSchemaType "exerciseFrequency")+ schemaTypeToXML s x@ExercisePeriod{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ exercPeriod_ID x+ ]+ [ maybe [] (schemaTypeToXML "earliestExerciseDateTenor") $ exercPeriod_earliestExerciseDateTenor x+ , maybe [] (schemaTypeToXML "exerciseFrequency") $ exercPeriod_exerciseFrequency x+ ]+ +-- | A type defining an option to extend an existing swap +-- transaction on the specified exercise dates for a term +-- ending on the specified new termination date.+data ExtendibleProvision = ExtendibleProvision+ { extendProvis_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , extendProvis_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , extendProvis_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , extendProvis_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , extendProvis_exercise :: Maybe Exercise+ -- ^ An placeholder for the actual option exercise definitions.+ , extendProvis_exerciseNotice :: Maybe ExerciseNotice+ -- ^ Definition of the party to whom notice of exercise should + -- be given.+ , extendProvis_followUpConfirmation :: Maybe Xsd.Boolean+ -- ^ A flag to indicate whether follow-up confirmation of + -- exercise (written or electronic) is required following + -- telephonic notice by the buyer to the seller or seller's + -- agent.+ , extendibleProvision_adjustedDates :: Maybe ExtendibleProvisionAdjustedDates+ -- ^ The adjusted dates associated with an extendible provision. + -- These dates have been adjusted for any applicable business + -- day convention.+ }+ deriving (Eq,Show)+instance SchemaType ExtendibleProvision where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ExtendibleProvision+ `apply` optional (parseSchemaType "buyerPartyReference")+ `apply` optional (parseSchemaType "buyerAccountReference")+ `apply` optional (parseSchemaType "sellerPartyReference")+ `apply` optional (parseSchemaType "sellerAccountReference")+ `apply` optional (elementExercise)+ `apply` optional (parseSchemaType "exerciseNotice")+ `apply` optional (parseSchemaType "followUpConfirmation")+ `apply` optional (parseSchemaType "extendibleProvisionAdjustedDates")+ schemaTypeToXML s x@ExtendibleProvision{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "buyerPartyReference") $ extendProvis_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ extendProvis_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ extendProvis_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ extendProvis_sellerAccountReference x+ , maybe [] (elementToXMLExercise) $ extendProvis_exercise x+ , maybe [] (schemaTypeToXML "exerciseNotice") $ extendProvis_exerciseNotice x+ , maybe [] (schemaTypeToXML "followUpConfirmation") $ extendProvis_followUpConfirmation x+ , maybe [] (schemaTypeToXML "extendibleProvisionAdjustedDates") $ extendibleProvision_adjustedDates x+ ]+ +-- | A type defining the adjusted dates associated with a +-- provision to extend a swap.+data ExtendibleProvisionAdjustedDates = ExtendibleProvisionAdjustedDates+ { extendProvisAdjustDates_extensionEvent :: [ExtensionEvent]+ -- ^ The adjusted dates associated with a single extendible + -- exercise date.+ }+ deriving (Eq,Show)+instance SchemaType ExtendibleProvisionAdjustedDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ExtendibleProvisionAdjustedDates+ `apply` many (parseSchemaType "extensionEvent")+ schemaTypeToXML s x@ExtendibleProvisionAdjustedDates{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "extensionEvent") $ extendProvisAdjustDates_extensionEvent x+ ]+ +-- | A type to define the adjusted dates associated with an +-- individual extension event.+data ExtensionEvent = ExtensionEvent+ { extensEvent_ID :: Maybe Xsd.ID+ , extensEvent_adjustedExerciseDate :: Maybe Xsd.Date+ -- ^ The date on which option exercise takes place. This date + -- should already be adjusted for any applicable business day + -- convention.+ , extensEvent_adjustedExtendedTerminationDate :: Maybe Xsd.Date+ -- ^ The termination date if an extendible provision is + -- exercised. This date should already be adjusted for any + -- applicable business day convention.+ }+ deriving (Eq,Show)+instance SchemaType ExtensionEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ExtensionEvent a0)+ `apply` optional (parseSchemaType "adjustedExerciseDate")+ `apply` optional (parseSchemaType "adjustedExtendedTerminationDate")+ schemaTypeToXML s x@ExtensionEvent{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ extensEvent_ID x+ ]+ [ maybe [] (schemaTypeToXML "adjustedExerciseDate") $ extensEvent_adjustedExerciseDate x+ , maybe [] (schemaTypeToXML "adjustedExtendedTerminationDate") $ extensEvent_adjustedExtendedTerminationDate x+ ]+ +-- | A type to define business date convention adjustment to +-- final payment period per leg.+data FinalCalculationPeriodDateAdjustment = FinalCalculationPeriodDateAdjustment+ { fcpda_relevantUnderlyingDateReference :: Maybe RelevantUnderlyingDateReference+ -- ^ Reference to the unadjusted cancellation effective dates.+ , fcpda_swapStreamReference :: InterestRateStreamReference+ -- ^ Reference to the leg, where date adjustments may apply.+ , fcpda_businessDayConvention :: Maybe BusinessDayConventionEnum+ -- ^ Override business date convention. This takes precedence + -- over leg level information.+ }+ deriving (Eq,Show)+instance SchemaType FinalCalculationPeriodDateAdjustment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FinalCalculationPeriodDateAdjustment+ `apply` optional (parseSchemaType "relevantUnderlyingDateReference")+ `apply` parseSchemaType "swapStreamReference"+ `apply` optional (parseSchemaType "businessDayConvention")+ schemaTypeToXML s x@FinalCalculationPeriodDateAdjustment{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "relevantUnderlyingDateReference") $ fcpda_relevantUnderlyingDateReference x+ , schemaTypeToXML "swapStreamReference" $ fcpda_swapStreamReference x+ , maybe [] (schemaTypeToXML "businessDayConvention") $ fcpda_businessDayConvention x+ ]+ +-- | The method, prioritzed by the order it is listed in this +-- element, to get a replacement rate for the disrupted +-- settlement rate option.+data FallbackReferencePrice = FallbackReferencePrice+ { fallbRefPrice_valuationPostponement :: Maybe ValuationPostponement+ -- ^ Specifies how long to wait to get a quote from a settlement + -- rate option upon a price source disruption+ , fallbRefPrice_fallbackSettlementRateOption :: [SettlementRateOption]+ -- ^ This settlement rate option will be used in its place.+ , fallbRefPrice_fallbackSurveyValuationPostponenment :: Maybe Empty+ -- ^ Request rate quotes from the market.+ , fallbRefPrice_calculationAgentDetermination :: Maybe CalculationAgent+ -- ^ The calculation agent will decide the rate.+ }+ deriving (Eq,Show)+instance SchemaType FallbackReferencePrice where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FallbackReferencePrice+ `apply` optional (parseSchemaType "valuationPostponement")+ `apply` many (parseSchemaType "fallbackSettlementRateOption")+ `apply` optional (parseSchemaType "fallbackSurveyValuationPostponenment")+ `apply` optional (parseSchemaType "calculationAgentDetermination")+ schemaTypeToXML s x@FallbackReferencePrice{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "valuationPostponement") $ fallbRefPrice_valuationPostponement x+ , concatMap (schemaTypeToXML "fallbackSettlementRateOption") $ fallbRefPrice_fallbackSettlementRateOption x+ , maybe [] (schemaTypeToXML "fallbackSurveyValuationPostponenment") $ fallbRefPrice_fallbackSurveyValuationPostponenment x+ , maybe [] (schemaTypeToXML "calculationAgentDetermination") $ fallbRefPrice_calculationAgentDetermination x+ ]+ +-- | A type defining parameters associated with a floating rate +-- reset. This type forms part of the cashflows representation +-- of a stream.+data FloatingRateDefinition = FloatingRateDefinition+ { floatRateDefin_calculatedRate :: Maybe Xsd.Decimal+ -- ^ The final calculated rate for a calculation period after + -- any required averaging of rates A calculated rate of 5% + -- would be represented as 0.05.+ , floatRateDefin_rateObservation :: [RateObservation]+ -- ^ The details of a particular rate observation, including the + -- fixing date and observed rate. A list of rate observation + -- elements may be ordered in the document by ascending + -- adjusted fixing date. An FpML document containing an + -- unordered list of rate observations is still regarded as a + -- conformant document.+ , floatRateDefin_floatingRateMultiplier :: Maybe Xsd.Decimal+ -- ^ A rate multiplier to apply to the floating rate. The + -- multiplier can be a positive or negative decimal. This + -- element should only be included if the multiplier is not + -- equal to 1 (one).+ , floatRateDefin_spread :: Maybe Xsd.Decimal+ -- ^ The ISDA Spread, if any, which applies for the calculation + -- period. The spread is a per annum rate, expressed as a + -- decimal. For purposes of determining a calculation period + -- amount, if positive the spread will be added to the + -- floating rate and if negative the spread will be subtracted + -- from the floating rate. A positive 10 basis point (0.1%) + -- spread would be represented as 0.001.+ , floatRateDefin_capRate :: [Strike]+ -- ^ The cap rate, if any, which applies to the floating rate + -- for the calculation period. The cap rate (strike) is only + -- required where the floating rate on a swap stream is capped + -- at a certain strike level. The cap rate is assumed to be + -- exclusive of any spread and is a per annum rate, expressed + -- as a decimal. A cap rate of 5% would be represented as + -- 0.05.+ , floatRateDefin_floorRate :: [Strike]+ -- ^ The floor rate, if any, which applies to the floating rate + -- for the calculation period. The floor rate (strike) is only + -- required where the floating rate on a swap stream is + -- floored at a certain strike level. The floor rate is + -- assumed to be exclusive of any spread and is a per annum + -- rate, expressed as a decimal. The floor rate of 5% would be + -- represented as 0.05.+ }+ deriving (Eq,Show)+instance SchemaType FloatingRateDefinition where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FloatingRateDefinition+ `apply` optional (parseSchemaType "calculatedRate")+ `apply` many (parseSchemaType "rateObservation")+ `apply` optional (parseSchemaType "floatingRateMultiplier")+ `apply` optional (parseSchemaType "spread")+ `apply` many (parseSchemaType "capRate")+ `apply` many (parseSchemaType "floorRate")+ schemaTypeToXML s x@FloatingRateDefinition{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "calculatedRate") $ floatRateDefin_calculatedRate x+ , concatMap (schemaTypeToXML "rateObservation") $ floatRateDefin_rateObservation x+ , maybe [] (schemaTypeToXML "floatingRateMultiplier") $ floatRateDefin_floatingRateMultiplier x+ , maybe [] (schemaTypeToXML "spread") $ floatRateDefin_spread x+ , concatMap (schemaTypeToXML "capRate") $ floatRateDefin_capRate x+ , concatMap (schemaTypeToXML "floorRate") $ floatRateDefin_floorRate x+ ]+ +-- | A type defining a Forward Rate Agreement (FRA) product.+data Fra = Fra+ { fra_ID :: Maybe Xsd.ID+ , fra_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , fra_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , fra_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , fra_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , fra_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , fra_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , fra_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , fra_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , fra_adjustedEffectiveDate :: RequiredIdentifierDate+ -- ^ The start date of the calculation period. This date should + -- already be adjusted for any applicable business day + -- convention. This is also the date when the observed rate is + -- applied, the reset date.+ , fra_adjustedTerminationDate :: Xsd.Date+ -- ^ The end date of the calculation period. This date should + -- already be adjusted for any applicable business day + -- convention.+ , fra_paymentDate :: Maybe AdjustableDate+ -- ^ The payment date. This date is subject to adjustment in + -- accordance with any applicable business day convention.+ , fra_fixingDateOffset :: Maybe RelativeDateOffset+ -- ^ Specifies the fixing date relative to the reset date in + -- terms of a business days offset and an associated set of + -- financial business centers. Normally these offset + -- calculation rules will be those specified in the ISDA + -- definition for the relevant floating rate index (ISDA's + -- Floating Rate Option). However, non-standard offset + -- calculation rules may apply for a trade if mutually agreed + -- by the principal parties to the transaction. The href + -- attribute on the dateRelativeTo element should reference + -- the id attribute on the adjustedEffectiveDate element.+ , fra_dayCountFraction :: DayCountFraction+ -- ^ The day count fraction.+ , fra_calculationPeriodNumberOfDays :: Maybe Xsd.PositiveInteger+ -- ^ The number of days from the adjusted effective date to the + -- adjusted termination date calculated in accordance with the + -- applicable day count fraction.+ , fra_notional :: Money+ -- ^ The notional amount.+ , fra_fixedRate :: Xsd.Decimal+ -- ^ The calculation period fixed rate. A per annum rate, + -- expressed as a decimal. A fixed rate of 5% would be + -- represented as 0.05.+ , fra_floatingRateIndex :: FloatingRateIndex+ , fra_indexTenor :: [Period]+ -- ^ The ISDA Designated Maturity, i.e. the tenor of the + -- floating rate.+ , fra_discounting :: Maybe FraDiscountingEnum+ -- ^ Specifies whether discounting applies and, if so, what + -- type.+ }+ deriving (Eq,Show)+instance SchemaType Fra where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Fra a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` optional (parseSchemaType "buyerPartyReference")+ `apply` optional (parseSchemaType "buyerAccountReference")+ `apply` optional (parseSchemaType "sellerPartyReference")+ `apply` optional (parseSchemaType "sellerAccountReference")+ `apply` parseSchemaType "adjustedEffectiveDate"+ `apply` parseSchemaType "adjustedTerminationDate"+ `apply` optional (parseSchemaType "paymentDate")+ `apply` optional (parseSchemaType "fixingDateOffset")+ `apply` parseSchemaType "dayCountFraction"+ `apply` optional (parseSchemaType "calculationPeriodNumberOfDays")+ `apply` parseSchemaType "notional"+ `apply` parseSchemaType "fixedRate"+ `apply` parseSchemaType "floatingRateIndex"+ `apply` many1 (parseSchemaType "indexTenor")+ `apply` optional (parseSchemaType "fraDiscounting")+ schemaTypeToXML s x@Fra{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fra_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ fra_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ fra_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ fra_productType x+ , concatMap (schemaTypeToXML "productId") $ fra_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ fra_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ fra_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ fra_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ fra_sellerAccountReference x+ , schemaTypeToXML "adjustedEffectiveDate" $ fra_adjustedEffectiveDate x+ , schemaTypeToXML "adjustedTerminationDate" $ fra_adjustedTerminationDate x+ , maybe [] (schemaTypeToXML "paymentDate") $ fra_paymentDate x+ , maybe [] (schemaTypeToXML "fixingDateOffset") $ fra_fixingDateOffset x+ , schemaTypeToXML "dayCountFraction" $ fra_dayCountFraction x+ , maybe [] (schemaTypeToXML "calculationPeriodNumberOfDays") $ fra_calculationPeriodNumberOfDays x+ , schemaTypeToXML "notional" $ fra_notional x+ , schemaTypeToXML "fixedRate" $ fra_fixedRate x+ , schemaTypeToXML "floatingRateIndex" $ fra_floatingRateIndex x+ , concatMap (schemaTypeToXML "indexTenor") $ fra_indexTenor x+ , maybe [] (schemaTypeToXML "fraDiscounting") $ fra_discounting x+ ]+instance Extension Fra Product where+ supertype v = Product_Fra v+ +-- | A type that is extending the Offset structure for providing +-- the ability to specify an FX fixing date as an offset to +-- dates specified somewhere else in the document.+data FxFixingDate = FxFixingDate+ { fxFixingDate_ID :: Maybe Xsd.ID+ , fxFixingDate_periodMultiplier :: Xsd.Integer+ -- ^ A time period multiplier, e.g. 1, 2 or 3 etc. A negative + -- value can be used when specifying an offset relative to + -- another date, e.g. -2 days.+ , fxFixingDate_period :: PeriodEnum+ -- ^ A time period, e.g. a day, week, month or year of the + -- stream. If the periodMultiplier value is 0 (zero) then + -- period must contain the value D (day).+ , fxFixingDate_dayType :: Maybe DayTypeEnum+ -- ^ In the case of an offset specified as a number of days, + -- this element defines whether consideration is given as to + -- whether a day is a good business day or not. If a day type + -- of business days is specified then non-business days are + -- ignored when calculating the offset. The financial business + -- centers to use for determination of business days are + -- implied by the context in which this element is used. This + -- element must only be included when the offset is specified + -- as a number of days. If the offset is zero days then the + -- dayType element should not be included.+ , fxFixingDate_businessDayConvention :: Maybe BusinessDayConventionEnum+ -- ^ The convention for adjusting a date if it would otherwise + -- fall on a day that is not a business day.+ , fxFixingDate_choice4 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to a set of financial + -- business centers defined elsewhere in the document. + -- This set of business centers is used to determine + -- whether a particular day is a business day or not.+ -- + -- (2) businessCenters+ , fxFixingDate_choice5 :: (Maybe (OneOf2 DateRelativeToPaymentDates DateRelativeToCalculationPeriodDates))+ -- ^ Choice between:+ -- + -- (1) The payment date references on which settlements in + -- non-deliverable currency are due and will then have to + -- be converted according to the terms specified through + -- the other parts of the nonDeliverableSettlement + -- structure.+ -- + -- (2) The calculation period references on which settlements + -- in non-deliverable currency are due and will then have + -- to be converted according to the terms specified + -- through the other parts of the nonDeliverableSettlement + -- structure. Implemented for Brazilian-CDI swaps where it + -- will refer to the termination date of the appropriate + -- leg.+ }+ deriving (Eq,Show)+instance SchemaType FxFixingDate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FxFixingDate a0)+ `apply` parseSchemaType "periodMultiplier"+ `apply` parseSchemaType "period"+ `apply` optional (parseSchemaType "dayType")+ `apply` optional (parseSchemaType "businessDayConvention")+ `apply` optional (oneOf' [ ("BusinessCentersReference", fmap OneOf2 (parseSchemaType "businessCentersReference"))+ , ("BusinessCenters", fmap TwoOf2 (parseSchemaType "businessCenters"))+ ])+ `apply` optional (oneOf' [ ("DateRelativeToPaymentDates", fmap OneOf2 (parseSchemaType "dateRelativeToPaymentDates"))+ , ("DateRelativeToCalculationPeriodDates", fmap TwoOf2 (parseSchemaType "dateRelativeToCalculationPeriodDates"))+ ])+ schemaTypeToXML s x@FxFixingDate{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxFixingDate_ID x+ ]+ [ schemaTypeToXML "periodMultiplier" $ fxFixingDate_periodMultiplier x+ , schemaTypeToXML "period" $ fxFixingDate_period x+ , maybe [] (schemaTypeToXML "dayType") $ fxFixingDate_dayType x+ , maybe [] (schemaTypeToXML "businessDayConvention") $ fxFixingDate_businessDayConvention x+ , maybe [] (foldOneOf2 (schemaTypeToXML "businessCentersReference")+ (schemaTypeToXML "businessCenters")+ ) $ fxFixingDate_choice4 x+ , maybe [] (foldOneOf2 (schemaTypeToXML "dateRelativeToPaymentDates")+ (schemaTypeToXML "dateRelativeToCalculationPeriodDates")+ ) $ fxFixingDate_choice5 x+ ]+instance Extension FxFixingDate Offset where+ supertype (FxFixingDate a0 e0 e1 e2 e3 e4 e5) =+ Offset a0 e0 e1 e2+instance Extension FxFixingDate Period where+ supertype = (supertype :: Offset -> Period)+ . (supertype :: FxFixingDate -> Offset)+ + +-- | A type to describe the cashflow representation for fx +-- linked notionals.+data FxLinkedNotionalAmount = FxLinkedNotionalAmount+ { fxLinkedNotionAmount_resetDate :: Maybe Xsd.Date+ , fxLinkedNotionAmount_adjustedFxSpotFixingDate :: Maybe Xsd.Date+ -- ^ The date on which the fx spot rate is observed. This date + -- should already be adjusted for any applicable business day + -- convention.+ , fxLinkedNotionAmount_observedFxSpotRate :: Maybe Xsd.Decimal+ -- ^ The actual observed fx spot rate.+ , fxLinkedNotionAmount_notionalAmount :: Maybe Xsd.Decimal+ -- ^ The calculation period notional amount.+ }+ deriving (Eq,Show)+instance SchemaType FxLinkedNotionalAmount where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxLinkedNotionalAmount+ `apply` optional (parseSchemaType "resetDate")+ `apply` optional (parseSchemaType "adjustedFxSpotFixingDate")+ `apply` optional (parseSchemaType "observedFxSpotRate")+ `apply` optional (parseSchemaType "notionalAmount")+ schemaTypeToXML s x@FxLinkedNotionalAmount{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "resetDate") $ fxLinkedNotionAmount_resetDate x+ , maybe [] (schemaTypeToXML "adjustedFxSpotFixingDate") $ fxLinkedNotionAmount_adjustedFxSpotFixingDate x+ , maybe [] (schemaTypeToXML "observedFxSpotRate") $ fxLinkedNotionAmount_observedFxSpotRate x+ , maybe [] (schemaTypeToXML "notionalAmount") $ fxLinkedNotionAmount_notionalAmount x+ ]+ +-- | A type to describe a notional schedule where each notional +-- that applies to a calculation period is calculated with +-- reference to a notional amount or notional amount schedule +-- in a different currency by means of a spot currency +-- exchange rate which is normally observed at the beginning +-- of each period.+data FxLinkedNotionalSchedule = FxLinkedNotionalSchedule+ { fxLinkedNotionSched_constantNotionalScheduleReference :: Maybe NotionalReference+ -- ^ A pointer style reference to the associated constant + -- notional schedule defined elsewhere in the document which + -- contains the currency amounts which will be converted into + -- the varying notional currency amounts using the spot + -- currency exchange rate.+ , fxLinkedNotionSched_initialValue :: Maybe Xsd.Decimal+ -- ^ The initial currency amount for the varying notional.+ , fxLinkedNotionSched_varyingNotionalCurrency :: Maybe Currency+ -- ^ The currency of the varying notional amount, i.e. the + -- notional amount being determined periodically based on + -- observation of a spot currency exchange rate.+ , fxLinkedNotionSched_varyingNotionalFixingDates :: Maybe RelativeDateOffset+ -- ^ The dates on which spot currency exchange rates are + -- observed for purposes of determining the varying notional + -- currency amount that will apply to a calculation period.+ , fxLinkedNotionSched_fxSpotRateSource :: Maybe FxSpotRateSource+ -- ^ The information source and time at which the spot currency + -- exchange rate will be observed.+ , fxLinkedNotionSched_varyingNotionalInterimExchangePaymentDates :: Maybe RelativeDateOffset+ -- ^ The dates on which interim exchanges of notional are paid. + -- Interim exchanges will arise as a result of changes in the + -- spot currency exchange amount or changes in the constant + -- notional schedule (e.g. amortization).+ }+ deriving (Eq,Show)+instance SchemaType FxLinkedNotionalSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxLinkedNotionalSchedule+ `apply` optional (parseSchemaType "constantNotionalScheduleReference")+ `apply` optional (parseSchemaType "initialValue")+ `apply` optional (parseSchemaType "varyingNotionalCurrency")+ `apply` optional (parseSchemaType "varyingNotionalFixingDates")+ `apply` optional (parseSchemaType "fxSpotRateSource")+ `apply` optional (parseSchemaType "varyingNotionalInterimExchangePaymentDates")+ schemaTypeToXML s x@FxLinkedNotionalSchedule{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "constantNotionalScheduleReference") $ fxLinkedNotionSched_constantNotionalScheduleReference x+ , maybe [] (schemaTypeToXML "initialValue") $ fxLinkedNotionSched_initialValue x+ , maybe [] (schemaTypeToXML "varyingNotionalCurrency") $ fxLinkedNotionSched_varyingNotionalCurrency x+ , maybe [] (schemaTypeToXML "varyingNotionalFixingDates") $ fxLinkedNotionSched_varyingNotionalFixingDates x+ , maybe [] (schemaTypeToXML "fxSpotRateSource") $ fxLinkedNotionSched_fxSpotRateSource x+ , maybe [] (schemaTypeToXML "varyingNotionalInterimExchangePaymentDates") $ fxLinkedNotionSched_varyingNotionalInterimExchangePaymentDates x+ ]+ +-- | A type defining the components specifiying an Inflation +-- Rate Calculation+data InflationRateCalculation = InflationRateCalculation+ { inflatRateCalc_ID :: Maybe Xsd.ID+ , inflatRateCalc_floatingRateIndex :: FloatingRateIndex+ , inflatRateCalc_indexTenor :: Maybe Period+ -- ^ The ISDA Designated Maturity, i.e. the tenor of the + -- floating rate.+ , inflatRateCalc_floatingRateMultiplierSchedule :: Maybe Schedule+ -- ^ A rate multiplier or multiplier schedule to apply to the + -- floating rate. A multiplier schedule is expressed as + -- explicit multipliers and dates. In the case of a schedule, + -- the step dates may be subject to adjustment in accordance + -- with any adjustments specified in the + -- calculationPeriodDatesAdjustments. The multiplier can be a + -- positive or negative decimal. This element should only be + -- included if the multiplier is not equal to 1 (one) for the + -- term of the stream.+ , inflatRateCalc_spreadSchedule :: [SpreadSchedule]+ -- ^ The ISDA Spread or a Spread schedule expressed as explicit + -- spreads and dates. In the case of a schedule, the step + -- dates may be subject to adjustment in accordance with any + -- adjustments specified in calculationPeriodDatesAdjustments. + -- The spread is a per annum rate, expressed as a decimal. For + -- purposes of determining a calculation period amount, if + -- positive the spread will be added to the floating rate and + -- if negative the spread will be subtracted from the floating + -- rate. A positive 10 basis point (0.1%) spread would be + -- represented as 0.001.+ , inflatRateCalc_rateTreatment :: Maybe RateTreatmentEnum+ -- ^ The specification of any rate conversion which needs to be + -- applied to the observed rate before being used in any + -- calculations. The two common conversions are for securities + -- quoted on a bank discount basis which will need to be + -- converted to either a Money Market Yield or Bond Equivalent + -- Yield. See the Annex to the 2000 ISDA Definitions, Section + -- 7.3. Certain General Definitions Relating to Floating Rate + -- Options, paragraphs (g) and (h) for definitions of these + -- terms.+ , inflatRateCalc_capRateSchedule :: [StrikeSchedule]+ -- ^ The cap rate or cap rate schedule, if any, which applies to + -- the floating rate. The cap rate (strike) is only required + -- where the floating rate on a swap stream is capped at a + -- certain level. A cap rate schedule is expressed as explicit + -- cap rates and dates and the step dates may be subject to + -- adjustment in accordance with any adjustments specified in + -- calculationPeriodDatesAdjustments. The cap rate is assumed + -- to be exclusive of any spread and is a per annum rate, + -- expressed as a decimal. A cap rate of 5% would be + -- represented as 0.05.+ , inflatRateCalc_floorRateSchedule :: [StrikeSchedule]+ -- ^ The floor rate or floor rate schedule, if any, which + -- applies to the floating rate. The floor rate (strike) is + -- only required where the floating rate on a swap stream is + -- floored at a certain strike level. A floor rate schedule is + -- expressed as explicit floor rates and dates and the step + -- dates may be subject to adjustment in accordance with any + -- adjustments specified in calculationPeriodDatesAdjustments. + -- The floor rate is assumed to be exclusive of any spread and + -- is a per annum rate, expressed as a decimal. A floor rate + -- of 5% would be represented as 0.05.+ , inflatRateCalc_initialRate :: Maybe Xsd.Decimal+ -- ^ The initial floating rate reset agreed between the + -- principal parties involved in the trade. This is assumed to + -- be the first required reset rate for the first regular + -- calculation period. It should only be included when the + -- rate is not equal to the rate published on the source + -- implied by the floating rate index. An initial rate of 5% + -- would be represented as 0.05.+ , inflatRateCalc_finalRateRounding :: Maybe Rounding+ -- ^ The rounding convention to apply to the final rate used in + -- determination of a calculation period amount.+ , inflatRateCalc_averagingMethod :: Maybe AveragingMethodEnum+ -- ^ If averaging is applicable, this component specifies + -- whether a weighted or unweighted average method of + -- calculation is to be used. The component must only be + -- included when averaging applies.+ , inflatRateCalc_negativeInterestRateTreatment :: Maybe NegativeInterestRateTreatmentEnum+ -- ^ The specification of any provisions for calculating payment + -- obligations when a floating rate is negative (either due to + -- a quoted negative floating rate or by operation of a spread + -- that is subtracted from the floating rate).+ , inflatRateCalc_inflationLag :: Maybe Offset+ -- ^ an offsetting period from the payment date which determines + -- the reference period for which the inflation index is + -- onserved.+ , inflatRateCalc_indexSource :: Maybe RateSourcePage+ -- ^ The reference source such as Reuters or Bloomberg.+ , inflatRateCalc_mainPublication :: Maybe MainPublication+ -- ^ The current main publication source such as relevant web + -- site or a government body.+ , inflatRateCalc_interpolationMethod :: Maybe InterpolationMethod+ -- ^ The method used when calculating the Inflation Index Level + -- from multiple points - the most common is Linear.+ , inflatRateCalc_initialIndexLevel :: Maybe Xsd.Decimal+ -- ^ initial known index level for the first calculation period.+ , inflatRateCalc_fallbackBondApplicable :: Maybe Xsd.Boolean+ -- ^ The applicability of a fallback bond as defined in the 2006 + -- ISDA Inflation Derivatives Definitions, sections 1.3 and + -- 1.8. Omission of this element imples a value of true.+ }+ deriving (Eq,Show)+instance SchemaType InflationRateCalculation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (InflationRateCalculation a0)+ `apply` parseSchemaType "floatingRateIndex"+ `apply` optional (parseSchemaType "indexTenor")+ `apply` optional (parseSchemaType "floatingRateMultiplierSchedule")+ `apply` many (parseSchemaType "spreadSchedule")+ `apply` optional (parseSchemaType "rateTreatment")+ `apply` many (parseSchemaType "capRateSchedule")+ `apply` many (parseSchemaType "floorRateSchedule")+ `apply` optional (parseSchemaType "initialRate")+ `apply` optional (parseSchemaType "finalRateRounding")+ `apply` optional (parseSchemaType "averagingMethod")+ `apply` optional (parseSchemaType "negativeInterestRateTreatment")+ `apply` optional (parseSchemaType "inflationLag")+ `apply` optional (parseSchemaType "indexSource")+ `apply` optional (parseSchemaType "mainPublication")+ `apply` optional (parseSchemaType "interpolationMethod")+ `apply` optional (parseSchemaType "initialIndexLevel")+ `apply` optional (parseSchemaType "fallbackBondApplicable")+ schemaTypeToXML s x@InflationRateCalculation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ inflatRateCalc_ID x+ ]+ [ schemaTypeToXML "floatingRateIndex" $ inflatRateCalc_floatingRateIndex x+ , maybe [] (schemaTypeToXML "indexTenor") $ inflatRateCalc_indexTenor x+ , maybe [] (schemaTypeToXML "floatingRateMultiplierSchedule") $ inflatRateCalc_floatingRateMultiplierSchedule x+ , concatMap (schemaTypeToXML "spreadSchedule") $ inflatRateCalc_spreadSchedule x+ , maybe [] (schemaTypeToXML "rateTreatment") $ inflatRateCalc_rateTreatment x+ , concatMap (schemaTypeToXML "capRateSchedule") $ inflatRateCalc_capRateSchedule x+ , concatMap (schemaTypeToXML "floorRateSchedule") $ inflatRateCalc_floorRateSchedule x+ , maybe [] (schemaTypeToXML "initialRate") $ inflatRateCalc_initialRate x+ , maybe [] (schemaTypeToXML "finalRateRounding") $ inflatRateCalc_finalRateRounding x+ , maybe [] (schemaTypeToXML "averagingMethod") $ inflatRateCalc_averagingMethod x+ , maybe [] (schemaTypeToXML "negativeInterestRateTreatment") $ inflatRateCalc_negativeInterestRateTreatment x+ , maybe [] (schemaTypeToXML "inflationLag") $ inflatRateCalc_inflationLag x+ , maybe [] (schemaTypeToXML "indexSource") $ inflatRateCalc_indexSource x+ , maybe [] (schemaTypeToXML "mainPublication") $ inflatRateCalc_mainPublication x+ , maybe [] (schemaTypeToXML "interpolationMethod") $ inflatRateCalc_interpolationMethod x+ , maybe [] (schemaTypeToXML "initialIndexLevel") $ inflatRateCalc_initialIndexLevel x+ , maybe [] (schemaTypeToXML "fallbackBondApplicable") $ inflatRateCalc_fallbackBondApplicable x+ ]+instance Extension InflationRateCalculation FloatingRateCalculation where+ supertype (InflationRateCalculation a0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14 e15 e16) =+ FloatingRateCalculation a0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10+instance Extension InflationRateCalculation FloatingRate where+ supertype = (supertype :: FloatingRateCalculation -> FloatingRate)+ . (supertype :: InflationRateCalculation -> FloatingRateCalculation)+ +instance Extension InflationRateCalculation Rate where+ supertype = (supertype :: FloatingRate -> Rate)+ . (supertype :: FloatingRateCalculation -> FloatingRate)+ . (supertype :: InflationRateCalculation -> FloatingRateCalculation)+ + +-- | A type defining the components specifiying an interest rate +-- stream, including both a parametric and cashflow +-- representation for the stream of payments.+data InterestRateStream = InterestRateStream+ { interRateStream_ID :: Maybe Xsd.ID+ , interRateStream_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , interRateStream_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , interRateStream_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , interRateStream_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , interRateStream_calculationPeriodDates :: CalculationPeriodDates+ -- ^ The calculation periods dates schedule.+ , interRateStream_paymentDates :: PaymentDates+ -- ^ The payment dates schedule.+ , interRateStream_resetDates :: Maybe ResetDates+ -- ^ The reset dates schedule. The reset dates schedule only + -- applies for a floating rate stream.+ , interRateStream_calculationPeriodAmount :: CalculationPeriodAmount+ -- ^ The calculation period amount parameters.+ , interRateStream_stubCalculationPeriodAmount :: Maybe StubCalculationPeriodAmount+ -- ^ The stub calculation period amount parameters. This element + -- must only be included if there is an initial or final stub + -- calculation period. Even then, it must only be included if + -- either the stub references a different floating rate tenor + -- to the regular calculation periods, or if the stub is + -- calculated as a linear interpolation of two different + -- floating rate tenors, or if a specific stub rate or stub + -- amount has been negotiated.+ , interRateStream_principalExchanges :: Maybe PrincipalExchanges+ -- ^ The true/false flags indicating whether initial, + -- intermediate or final exchanges of principal should occur.+ , interRateStream_cashflows :: Maybe Cashflows+ -- ^ The cashflows representation of the swap stream.+ , interRateStream_settlementProvision :: Maybe SettlementProvision+ -- ^ A provision that allows the specification of settlement + -- terms, occuring when the settlement currency is different + -- to the notional currency of the trade.+ , interRateStream_formula :: Maybe Formula+ -- ^ An interest rate derivative formula.+ }+ deriving (Eq,Show)+instance SchemaType InterestRateStream where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (InterestRateStream a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` parseSchemaType "calculationPeriodDates"+ `apply` parseSchemaType "paymentDates"+ `apply` optional (parseSchemaType "resetDates")+ `apply` parseSchemaType "calculationPeriodAmount"+ `apply` optional (parseSchemaType "stubCalculationPeriodAmount")+ `apply` optional (parseSchemaType "principalExchanges")+ `apply` optional (parseSchemaType "cashflows")+ `apply` optional (parseSchemaType "settlementProvision")+ `apply` optional (parseSchemaType "formula")+ schemaTypeToXML s x@InterestRateStream{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ interRateStream_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ interRateStream_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ interRateStream_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ interRateStream_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ interRateStream_receiverAccountReference x+ , schemaTypeToXML "calculationPeriodDates" $ interRateStream_calculationPeriodDates x+ , schemaTypeToXML "paymentDates" $ interRateStream_paymentDates x+ , maybe [] (schemaTypeToXML "resetDates") $ interRateStream_resetDates x+ , schemaTypeToXML "calculationPeriodAmount" $ interRateStream_calculationPeriodAmount x+ , maybe [] (schemaTypeToXML "stubCalculationPeriodAmount") $ interRateStream_stubCalculationPeriodAmount x+ , maybe [] (schemaTypeToXML "principalExchanges") $ interRateStream_principalExchanges x+ , maybe [] (schemaTypeToXML "cashflows") $ interRateStream_cashflows x+ , maybe [] (schemaTypeToXML "settlementProvision") $ interRateStream_settlementProvision x+ , maybe [] (schemaTypeToXML "formula") $ interRateStream_formula x+ ]+instance Extension InterestRateStream Leg where+ supertype v = Leg_InterestRateStream v+ +-- | Reference to an InterestRateStream component.+data InterestRateStreamReference = InterestRateStreamReference+ { interRateStreamRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType InterestRateStreamReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (InterestRateStreamReference a0)+ schemaTypeToXML s x@InterestRateStreamReference{} =+ toXMLElement s [ toXMLAttribute "href" $ interRateStreamRef_href x+ ]+ []+instance Extension InterestRateStreamReference Reference where+ supertype v = Reference_InterestRateStreamReference v+ +-- | A type to define an early termination provision for which +-- exercise is mandatory.+data MandatoryEarlyTermination = MandatoryEarlyTermination+ { mandatEarlyTermin_ID :: Maybe Xsd.ID+ , mandatoryEarlyTermination_date :: Maybe AdjustableDate+ -- ^ The early termination date associated with a mandatory + -- early termination of a swap.+ , mandatEarlyTermin_calculationAgent :: Maybe CalculationAgent+ -- ^ The ISDA Calculation Agent responsible for performing + -- duties associated with an optional early termination.+ , mandatEarlyTermin_cashSettlement :: Maybe CashSettlement+ -- ^ If specified, this means that cash settlement is applicable + -- to the transaction and defines the parameters associated + -- with the cash settlement prodcedure. If not specified, then + -- physical settlement is applicable.+ , mandatoryEarlyTermination_adjustedDates :: Maybe MandatoryEarlyTerminationAdjustedDates+ -- ^ The adjusted dates associated with a mandatory early + -- termination provision. These dates have been adjusted for + -- any applicable business day convention.+ }+ deriving (Eq,Show)+instance SchemaType MandatoryEarlyTermination where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (MandatoryEarlyTermination a0)+ `apply` optional (parseSchemaType "mandatoryEarlyTerminationDate")+ `apply` optional (parseSchemaType "calculationAgent")+ `apply` optional (parseSchemaType "cashSettlement")+ `apply` optional (parseSchemaType "mandatoryEarlyTerminationAdjustedDates")+ schemaTypeToXML s x@MandatoryEarlyTermination{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ mandatEarlyTermin_ID x+ ]+ [ maybe [] (schemaTypeToXML "mandatoryEarlyTerminationDate") $ mandatoryEarlyTermination_date x+ , maybe [] (schemaTypeToXML "calculationAgent") $ mandatEarlyTermin_calculationAgent x+ , maybe [] (schemaTypeToXML "cashSettlement") $ mandatEarlyTermin_cashSettlement x+ , maybe [] (schemaTypeToXML "mandatoryEarlyTerminationAdjustedDates") $ mandatoryEarlyTermination_adjustedDates x+ ]+ +-- | A type defining the adjusted dates associated with a +-- mandatory early termination provision.+data MandatoryEarlyTerminationAdjustedDates = MandatoryEarlyTerminationAdjustedDates+ { metad_adjustedEarlyTerminationDate :: Maybe Xsd.Date+ -- ^ The early termination date that is applicable if an early + -- termination provision is exercised. This date should + -- already be adjusted for any applicable business day + -- convention.+ , metad_adjustedCashSettlementValuationDate :: Maybe Xsd.Date+ -- ^ The date by which the cash settlement amount must be + -- agreed. This date should already be adjusted for any + -- applicable business day convention.+ , metad_adjustedCashSettlementPaymentDate :: Maybe Xsd.Date+ -- ^ The date on which the cash settlement amount is paid. This + -- date should already be adjusted for any applicable business + -- dat convention.+ }+ deriving (Eq,Show)+instance SchemaType MandatoryEarlyTerminationAdjustedDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return MandatoryEarlyTerminationAdjustedDates+ `apply` optional (parseSchemaType "adjustedEarlyTerminationDate")+ `apply` optional (parseSchemaType "adjustedCashSettlementValuationDate")+ `apply` optional (parseSchemaType "adjustedCashSettlementPaymentDate")+ schemaTypeToXML s x@MandatoryEarlyTerminationAdjustedDates{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "adjustedEarlyTerminationDate") $ metad_adjustedEarlyTerminationDate x+ , maybe [] (schemaTypeToXML "adjustedCashSettlementValuationDate") $ metad_adjustedCashSettlementValuationDate x+ , maybe [] (schemaTypeToXML "adjustedCashSettlementPaymentDate") $ metad_adjustedCashSettlementPaymentDate x+ ]+ +-- | A type defining the parameters used when the reference +-- currency of the swapStream is non-deliverable.+data NonDeliverableSettlement = NonDeliverableSettlement+ { nonDelivSettl_referenceCurrency :: Maybe Currency+ -- ^ The currency in which the swap stream is denominated.+ , nonDelivSettl_choice1 :: (Maybe (OneOf2 FxFixingDate AdjustableDates))+ -- ^ Choice between:+ -- + -- (1) The date, when expressed as a relative date, on which + -- the currency rate will be determined for the purpose of + -- specifying the amount in deliverable currency.+ -- + -- (2) The date, when expressed as a schedule of date(s), on + -- which the currency rate will be determined for the + -- purpose of specifying the amount in deliverable + -- currency.+ , nonDelivSettl_settlementRateOption :: Maybe SettlementRateOption+ -- ^ The rate source for the conversion to the settlement + -- currency. This source is specified through a scheme that + -- reflects the terms of the Annex A to the 1998 FX and + -- Currency Option Definitions.+ , nonDelivSettl_priceSourceDisruption :: Maybe PriceSourceDisruption+ -- ^ A type defining the parameters to get a new quote when a + -- settlement rate option is disrupted.+ }+ deriving (Eq,Show)+instance SchemaType NonDeliverableSettlement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return NonDeliverableSettlement+ `apply` optional (parseSchemaType "referenceCurrency")+ `apply` optional (oneOf' [ ("FxFixingDate", fmap OneOf2 (parseSchemaType "fxFixingDate"))+ , ("AdjustableDates", fmap TwoOf2 (parseSchemaType "fxFixingSchedule"))+ ])+ `apply` optional (parseSchemaType "settlementRateOption")+ `apply` optional (parseSchemaType "priceSourceDisruption")+ schemaTypeToXML s x@NonDeliverableSettlement{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "referenceCurrency") $ nonDelivSettl_referenceCurrency x+ , maybe [] (foldOneOf2 (schemaTypeToXML "fxFixingDate")+ (schemaTypeToXML "fxFixingSchedule")+ ) $ nonDelivSettl_choice1 x+ , maybe [] (schemaTypeToXML "settlementRateOption") $ nonDelivSettl_settlementRateOption x+ , maybe [] (schemaTypeToXML "priceSourceDisruption") $ nonDelivSettl_priceSourceDisruption x+ ]+ +-- | An type defining the notional amount or notional amount +-- schedule associated with a swap stream. The notional +-- schedule will be captured explicitly, specifying the dates +-- that the notional changes and the outstanding notional +-- amount that applies from that date. A parametric +-- representation of the rules defining the notional step +-- schedule can optionally be included.+data Notional = Notional+ { notional_ID :: Maybe Xsd.ID+ , notional_stepSchedule :: NonNegativeAmountSchedule+ -- ^ The notional amount or notional amount schedule expressed + -- as explicit outstanding notional amounts and dates. In the + -- case of a schedule, the step dates may be subject to + -- adjustment in accordance with any adjustments specified in + -- calculationPeriodDatesAdjustments.+ , notional_stepParameters :: Maybe NotionalStepRule+ -- ^ A parametric representation of the notional step schedule, + -- i.e. parameters used to generate the notional schedule.+ }+ deriving (Eq,Show)+instance SchemaType Notional where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Notional a0)+ `apply` parseSchemaType "notionalStepSchedule"+ `apply` optional (parseSchemaType "notionalStepParameters")+ schemaTypeToXML s x@Notional{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ notional_ID x+ ]+ [ schemaTypeToXML "notionalStepSchedule" $ notional_stepSchedule x+ , maybe [] (schemaTypeToXML "notionalStepParameters") $ notional_stepParameters x+ ]+ +-- | A type defining a parametric representation of the notional +-- step schedule, i.e. parameters used to generate the +-- notional balance on each step date. The step change in +-- notional can be expressed in terms of either a fixed amount +-- or as a percentage of either the initial notional or +-- previous notional amount. This parametric representation is +-- intended to cover the more common amortizing/accreting.+data NotionalStepRule = NotionalStepRule+ { notionStepRule_calculationPeriodDatesReference :: Maybe CalculationPeriodDatesReference+ -- ^ A pointer style reference to the associated calculation + -- period dates component defined elsewhere in the document.+ , notionStepRule_stepFrequency :: Maybe Period+ -- ^ The frequency at which the step changes occur. This + -- frequency must be a multiple of the stream calculation + -- period frequency.+ , notionStepRule_firstNotionalStepDate :: Maybe Xsd.Date+ -- ^ Effective date of the first change in notional (i.e. a + -- calculation period start date).+ , notionStepRule_lastNotionalStepDate :: Maybe Xsd.Date+ -- ^ Effective date of the last change in notional (i.e. a + -- calculation period start date).+ , notionStepRule_choice4 :: (Maybe (OneOf2 Xsd.Decimal ((Maybe (Xsd.Decimal)),(Maybe (StepRelativeToEnum)))))+ -- ^ Choice between:+ -- + -- (1) The explicit amount that the notional changes on each + -- step date. This can be a positive or negative amount.+ -- + -- (2) Sequence of:+ -- + -- * The percentage amount by which the notional changes + -- on each step date. The percentage is either a + -- percentage applied to the initial notional amount + -- or the previous outstanding notional, depending on + -- the value of the element stepRelativeTo. The + -- percentage can be either positive or negative. A + -- percentage of 5% would be represented as 0.05.+ -- + -- * Specifies whether the notionalStepRate should be + -- applied to the initial notional or the previous + -- notional in order to calculate the notional step + -- change amount.+ }+ deriving (Eq,Show)+instance SchemaType NotionalStepRule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return NotionalStepRule+ `apply` optional (parseSchemaType "calculationPeriodDatesReference")+ `apply` optional (parseSchemaType "stepFrequency")+ `apply` optional (parseSchemaType "firstNotionalStepDate")+ `apply` optional (parseSchemaType "lastNotionalStepDate")+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "notionalStepAmount"))+ , ("Maybe Xsd.Decimal Maybe StepRelativeToEnum", fmap TwoOf2 (return (,) `apply` optional (parseSchemaType "notionalStepRate")+ `apply` optional (parseSchemaType "stepRelativeTo")))+ ])+ schemaTypeToXML s x@NotionalStepRule{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "calculationPeriodDatesReference") $ notionStepRule_calculationPeriodDatesReference x+ , maybe [] (schemaTypeToXML "stepFrequency") $ notionStepRule_stepFrequency x+ , maybe [] (schemaTypeToXML "firstNotionalStepDate") $ notionStepRule_firstNotionalStepDate x+ , maybe [] (schemaTypeToXML "lastNotionalStepDate") $ notionStepRule_lastNotionalStepDate x+ , maybe [] (foldOneOf2 (schemaTypeToXML "notionalStepAmount")+ (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "notionalStepRate") a+ , maybe [] (schemaTypeToXML "stepRelativeTo") b+ ])+ ) $ notionStepRule_choice4 x+ ]+ +-- | A type defining an early termination provision where either +-- or both parties have the right to exercise.+data OptionalEarlyTermination = OptionalEarlyTermination+ { optionEarlyTermin_singlePartyOption :: Maybe SinglePartyOption+ -- ^ If optional early termination is not available to both + -- parties then this component specifies the buyer and seller + -- of the option.+ , optionEarlyTermin_exercise :: Maybe Exercise+ -- ^ An placeholder for the actual option exercise definitions.+ , optionEarlyTermin_exerciseNotice :: [ExerciseNotice]+ -- ^ Definition of the party to whom notice of exercise should + -- be given.+ , optionEarlyTermin_followUpConfirmation :: Maybe Xsd.Boolean+ -- ^ A flag to indicate whether follow-up confirmation of + -- exercise (written or electronic) is required following + -- telephonic notice by the buyer to the seller or seller's + -- agent.+ , optionEarlyTermin_calculationAgent :: Maybe CalculationAgent+ -- ^ The ISDA Calculation Agent responsible for performing + -- duties associated with an optional early termination.+ , optionEarlyTermin_cashSettlement :: Maybe CashSettlement+ -- ^ If specified, this means that cash settlement is applicable + -- to the transaction and defines the parameters associated + -- with the cash settlement prodcedure. If not specified, then + -- physical settlement is applicable.+ , optionalEarlyTermination_adjustedDates :: Maybe OptionalEarlyTerminationAdjustedDates+ -- ^ An early termination provision to terminate the trade at + -- fair value where one or both parties have the right to + -- decide on termination.+ }+ deriving (Eq,Show)+instance SchemaType OptionalEarlyTermination where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OptionalEarlyTermination+ `apply` optional (parseSchemaType "singlePartyOption")+ `apply` optional (elementExercise)+ `apply` many (parseSchemaType "exerciseNotice")+ `apply` optional (parseSchemaType "followUpConfirmation")+ `apply` optional (parseSchemaType "calculationAgent")+ `apply` optional (parseSchemaType "cashSettlement")+ `apply` optional (parseSchemaType "optionalEarlyTerminationAdjustedDates")+ schemaTypeToXML s x@OptionalEarlyTermination{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "singlePartyOption") $ optionEarlyTermin_singlePartyOption x+ , maybe [] (elementToXMLExercise) $ optionEarlyTermin_exercise x+ , concatMap (schemaTypeToXML "exerciseNotice") $ optionEarlyTermin_exerciseNotice x+ , maybe [] (schemaTypeToXML "followUpConfirmation") $ optionEarlyTermin_followUpConfirmation x+ , maybe [] (schemaTypeToXML "calculationAgent") $ optionEarlyTermin_calculationAgent x+ , maybe [] (schemaTypeToXML "cashSettlement") $ optionEarlyTermin_cashSettlement x+ , maybe [] (schemaTypeToXML "optionalEarlyTerminationAdjustedDates") $ optionalEarlyTermination_adjustedDates x+ ]+ +-- | A type defining the adjusted dates associated with an +-- optional early termination provision.+data OptionalEarlyTerminationAdjustedDates = OptionalEarlyTerminationAdjustedDates+ { oetad_earlyTerminationEvent :: [EarlyTerminationEvent]+ -- ^ The adjusted dates associated with an individual earley + -- termination date.+ }+ deriving (Eq,Show)+instance SchemaType OptionalEarlyTerminationAdjustedDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OptionalEarlyTerminationAdjustedDates+ `apply` many (parseSchemaType "earlyTerminationEvent")+ schemaTypeToXML s x@OptionalEarlyTerminationAdjustedDates{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "earlyTerminationEvent") $ oetad_earlyTerminationEvent x+ ]+ +-- | A type defining the adjusted payment date and associated +-- calculation period parameters required to calculate the +-- actual or projected payment amount. This type forms part of +-- the cashflow representation of a swap stream.+data PaymentCalculationPeriod = PaymentCalculationPeriod+ { paymentCalcPeriod_ID :: Maybe Xsd.ID+ , paymentCalcPeriod_href :: Maybe Xsd.IDREF+ -- ^ Attribute that can be used to reference the yield curve + -- used to estimate the discount factor.+ , paymentCalcPeriod_unadjustedPaymentDate :: Maybe Xsd.Date+ , paymentCalcPeriod_adjustedPaymentDate :: Maybe Xsd.Date+ -- ^ The adjusted payment date. This date should already be + -- adjusted for any applicable business day convention. This + -- component is not intended for use in trade confirmation but + -- may be specified to allow the fee structure to also serve + -- as a cashflow type component (all dates the Cashflows type + -- are adjusted payment dates).+ , paymentCalcPeriod_choice2 :: (Maybe (OneOf2 [CalculationPeriod] Xsd.Decimal))+ -- ^ Choice between:+ -- + -- (1) The parameters used in the calculation of a fixed or + -- floating rate calculation period amount. A list of + -- calculation period elements may be ordered in the + -- document by ascending start date. An FpML document + -- which contains an unordered list of calcularion periods + -- is still regarded as a conformant document.+ -- + -- (2) A known fixed payment amount.+ , paymentCalcPeriod_discountFactor :: Maybe Xsd.Decimal+ -- ^ A decimal value representing the discount factor used to + -- calculate the present value of cash flow.+ , paymentCalcPeriod_forecastPaymentAmount :: Maybe Money+ -- ^ A monetary amount representing the forecast of the future + -- value of the payment.+ , paymentCalcPeriod_presentValueAmount :: Maybe Money+ -- ^ A monetary amount representing the present value of the + -- forecast payment.+ }+ deriving (Eq,Show)+instance SchemaType PaymentCalculationPeriod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ a1 <- optional $ getAttribute "href" e pos+ commit $ interior e $ return (PaymentCalculationPeriod a0 a1)+ `apply` optional (parseSchemaType "unadjustedPaymentDate")+ `apply` optional (parseSchemaType "adjustedPaymentDate")+ `apply` optional (oneOf' [ ("[CalculationPeriod]", fmap OneOf2 (many1 (parseSchemaType "calculationPeriod")))+ , ("Xsd.Decimal", fmap TwoOf2 (parseSchemaType "fixedPaymentAmount"))+ ])+ `apply` optional (parseSchemaType "discountFactor")+ `apply` optional (parseSchemaType "forecastPaymentAmount")+ `apply` optional (parseSchemaType "presentValueAmount")+ schemaTypeToXML s x@PaymentCalculationPeriod{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ paymentCalcPeriod_ID x+ , maybe [] (toXMLAttribute "href") $ paymentCalcPeriod_href x+ ]+ [ maybe [] (schemaTypeToXML "unadjustedPaymentDate") $ paymentCalcPeriod_unadjustedPaymentDate x+ , maybe [] (schemaTypeToXML "adjustedPaymentDate") $ paymentCalcPeriod_adjustedPaymentDate x+ , maybe [] (foldOneOf2 (concatMap (schemaTypeToXML "calculationPeriod"))+ (schemaTypeToXML "fixedPaymentAmount")+ ) $ paymentCalcPeriod_choice2 x+ , maybe [] (schemaTypeToXML "discountFactor") $ paymentCalcPeriod_discountFactor x+ , maybe [] (schemaTypeToXML "forecastPaymentAmount") $ paymentCalcPeriod_forecastPaymentAmount x+ , maybe [] (schemaTypeToXML "presentValueAmount") $ paymentCalcPeriod_presentValueAmount x+ ]+instance Extension PaymentCalculationPeriod PaymentBase where+ supertype v = PaymentBase_PaymentCalculationPeriod v+ +-- | A type defining parameters used to generate the payment +-- dates schedule, including the specification of early or +-- delayed payments. Payment dates are determined relative to +-- the calculation period dates or the reset dates.+data PaymentDates = PaymentDates+ { paymentDates_ID :: Maybe Xsd.ID+ , paymentDates_choice0 :: (Maybe (OneOf3 CalculationPeriodDatesReference ResetDatesReference ValuationDatesReference))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to the associated calculation + -- period dates component defined elsewhere in the + -- document.+ -- + -- (2) A pointer style reference to the associated reset dates + -- component defined elsewhere in the document.+ -- + -- (3) A pointer style reference to the associated valuation + -- dates component defined elsewhere in the document. + -- Implemented for Brazilian-CDI Swaps where it will refer + -- to the + -- settlemementProvision/nonDeliverableSettlement/fxFixingDate + -- structure.+ , paymentDates_paymentFrequency :: Frequency+ -- ^ The frequency at which regular payment dates occur. If the + -- payment frequency is equal to the frequency defined in the + -- calculation period dates component then one calculation + -- period contributes to each payment amount. If the payment + -- frequency is less frequent than the frequency defined in + -- the calculation period dates component then more than one + -- calculation period will contribute to the payment amount. A + -- payment frequency more frequent than the calculation period + -- frequency or one that is not a multiple of the calculation + -- period frequency is invalid. If the payment frequency is of + -- value T (term), the period is defined by the + -- swap\swapStream\calculationPerioDates\effectiveDate and the + -- swap\swapStream\calculationPerioDates\terminationDate.+ , paymentDates_firstPaymentDate :: Maybe Xsd.Date+ -- ^ The first unadjusted payment date. This day may be subject + -- to adjustment in accordance with any business day + -- convention specified in paymentDatesAdjustments. This + -- element must only be included if there is an initial stub. + -- This date will normally correspond to an unadjusted + -- calculation period start or end date. This is true even if + -- early or delayed payment is specified to be applicable + -- since the actual first payment date will be the specified + -- number of days before or after the applicable adjusted + -- calculation period start or end date with the resulting + -- payment date then being adjusted in accordance with any + -- business day convention specified in + -- paymentDatesAdjustments.+ , paymentDates_lastRegularPaymentDate :: Maybe Xsd.Date+ -- ^ The last regular unadjusted payment date. This day may be + -- subject to adjustment in accordance with any business day + -- convention specified in paymentDatesAdjustments. This + -- element must only be included if there is a final stub. All + -- calculation periods after this date contribute to the final + -- payment. The final payment is made relative to the final + -- set of calculation periods or the final reset date as the + -- case may be. This date will normally correspond to an + -- unadjusted calculation period start or end date. This is + -- true even if early or delayed payment is specified to be + -- applicable since the actual last regular payment date will + -- be the specified number of days before or after the + -- applicable adjusted calculation period start or end date + -- with the resulting payment date then being adjusted in + -- accordance with any business day convention specified in + -- paymentDatesAdjustments.+ , paymentDates_payRelativeTo :: Maybe PayRelativeToEnum+ -- ^ Specifies whether the payments occur relative to each + -- adjusted calculation period start date, adjusted + -- calculation period end date or each reset date. The reset + -- date is applicable in the case of certain euro (former + -- French Franc) floating rate indices. Calculation period + -- start date means relative to the start of the first + -- calculation period contributing to a given payment. + -- Similarly, calculation period end date means the end of the + -- last calculation period contributing to a given payment.The + -- valuation date is applicable for Brazilian-CDI swaps.+ , paymentDates_paymentDaysOffset :: Maybe Offset+ -- ^ If early payment or delayed payment is required, specifies + -- the number of days offset that the payment occurs relative + -- to what would otherwise be the unadjusted payment date. The + -- offset can be specified in terms of either calendar or + -- business days. Even in the case of a calendar days offset, + -- the resulting payment date, adjusted for the specified + -- calendar days offset, will still be adjusted in accordance + -- with the specified payment dates adjustments. This element + -- should only be included if early or delayed payment is + -- applicable, i.e. if the periodMultiplier element value is + -- not equal to zero. An early payment would be indicated by a + -- negative periodMultiplier element value and a delayed + -- payment (or payment lag) would be indicated by a positive + -- periodMultiplier element value.+ , paymentDates_adjustments :: Maybe BusinessDayAdjustments+ -- ^ The business day convention to apply to each payment date + -- if it would otherwise fall on a day that is not a business + -- day in the specified financial business centers.+ }+ deriving (Eq,Show)+instance SchemaType PaymentDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PaymentDates a0)+ `apply` optional (oneOf' [ ("CalculationPeriodDatesReference", fmap OneOf3 (parseSchemaType "calculationPeriodDatesReference"))+ , ("ResetDatesReference", fmap TwoOf3 (parseSchemaType "resetDatesReference"))+ , ("ValuationDatesReference", fmap ThreeOf3 (parseSchemaType "valuationDatesReference"))+ ])+ `apply` parseSchemaType "paymentFrequency"+ `apply` optional (parseSchemaType "firstPaymentDate")+ `apply` optional (parseSchemaType "lastRegularPaymentDate")+ `apply` optional (parseSchemaType "payRelativeTo")+ `apply` optional (parseSchemaType "paymentDaysOffset")+ `apply` optional (parseSchemaType "paymentDatesAdjustments")+ schemaTypeToXML s x@PaymentDates{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ paymentDates_ID x+ ]+ [ maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodDatesReference")+ (schemaTypeToXML "resetDatesReference")+ (schemaTypeToXML "valuationDatesReference")+ ) $ paymentDates_choice0 x+ , schemaTypeToXML "paymentFrequency" $ paymentDates_paymentFrequency x+ , maybe [] (schemaTypeToXML "firstPaymentDate") $ paymentDates_firstPaymentDate x+ , maybe [] (schemaTypeToXML "lastRegularPaymentDate") $ paymentDates_lastRegularPaymentDate x+ , maybe [] (schemaTypeToXML "payRelativeTo") $ paymentDates_payRelativeTo x+ , maybe [] (schemaTypeToXML "paymentDaysOffset") $ paymentDates_paymentDaysOffset x+ , maybe [] (schemaTypeToXML "paymentDatesAdjustments") $ paymentDates_adjustments x+ ]+ +-- | Reference to a payment dates structure.+data PaymentDatesReference = PaymentDatesReference+ { paymentDatesRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType PaymentDatesReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (PaymentDatesReference a0)+ schemaTypeToXML s x@PaymentDatesReference{} =+ toXMLElement s [ toXMLAttribute "href" $ paymentDatesRef_href x+ ]+ []+instance Extension PaymentDatesReference Reference where+ supertype v = Reference_PaymentDatesReference v+ +-- | A type defining the parameters used to get a price quote to +-- replace the settlement rate option that is disrupted.+data PriceSourceDisruption = PriceSourceDisruption+ { priceSourceDisrup_fallbackReferencePrice :: Maybe FallbackReferencePrice+ -- ^ The method, prioritzed by the order it is listed in this + -- element, to get a replacement rate for the disrupted + -- settlement rate option.+ }+ deriving (Eq,Show)+instance SchemaType PriceSourceDisruption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PriceSourceDisruption+ `apply` optional (parseSchemaType "fallbackReferencePrice")+ schemaTypeToXML s x@PriceSourceDisruption{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "fallbackReferencePrice") $ priceSourceDisrup_fallbackReferencePrice x+ ]+ +-- | A type defining a principal exchange amount and adjusted +-- exchange date. The type forms part of the cashflow +-- representation of a swap stream.+data PrincipalExchange = PrincipalExchange+ { princExch_ID :: Maybe Xsd.ID+ , princExch_unadjustedPrincipalExchangeDate :: Maybe Xsd.Date+ , princExch_adjustedPrincipalExchangeDate :: Maybe Xsd.Date+ -- ^ The principal exchange date. This date should already be + -- adjusted for any applicable business day convention.+ , principalExchange_amount :: Maybe Xsd.Decimal+ -- ^ The principal exchange amount. This amount should be + -- positive if the stream payer is paying the exchange amount + -- and signed negative if they are receiving it.+ , princExch_discountFactor :: Maybe Xsd.Decimal+ -- ^ The value representing the discount factor used to + -- calculate the present value of the principal exchange + -- amount.+ , princExch_presentValuePrincipalExchangeAmount :: Maybe Money+ -- ^ The amount representing the present value of the principal + -- exchange.+ }+ deriving (Eq,Show)+instance SchemaType PrincipalExchange where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PrincipalExchange a0)+ `apply` optional (parseSchemaType "unadjustedPrincipalExchangeDate")+ `apply` optional (parseSchemaType "adjustedPrincipalExchangeDate")+ `apply` optional (parseSchemaType "principalExchangeAmount")+ `apply` optional (parseSchemaType "discountFactor")+ `apply` optional (parseSchemaType "presentValuePrincipalExchangeAmount")+ schemaTypeToXML s x@PrincipalExchange{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ princExch_ID x+ ]+ [ maybe [] (schemaTypeToXML "unadjustedPrincipalExchangeDate") $ princExch_unadjustedPrincipalExchangeDate x+ , maybe [] (schemaTypeToXML "adjustedPrincipalExchangeDate") $ princExch_adjustedPrincipalExchangeDate x+ , maybe [] (schemaTypeToXML "principalExchangeAmount") $ principalExchange_amount x+ , maybe [] (schemaTypeToXML "discountFactor") $ princExch_discountFactor x+ , maybe [] (schemaTypeToXML "presentValuePrincipalExchangeAmount") $ princExch_presentValuePrincipalExchangeAmount x+ ]+ +-- | Reference to relevant underlying date.+data RelevantUnderlyingDateReference = RelevantUnderlyingDateReference+ { relevUnderlyDateRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType RelevantUnderlyingDateReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (RelevantUnderlyingDateReference a0)+ schemaTypeToXML s x@RelevantUnderlyingDateReference{} =+ toXMLElement s [ toXMLAttribute "href" $ relevUnderlyDateRef_href x+ ]+ []+instance Extension RelevantUnderlyingDateReference Reference where+ supertype v = Reference_RelevantUnderlyingDateReference v+ +-- | A type defining the parameters used to generate the reset +-- dates schedule and associated fixing dates. The reset dates +-- are determined relative to the calculation periods +-- schedules dates.+data ResetDates = ResetDates+ { resetDates_ID :: Maybe Xsd.ID+ , resetDates_calculationPeriodDatesReference :: Maybe CalculationPeriodDatesReference+ -- ^ A pointer style reference to the associated calculation + -- period dates component defined elsewhere in the document.+ , resetDates_resetRelativeTo :: Maybe ResetRelativeToEnum+ -- ^ Specifies whether the reset dates are determined with + -- respect to each adjusted calculation period start date or + -- adjusted calculation period end date. If the reset + -- frequency is specified as daily this element must not be + -- included.+ , resetDates_initialFixingDate :: Maybe RelativeDateOffset+ , resetDates_fixingDates :: Maybe RelativeDateOffset+ -- ^ Specifies the fixing date relative to the reset date in + -- terms of a business days offset and an associated set of + -- financial business centers. Normally these offset + -- calculation rules will be those specified in the ISDA + -- definition for the relevant floating rate index (ISDA's + -- Floating Rate Option). However, non-standard offset + -- calculation rules may apply for a trade if mutually agreed + -- by the principal parties to the transaction. The href + -- attribute on the dateRelativeTo element should reference + -- the id attribute on the resetDates element.+ , resetDates_rateCutOffDaysOffset :: Maybe Offset+ -- ^ Specifies the number of business days before the period end + -- date when the rate cut-off date is assumed to apply. The + -- financial business centers associated with determining the + -- rate cut-off date are those specified in the reset dates + -- adjustments. The rate cut-off number of days must be a + -- negative integer (a value of zero would imply no rate cut + -- off applies in which case the rateCutOffDaysOffset element + -- should not be included). The relevant rate for each reset + -- date in the period from, and including, a rate cut-off date + -- to, but excluding, the next applicable period end date (or, + -- in the case of the last calculation period, the termination + -- date) will (solely for purposes of calculating the floating + -- amount payable on the next applicable payment date) be + -- deemed to be the relevant rate in effect on that rate + -- cut-off date. For example, if rate cut-off days for a daily + -- averaging deal is -2 business days, then the refix rate + -- applied on (period end date - 2 days) will also be applied + -- as the reset on (period end date - 1 day), i.e. the actual + -- number of reset dates remains the same but from the rate + -- cut-off date until the period end date, the same refix rate + -- is applied. Note that in the case of several calculation + -- periods contributing to a single payment, the rate cut-off + -- is assumed only to apply to the final calculation period + -- contributing to that payment. The day type associated with + -- the offset must imply a business days offset.+ , resetDates_resetFrequency :: ResetFrequency+ -- ^ The frequency at which reset dates occur. In the case of a + -- weekly reset frequency, also specifies the day of the week + -- that the reset occurs. If the reset frequency is greater + -- than the calculation period frequency then this implies + -- that more than one reset date is established for each + -- calculation period and some form of rate averaging is + -- applicable.+ , resetDates_adjustments :: Maybe BusinessDayAdjustments+ -- ^ The business day convention to apply to each reset date if + -- it would otherwise fall on a day that is not a business day + -- in the specified financial business centers.+ }+ deriving (Eq,Show)+instance SchemaType ResetDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ResetDates a0)+ `apply` optional (parseSchemaType "calculationPeriodDatesReference")+ `apply` optional (parseSchemaType "resetRelativeTo")+ `apply` optional (parseSchemaType "initialFixingDate")+ `apply` optional (parseSchemaType "fixingDates")+ `apply` optional (parseSchemaType "rateCutOffDaysOffset")+ `apply` parseSchemaType "resetFrequency"+ `apply` optional (parseSchemaType "resetDatesAdjustments")+ schemaTypeToXML s x@ResetDates{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ resetDates_ID x+ ]+ [ maybe [] (schemaTypeToXML "calculationPeriodDatesReference") $ resetDates_calculationPeriodDatesReference x+ , maybe [] (schemaTypeToXML "resetRelativeTo") $ resetDates_resetRelativeTo x+ , maybe [] (schemaTypeToXML "initialFixingDate") $ resetDates_initialFixingDate x+ , maybe [] (schemaTypeToXML "fixingDates") $ resetDates_fixingDates x+ , maybe [] (schemaTypeToXML "rateCutOffDaysOffset") $ resetDates_rateCutOffDaysOffset x+ , schemaTypeToXML "resetFrequency" $ resetDates_resetFrequency x+ , maybe [] (schemaTypeToXML "resetDatesAdjustments") $ resetDates_adjustments x+ ]+ +-- | Reference to a reset dates component.+data ResetDatesReference = ResetDatesReference+ { resetDatesRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType ResetDatesReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (ResetDatesReference a0)+ schemaTypeToXML s x@ResetDatesReference{} =+ toXMLElement s [ toXMLAttribute "href" $ resetDatesRef_href x+ ]+ []+instance Extension ResetDatesReference Reference where+ supertype v = Reference_ResetDatesReference v+ +-- | A type defining the specification of settlement terms, +-- occuring when the settlement currency is different to the +-- notional currency of the trade.+data SettlementProvision = SettlementProvision+ { settlProvis_settlementCurrency :: Maybe Currency+ -- ^ The currency that stream settles in (to support swaps that + -- settle in a currency different from the notional currency).+ , settlProvis_nonDeliverableSettlement :: Maybe NonDeliverableSettlement+ -- ^ The specification of the non-deliverable settlement + -- provision.+ }+ deriving (Eq,Show)+instance SchemaType SettlementProvision where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SettlementProvision+ `apply` optional (parseSchemaType "settlementCurrency")+ `apply` optional (parseSchemaType "nonDeliverableSettlement")+ schemaTypeToXML s x@SettlementProvision{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "settlementCurrency") $ settlProvis_settlementCurrency x+ , maybe [] (schemaTypeToXML "nonDeliverableSettlement") $ settlProvis_nonDeliverableSettlement x+ ]+ +-- | A type defining the settlement rate options through a +-- scheme reflecting the terms of the Annex A to the 1998 FX +-- and Currency Option Definitions.+data SettlementRateOption = SettlementRateOption Scheme SettlementRateOptionAttributes deriving (Eq,Show)+data SettlementRateOptionAttributes = SettlementRateOptionAttributes+ { settlRateOptionAttrib_settlementRateOptionScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType SettlementRateOption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "settlementRateOptionScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ SettlementRateOption v (SettlementRateOptionAttributes a0)+ schemaTypeToXML s (SettlementRateOption bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "settlementRateOptionScheme") $ settlRateOptionAttrib_settlementRateOptionScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension SettlementRateOption Scheme where+ supertype (SettlementRateOption s _) = s+ +-- | A type describing the buyer and seller of an option.+data SinglePartyOption = SinglePartyOption+ { singlePartyOption_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , singlePartyOption_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , singlePartyOption_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , singlePartyOption_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ }+ deriving (Eq,Show)+instance SchemaType SinglePartyOption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SinglePartyOption+ `apply` optional (parseSchemaType "buyerPartyReference")+ `apply` optional (parseSchemaType "buyerAccountReference")+ `apply` optional (parseSchemaType "sellerPartyReference")+ `apply` optional (parseSchemaType "sellerAccountReference")+ schemaTypeToXML s x@SinglePartyOption{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "buyerPartyReference") $ singlePartyOption_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ singlePartyOption_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ singlePartyOption_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ singlePartyOption_sellerAccountReference x+ ]+ +-- | A type defining how the initial or final stub calculation +-- period amounts is calculated. For example, the rate to be +-- applied to the initial or final stub calculation period may +-- be the linear interpolation of two different tenors for the +-- floating rate index specified in the calculation period +-- amount component, e.g. A two month stub period may used the +-- linear interpolation of a one month and three month +-- floating rate. The different rate tenors would be specified +-- in this component. Note that a maximum of two rate tenors +-- can be specified. If a stub period uses a single index +-- tenor and this is the same as that specified in the +-- calculation period amount component then the initial stub +-- or final stub component, as the case may be, must not be +-- included.+data StubCalculationPeriodAmount = StubCalculationPeriodAmount+ { stubCalcPeriodAmount_calculationPeriodDatesReference :: Maybe CalculationPeriodDatesReference+ -- ^ A pointer style reference to the associated calculation + -- period dates component defined elsewhere in the document.+ , stubCalcPeriodAmount_initialStub :: Maybe StubValue+ -- ^ Specifies how the initial stub amount is calculated. A + -- single floating rate tenor different to that used for the + -- regular part of the calculation periods schedule may be + -- specified, or two floating tenors may be specified. If two + -- floating rate tenors are specified then Linear + -- Interpolation (in accordance with the 2000 ISDA + -- Definitions, Section 8.3. Interpolation) is assumed to + -- apply. Alternatively, an actual known stub rate or stub + -- amount may be specified.+ , stubCalcPeriodAmount_finalStub :: Maybe StubValue+ -- ^ Specifies how the final stub amount is calculated. A single + -- floating rate tenor different to that used for the regular + -- part of the calculation periods schedule may be specified, + -- or two floating tenors may be specified. If two floating + -- rate tenors are specified then Linear Interpolation (in + -- accordance with the 2000 ISDA Definitions, Section 8.3. + -- Interpolation) is assumed to apply. Alternatively, an + -- actual known stub rate or stub amount may be specified.+ }+ deriving (Eq,Show)+instance SchemaType StubCalculationPeriodAmount where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return StubCalculationPeriodAmount+ `apply` optional (parseSchemaType "calculationPeriodDatesReference")+ `apply` optional (parseSchemaType "initialStub")+ `apply` optional (parseSchemaType "finalStub")+ schemaTypeToXML s x@StubCalculationPeriodAmount{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "calculationPeriodDatesReference") $ stubCalcPeriodAmount_calculationPeriodDatesReference x+ , maybe [] (schemaTypeToXML "initialStub") $ stubCalcPeriodAmount_initialStub x+ , maybe [] (schemaTypeToXML "finalStub") $ stubCalcPeriodAmount_finalStub x+ ]+ +-- | A type defining swap streams and additional payments +-- between the principal parties involved in the swap.+data Swap = Swap+ { swap_ID :: Maybe Xsd.ID+ , swap_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , swap_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , swap_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , swap_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , swap_stream :: [InterestRateStream]+ -- ^ The swap streams.+ , swap_earlyTerminationProvision :: Maybe EarlyTerminationProvision+ -- ^ Parameters specifying provisions relating to the optional + -- and mandatory early terminarion of a swap transaction.+ , swap_cancelableProvision :: Maybe CancelableProvision+ -- ^ A provision that allows the specification of an embedded + -- option within a swap giving the buyer of the option the + -- right to terminate the swap, in whole or in part, on the + -- early termination date.+ , swap_extendibleProvision :: Maybe ExtendibleProvision+ -- ^ A provision that allows the specification of an embedded + -- option with a swap giving the buyer of the option the right + -- to extend the swap, in whole or in part, to the extended + -- termination date.+ , swap_additionalPayment :: [Payment]+ -- ^ Additional payments between the principal parties.+ , swap_additionalTerms :: Maybe SwapAdditionalTerms+ -- ^ Contains any additional terms to the swap contract.+ }+ deriving (Eq,Show)+instance SchemaType Swap where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Swap a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` many1 (parseSchemaType "swapStream")+ `apply` optional (parseSchemaType "earlyTerminationProvision")+ `apply` optional (parseSchemaType "cancelableProvision")+ `apply` optional (parseSchemaType "extendibleProvision")+ `apply` many (parseSchemaType "additionalPayment")+ `apply` optional (parseSchemaType "additionalTerms")+ schemaTypeToXML s x@Swap{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ swap_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ swap_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ swap_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ swap_productType x+ , concatMap (schemaTypeToXML "productId") $ swap_productId x+ , concatMap (schemaTypeToXML "swapStream") $ swap_stream x+ , maybe [] (schemaTypeToXML "earlyTerminationProvision") $ swap_earlyTerminationProvision x+ , maybe [] (schemaTypeToXML "cancelableProvision") $ swap_cancelableProvision x+ , maybe [] (schemaTypeToXML "extendibleProvision") $ swap_extendibleProvision x+ , concatMap (schemaTypeToXML "additionalPayment") $ swap_additionalPayment x+ , maybe [] (schemaTypeToXML "additionalTerms") $ swap_additionalTerms x+ ]+instance Extension Swap Product where+ supertype v = Product_Swap v+ +-- | Additional terms to a swap contract.+data SwapAdditionalTerms = SwapAdditionalTerms+ { swapAddTerms_bondReference :: Maybe BondReference+ -- ^ Reference to a bond underlyer to represent an asset swap or + -- Condition Precedent Bond.+ }+ deriving (Eq,Show)+instance SchemaType SwapAdditionalTerms where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SwapAdditionalTerms+ `apply` optional (parseSchemaType "bondReference")+ schemaTypeToXML s x@SwapAdditionalTerms{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "bondReference") $ swapAddTerms_bondReference x+ ]+ +-- | A type to define an option on a swap.+data Swaption = Swaption+ { swaption_ID :: Maybe Xsd.ID+ , swaption_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , swaption_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , swaption_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , swaption_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , swaption_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , swaption_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , swaption_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , swaption_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , swaption_premium :: [Payment]+ -- ^ The option premium amount payable by buyer to seller on the + -- specified payment date.+ , swaption_optionType :: Maybe OptionTypeEnum+ -- ^ The type of option transaction. From a usage standpoint, + -- put/call is the default option type, while payer/receiver + -- indicator is used for options index credit default swaps, + -- consistently with the industry practice. Straddle is used + -- for the case of straddle strategy, that combine a call and + -- a put with the same strike. This element is needed for + -- transparency reporting because the counterparties are not + -- available. TODO: can this be represented instead using the + -- UPI?+ , swaption_exercise :: Exercise+ -- ^ An placeholder for the actual option exercise definitions.+ , swaption_exerciseProcedure :: Maybe ExerciseProcedure+ -- ^ A set of parameters defining procedures associated with the + -- exercise.+ , swaption_calculationAgent :: Maybe CalculationAgent+ -- ^ The ISDA Calculation Agent responsible for performing + -- duties associated with an optional early termination.+ , swaption_choice13 :: (Maybe (OneOf2 CashSettlement SwaptionPhysicalSettlement))+ -- ^ In the absence of both cashSettlement and (explicit) + -- physicalSettlement terms, physical settlement is inferred.+ -- + -- Choice between:+ -- + -- (1) If specified, this means that cash settlement is + -- applicable to the transaction and defines the + -- parameters associated with the cash settlement + -- procedure. If not specified, then physical settlement + -- is applicable.+ -- + -- (2) If specified, this defines physical settlement terms + -- which apply to the transaction.+ , swaption_straddle :: Xsd.Boolean+ -- ^ Whether the option is a swaption or a swaption straddle.+ , swaption_adjustedDates :: Maybe SwaptionAdjustedDates+ -- ^ The adjusted dates associated with swaption exercise. These + -- dates have been adjusted for any applicable business day + -- convention.+ , swaption_swap :: Swap+ }+ deriving (Eq,Show)+instance SchemaType Swaption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Swaption 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` many1 (parseSchemaType "premium")+ `apply` optional (parseSchemaType "optionType")+ `apply` elementExercise+ `apply` optional (parseSchemaType "exerciseProcedure")+ `apply` optional (parseSchemaType "calculationAgent")+ `apply` optional (oneOf' [ ("CashSettlement", fmap OneOf2 (parseSchemaType "cashSettlement"))+ , ("SwaptionPhysicalSettlement", fmap TwoOf2 (parseSchemaType "physicalSettlement"))+ ])+ `apply` parseSchemaType "swaptionStraddle"+ `apply` optional (parseSchemaType "swaptionAdjustedDates")+ `apply` parseSchemaType "swap"+ schemaTypeToXML s x@Swaption{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ swaption_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ swaption_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ swaption_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ swaption_productType x+ , concatMap (schemaTypeToXML "productId") $ swaption_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ swaption_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ swaption_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ swaption_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ swaption_sellerAccountReference x+ , concatMap (schemaTypeToXML "premium") $ swaption_premium x+ , maybe [] (schemaTypeToXML "optionType") $ swaption_optionType x+ , elementToXMLExercise $ swaption_exercise x+ , maybe [] (schemaTypeToXML "exerciseProcedure") $ swaption_exerciseProcedure x+ , maybe [] (schemaTypeToXML "calculationAgent") $ swaption_calculationAgent x+ , maybe [] (foldOneOf2 (schemaTypeToXML "cashSettlement")+ (schemaTypeToXML "physicalSettlement")+ ) $ swaption_choice13 x+ , schemaTypeToXML "swaptionStraddle" $ swaption_straddle x+ , maybe [] (schemaTypeToXML "swaptionAdjustedDates") $ swaption_adjustedDates x+ , schemaTypeToXML "swap" $ swaption_swap x+ ]+instance Extension Swaption Product where+ supertype v = Product_Swaption v+ +-- | A type describing the adjusted dates associated with +-- swaption exercise and settlement.+data SwaptionAdjustedDates = SwaptionAdjustedDates+ { swaptAdjustDates_exerciseEvent :: [ExerciseEvent]+ -- ^ The adjusted dates associated with an individual swaption + -- exercise date.+ }+ deriving (Eq,Show)+instance SchemaType SwaptionAdjustedDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SwaptionAdjustedDates+ `apply` many (parseSchemaType "exerciseEvent")+ schemaTypeToXML s x@SwaptionAdjustedDates{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "exerciseEvent") $ swaptAdjustDates_exerciseEvent x+ ]+ +data SwaptionPhysicalSettlement = SwaptionPhysicalSettlement+ { swaptPhysicSettl_clearedPhysicalSettlement :: Maybe Xsd.Boolean+ -- ^ Specifies whether the swap resulting from physical + -- settlement of the swaption transaction will clear through a + -- clearing house. The meaning of Cleared Physical Settlement + -- is defined in the 2006 ISDA Definitions, Section 15.2 + -- (published in Supplement number 28).+ }+ deriving (Eq,Show)+instance SchemaType SwaptionPhysicalSettlement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SwaptionPhysicalSettlement+ `apply` optional (parseSchemaType "clearedPhysicalSettlement")+ schemaTypeToXML s x@SwaptionPhysicalSettlement{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "clearedPhysicalSettlement") $ swaptPhysicSettl_clearedPhysicalSettlement x+ ]+ +-- | Reference to a Valuation dates node.+data ValuationDatesReference = ValuationDatesReference+ { valDatesRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType ValuationDatesReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (ValuationDatesReference a0)+ schemaTypeToXML s x@ValuationDatesReference{} =+ toXMLElement s [ toXMLAttribute "href" $ valDatesRef_href x+ ]+ []+instance Extension ValuationDatesReference Reference where+ supertype v = Reference_ValuationDatesReference v+ +-- | Specifies how long to wait to get a quote from a settlement +-- rate option upon a price source disruption.+data ValuationPostponement = ValuationPostponement+ { valPostp_maximumDaysOfPostponement :: Maybe Xsd.PositiveInteger+ -- ^ The maximum number of days to wait for a quote from the + -- disrupted settlement rate option before proceding to the + -- next method.+ }+ deriving (Eq,Show)+instance SchemaType ValuationPostponement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ValuationPostponement+ `apply` optional (parseSchemaType "maximumDaysOfPostponement")+ schemaTypeToXML s x@ValuationPostponement{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "maximumDaysOfPostponement") $ valPostp_maximumDaysOfPostponement x+ ]+ +-- | A type defining the parameters required for each of the +-- ISDA defined yield curve methods for cash settlement.+data YieldCurveMethod = YieldCurveMethod+ { yieldCurveMethod_settlementRateSource :: Maybe SettlementRateSource+ -- ^ The method for obtaining a settlement rate. This may be + -- from some information source (e.g. Reuters) or from a set + -- of reference banks.+ , yieldCurveMethod_quotationRateType :: Maybe QuotationRateTypeEnum+ -- ^ Which rate quote is to be observed, either Bid, Mid, Offer + -- or Exercising Party Pays. The meaning of Exercising Party + -- Pays is defined in the 2000 ISDA Definitions, Section 17.2. + -- Certain Definitions Relating to Cash Settlement, paragraph + -- (j)+ }+ deriving (Eq,Show)+instance SchemaType YieldCurveMethod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return YieldCurveMethod+ `apply` optional (parseSchemaType "settlementRateSource")+ `apply` optional (parseSchemaType "quotationRateType")+ schemaTypeToXML s x@YieldCurveMethod{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "settlementRateSource") $ yieldCurveMethod_settlementRateSource x+ , maybe [] (schemaTypeToXML "quotationRateType") $ yieldCurveMethod_quotationRateType x+ ]+ +-- | A product to represent a single known payment.+elementBulletPayment :: XMLParser BulletPayment+elementBulletPayment = parseSchemaType "bulletPayment"+elementToXMLBulletPayment :: BulletPayment -> [Content ()]+elementToXMLBulletPayment = schemaTypeToXML "bulletPayment"+ +-- | A cap, floor or cap floor structures product definition.+elementCapFloor :: XMLParser CapFloor+elementCapFloor = parseSchemaType "capFloor"+elementToXMLCapFloor :: CapFloor -> [Content ()]+elementToXMLCapFloor = schemaTypeToXML "capFloor"+ +-- | A floating rate calculation definition.+elementFloatingRateCalculation :: XMLParser FloatingRateCalculation+elementFloatingRateCalculation = parseSchemaType "floatingRateCalculation"+elementToXMLFloatingRateCalculation :: FloatingRateCalculation -> [Content ()]+elementToXMLFloatingRateCalculation = schemaTypeToXML "floatingRateCalculation"+ +-- | A forward rate agreement product definition.+elementFra :: XMLParser Fra+elementFra = parseSchemaType "fra"+elementToXMLFra :: Fra -> [Content ()]+elementToXMLFra = schemaTypeToXML "fra"+ +-- | An inflation rate calculation definition.+elementInflationRateCalculation :: XMLParser InflationRateCalculation+elementInflationRateCalculation = parseSchemaType "inflationRateCalculation"+elementToXMLInflationRateCalculation :: InflationRateCalculation -> [Content ()]+elementToXMLInflationRateCalculation = schemaTypeToXML "inflationRateCalculation"+ +-- | The base element for the floating rate calculation +-- definitions.+elementRateCalculation :: XMLParser Rate+elementRateCalculation = fmap supertype elementInflationRateCalculation+ `onFail`+ fmap supertype elementFloatingRateCalculation+ `onFail` fail "Parse failed when expecting an element in the substitution group for\n\+\ <rateCalculation>,\n\+\ namely one of:\n\+\<inflationRateCalculation>, <floatingRateCalculation>"+elementToXMLRateCalculation :: Rate -> [Content ()]+elementToXMLRateCalculation = schemaTypeToXML "rateCalculation"+ +-- | A swap product definition.+elementSwap :: XMLParser Swap+elementSwap = parseSchemaType "swap"+elementToXMLSwap :: Swap -> [Content ()]+elementToXMLSwap = schemaTypeToXML "swap"+ +-- | A swaption product definition.+elementSwaption :: XMLParser Swaption+elementSwaption = parseSchemaType "swaption"+elementToXMLSwaption :: Swaption -> [Content ()]+elementToXMLSwaption = schemaTypeToXML "swaption"+ + +
+ Data/FpML/V53/IRD.hs-boot view
@@ -0,0 +1,564 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.IRD+ ( module Data.FpML.V53.IRD+ , 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 qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Asset+ +-- | A type including a reference to a bond to support the +-- representation of an asset swap or Condition Precedent +-- Bond. +data BondReference+instance Eq BondReference+instance Show BondReference+instance SchemaType BondReference+ +-- | A product to represent a single cashflow. +data BulletPayment+instance Eq BulletPayment+instance Show BulletPayment+instance SchemaType BulletPayment+instance Extension BulletPayment Product+ +-- | A type definining the parameters used in the calculation of +-- fixed or floating calculation period amounts. +data Calculation+instance Eq Calculation+instance Show Calculation+instance SchemaType Calculation+ +-- | A type defining the parameters used in the calculation of a +-- fixed or floating rate calculation period amount. This type +-- forms part of cashflows representation of a swap stream. +data CalculationPeriod+instance Eq CalculationPeriod+instance Show CalculationPeriod+instance SchemaType CalculationPeriod+ +-- | A type defining the parameters used in the calculation of +-- fixed or floating rate calculation period amounts or for +-- specifying a known calculation period amount or known +-- amount schedule. +data CalculationPeriodAmount+instance Eq CalculationPeriodAmount+instance Show CalculationPeriodAmount+instance SchemaType CalculationPeriodAmount+ +-- | A type defining the parameters used to generate the +-- calculation period dates schedule, including the +-- specification of any initial or final stub calculation +-- periods. A calculation perod schedule consists of an +-- optional initial stub calculation period, one or more +-- regular calculation periods and an optional final stub +-- calculation period. In the absence of any initial or final +-- stub calculation periods, the regular part of the +-- calculation period schedule is assumed to be between the +-- effective date and the termination date. No implicit stubs +-- are allowed, i.e. stubs must be explicitly specified using +-- an appropriate combination of firstPeriodStateDate, +-- firstRegularPeriodStartDate and lastRegularPeriodEndDate. +data CalculationPeriodDates+instance Eq CalculationPeriodDates+instance Show CalculationPeriodDates+instance SchemaType CalculationPeriodDates+ +-- | Reference to a calculation period dates component. +data CalculationPeriodDatesReference+instance Eq CalculationPeriodDatesReference+instance Show CalculationPeriodDatesReference+instance SchemaType CalculationPeriodDatesReference+instance Extension CalculationPeriodDatesReference Reference+ +-- | A type defining the right of a party to cancel a swap +-- transaction on the specified exercise dates. The provision +-- is for 'walkaway' cancellation (i.e. the fair value of the +-- swap is not paid). A fee payable on exercise can be +-- specified. +data CancelableProvision+instance Eq CancelableProvision+instance Show CancelableProvision+instance SchemaType CancelableProvision+ +-- | A type to define the adjusted dates for a cancelable +-- provision on a swap transaction. +data CancelableProvisionAdjustedDates+instance Eq CancelableProvisionAdjustedDates+instance Show CancelableProvisionAdjustedDates+instance SchemaType CancelableProvisionAdjustedDates+ +-- | The adjusted dates for a specific cancellation date, +-- including the adjusted exercise date and adjusted +-- termination date. +data CancellationEvent+instance Eq CancellationEvent+instance Show CancellationEvent+instance SchemaType CancellationEvent+ +-- | A type defining an interest rate cap, floor, or cap/floor +-- strategy (e.g. collar) product. +data CapFloor+instance Eq CapFloor+instance Show CapFloor+instance SchemaType CapFloor+instance Extension CapFloor Product+ +-- | A type defining the cashflow representation of a swap +-- trade. +data Cashflows+instance Eq Cashflows+instance Show Cashflows+instance SchemaType Cashflows+ +-- | A type defining the parameters necessary for each of the +-- ISDA cash price methods for cash settlement. +data CashPriceMethod+instance Eq CashPriceMethod+instance Show CashPriceMethod+instance SchemaType CashPriceMethod+ +-- | A type to define the cash settlement terms for a product +-- where cash settlement is applicable. +data CashSettlement+instance Eq CashSettlement+instance Show CashSettlement+instance SchemaType CashSettlement+ +-- | A type defining the cash settlement payment date(s) as +-- either a set of explicit dates, together with applicable +-- adjustments, or as a date relative to some other (anchor) +-- date, or as any date in a range of contiguous business +-- days. +data CashSettlementPaymentDate+instance Eq CashSettlementPaymentDate+instance Show CashSettlementPaymentDate+instance SchemaType CashSettlementPaymentDate+ +data CrossCurrencyMethod+instance Eq CrossCurrencyMethod+instance Show CrossCurrencyMethod+instance SchemaType CrossCurrencyMethod+ +-- | A type to provide the ability to point to multiple payment +-- nodes in the document through the unbounded +-- paymentDatesReference. +data DateRelativeToCalculationPeriodDates+instance Eq DateRelativeToCalculationPeriodDates+instance Show DateRelativeToCalculationPeriodDates+instance SchemaType DateRelativeToCalculationPeriodDates+ +-- | A type to provide the ability to point to multiple payment +-- nodes in the document through the unbounded +-- paymentDatesReference. +data DateRelativeToPaymentDates+instance Eq DateRelativeToPaymentDates+instance Show DateRelativeToPaymentDates+instance SchemaType DateRelativeToPaymentDates+ +-- | A type defining discounting information. The 2000 ISDA +-- definitions, section 8.4. discounting (related to the +-- calculation of a discounted fixed amount or floating +-- amount) apply. This type must only be included if +-- discounting applies. +data Discounting+instance Eq Discounting+instance Show Discounting+instance SchemaType Discounting+ +-- | A type to define the adjusted dates associated with an +-- early termination provision. +data EarlyTerminationEvent+instance Eq EarlyTerminationEvent+instance Show EarlyTerminationEvent+instance SchemaType EarlyTerminationEvent+ +-- | A type defining an early termination provision for a swap. +-- This early termination is at fair value, i.e. on +-- termination the fair value of the product must be settled +-- between the parties. +data EarlyTerminationProvision+instance Eq EarlyTerminationProvision+instance Show EarlyTerminationProvision+instance SchemaType EarlyTerminationProvision+ +-- | A type defining the adjusted dates associated with a +-- particular exercise event. +data ExerciseEvent+instance Eq ExerciseEvent+instance Show ExerciseEvent+instance SchemaType ExerciseEvent+ +-- | This defines the time interval to the start of the exercise +-- period, i.e. the earliest exercise date, and the frequency +-- of subsequent exercise dates (if any). +data ExercisePeriod+instance Eq ExercisePeriod+instance Show ExercisePeriod+instance SchemaType ExercisePeriod+ +-- | A type defining an option to extend an existing swap +-- transaction on the specified exercise dates for a term +-- ending on the specified new termination date. +data ExtendibleProvision+instance Eq ExtendibleProvision+instance Show ExtendibleProvision+instance SchemaType ExtendibleProvision+ +-- | A type defining the adjusted dates associated with a +-- provision to extend a swap. +data ExtendibleProvisionAdjustedDates+instance Eq ExtendibleProvisionAdjustedDates+instance Show ExtendibleProvisionAdjustedDates+instance SchemaType ExtendibleProvisionAdjustedDates+ +-- | A type to define the adjusted dates associated with an +-- individual extension event. +data ExtensionEvent+instance Eq ExtensionEvent+instance Show ExtensionEvent+instance SchemaType ExtensionEvent+ +-- | A type to define business date convention adjustment to +-- final payment period per leg. +data FinalCalculationPeriodDateAdjustment+instance Eq FinalCalculationPeriodDateAdjustment+instance Show FinalCalculationPeriodDateAdjustment+instance SchemaType FinalCalculationPeriodDateAdjustment+ +-- | The method, prioritzed by the order it is listed in this +-- element, to get a replacement rate for the disrupted +-- settlement rate option. +data FallbackReferencePrice+instance Eq FallbackReferencePrice+instance Show FallbackReferencePrice+instance SchemaType FallbackReferencePrice+ +-- | A type defining parameters associated with a floating rate +-- reset. This type forms part of the cashflows representation +-- of a stream. +data FloatingRateDefinition+instance Eq FloatingRateDefinition+instance Show FloatingRateDefinition+instance SchemaType FloatingRateDefinition+ +-- | A type defining a Forward Rate Agreement (FRA) product. +data Fra+instance Eq Fra+instance Show Fra+instance SchemaType Fra+instance Extension Fra Product+ +-- | A type that is extending the Offset structure for providing +-- the ability to specify an FX fixing date as an offset to +-- dates specified somewhere else in the document. +data FxFixingDate+instance Eq FxFixingDate+instance Show FxFixingDate+instance SchemaType FxFixingDate+instance Extension FxFixingDate Offset+instance Extension FxFixingDate Period+ +-- | A type to describe the cashflow representation for fx +-- linked notionals. +data FxLinkedNotionalAmount+instance Eq FxLinkedNotionalAmount+instance Show FxLinkedNotionalAmount+instance SchemaType FxLinkedNotionalAmount+ +-- | A type to describe a notional schedule where each notional +-- that applies to a calculation period is calculated with +-- reference to a notional amount or notional amount schedule +-- in a different currency by means of a spot currency +-- exchange rate which is normally observed at the beginning +-- of each period. +data FxLinkedNotionalSchedule+instance Eq FxLinkedNotionalSchedule+instance Show FxLinkedNotionalSchedule+instance SchemaType FxLinkedNotionalSchedule+ +-- | A type defining the components specifiying an Inflation +-- Rate Calculation +data InflationRateCalculation+instance Eq InflationRateCalculation+instance Show InflationRateCalculation+instance SchemaType InflationRateCalculation+instance Extension InflationRateCalculation FloatingRateCalculation+instance Extension InflationRateCalculation FloatingRate+instance Extension InflationRateCalculation Rate+ +-- | A type defining the components specifiying an interest rate +-- stream, including both a parametric and cashflow +-- representation for the stream of payments. +data InterestRateStream+instance Eq InterestRateStream+instance Show InterestRateStream+instance SchemaType InterestRateStream+instance Extension InterestRateStream Leg+ +-- | Reference to an InterestRateStream component. +data InterestRateStreamReference+instance Eq InterestRateStreamReference+instance Show InterestRateStreamReference+instance SchemaType InterestRateStreamReference+instance Extension InterestRateStreamReference Reference+ +-- | A type to define an early termination provision for which +-- exercise is mandatory. +data MandatoryEarlyTermination+instance Eq MandatoryEarlyTermination+instance Show MandatoryEarlyTermination+instance SchemaType MandatoryEarlyTermination+ +-- | A type defining the adjusted dates associated with a +-- mandatory early termination provision. +data MandatoryEarlyTerminationAdjustedDates+instance Eq MandatoryEarlyTerminationAdjustedDates+instance Show MandatoryEarlyTerminationAdjustedDates+instance SchemaType MandatoryEarlyTerminationAdjustedDates+ +-- | A type defining the parameters used when the reference +-- currency of the swapStream is non-deliverable. +data NonDeliverableSettlement+instance Eq NonDeliverableSettlement+instance Show NonDeliverableSettlement+instance SchemaType NonDeliverableSettlement+ +-- | An type defining the notional amount or notional amount +-- schedule associated with a swap stream. The notional +-- schedule will be captured explicitly, specifying the dates +-- that the notional changes and the outstanding notional +-- amount that applies from that date. A parametric +-- representation of the rules defining the notional step +-- schedule can optionally be included. +data Notional+instance Eq Notional+instance Show Notional+instance SchemaType Notional+ +-- | A type defining a parametric representation of the notional +-- step schedule, i.e. parameters used to generate the +-- notional balance on each step date. The step change in +-- notional can be expressed in terms of either a fixed amount +-- or as a percentage of either the initial notional or +-- previous notional amount. This parametric representation is +-- intended to cover the more common amortizing/accreting. +data NotionalStepRule+instance Eq NotionalStepRule+instance Show NotionalStepRule+instance SchemaType NotionalStepRule+ +-- | A type defining an early termination provision where either +-- or both parties have the right to exercise. +data OptionalEarlyTermination+instance Eq OptionalEarlyTermination+instance Show OptionalEarlyTermination+instance SchemaType OptionalEarlyTermination+ +-- | A type defining the adjusted dates associated with an +-- optional early termination provision. +data OptionalEarlyTerminationAdjustedDates+instance Eq OptionalEarlyTerminationAdjustedDates+instance Show OptionalEarlyTerminationAdjustedDates+instance SchemaType OptionalEarlyTerminationAdjustedDates+ +-- | A type defining the adjusted payment date and associated +-- calculation period parameters required to calculate the +-- actual or projected payment amount. This type forms part of +-- the cashflow representation of a swap stream. +data PaymentCalculationPeriod+instance Eq PaymentCalculationPeriod+instance Show PaymentCalculationPeriod+instance SchemaType PaymentCalculationPeriod+instance Extension PaymentCalculationPeriod PaymentBase+ +-- | A type defining parameters used to generate the payment +-- dates schedule, including the specification of early or +-- delayed payments. Payment dates are determined relative to +-- the calculation period dates or the reset dates. +data PaymentDates+instance Eq PaymentDates+instance Show PaymentDates+instance SchemaType PaymentDates+ +-- | Reference to a payment dates structure. +data PaymentDatesReference+instance Eq PaymentDatesReference+instance Show PaymentDatesReference+instance SchemaType PaymentDatesReference+instance Extension PaymentDatesReference Reference+ +-- | A type defining the parameters used to get a price quote to +-- replace the settlement rate option that is disrupted. +data PriceSourceDisruption+instance Eq PriceSourceDisruption+instance Show PriceSourceDisruption+instance SchemaType PriceSourceDisruption+ +-- | A type defining a principal exchange amount and adjusted +-- exchange date. The type forms part of the cashflow +-- representation of a swap stream. +data PrincipalExchange+instance Eq PrincipalExchange+instance Show PrincipalExchange+instance SchemaType PrincipalExchange+ +-- | Reference to relevant underlying date. +data RelevantUnderlyingDateReference+instance Eq RelevantUnderlyingDateReference+instance Show RelevantUnderlyingDateReference+instance SchemaType RelevantUnderlyingDateReference+instance Extension RelevantUnderlyingDateReference Reference+ +-- | A type defining the parameters used to generate the reset +-- dates schedule and associated fixing dates. The reset dates +-- are determined relative to the calculation periods +-- schedules dates. +data ResetDates+instance Eq ResetDates+instance Show ResetDates+instance SchemaType ResetDates+ +-- | Reference to a reset dates component. +data ResetDatesReference+instance Eq ResetDatesReference+instance Show ResetDatesReference+instance SchemaType ResetDatesReference+instance Extension ResetDatesReference Reference+ +-- | A type defining the specification of settlement terms, +-- occuring when the settlement currency is different to the +-- notional currency of the trade. +data SettlementProvision+instance Eq SettlementProvision+instance Show SettlementProvision+instance SchemaType SettlementProvision+ +-- | A type defining the settlement rate options through a +-- scheme reflecting the terms of the Annex A to the 1998 FX +-- and Currency Option Definitions. +data SettlementRateOption+data SettlementRateOptionAttributes+instance Eq SettlementRateOption+instance Eq SettlementRateOptionAttributes+instance Show SettlementRateOption+instance Show SettlementRateOptionAttributes+instance SchemaType SettlementRateOption+instance Extension SettlementRateOption Scheme+ +-- | A type describing the buyer and seller of an option. +data SinglePartyOption+instance Eq SinglePartyOption+instance Show SinglePartyOption+instance SchemaType SinglePartyOption+ +-- | A type defining how the initial or final stub calculation +-- period amounts is calculated. For example, the rate to be +-- applied to the initial or final stub calculation period may +-- be the linear interpolation of two different tenors for the +-- floating rate index specified in the calculation period +-- amount component, e.g. A two month stub period may used the +-- linear interpolation of a one month and three month +-- floating rate. The different rate tenors would be specified +-- in this component. Note that a maximum of two rate tenors +-- can be specified. If a stub period uses a single index +-- tenor and this is the same as that specified in the +-- calculation period amount component then the initial stub +-- or final stub component, as the case may be, must not be +-- included. +data StubCalculationPeriodAmount+instance Eq StubCalculationPeriodAmount+instance Show StubCalculationPeriodAmount+instance SchemaType StubCalculationPeriodAmount+ +-- | A type defining swap streams and additional payments +-- between the principal parties involved in the swap. +data Swap+instance Eq Swap+instance Show Swap+instance SchemaType Swap+instance Extension Swap Product+ +-- | Additional terms to a swap contract. +data SwapAdditionalTerms+instance Eq SwapAdditionalTerms+instance Show SwapAdditionalTerms+instance SchemaType SwapAdditionalTerms+ +-- | A type to define an option on a swap. +data Swaption+instance Eq Swaption+instance Show Swaption+instance SchemaType Swaption+instance Extension Swaption Product+ +-- | A type describing the adjusted dates associated with +-- swaption exercise and settlement. +data SwaptionAdjustedDates+instance Eq SwaptionAdjustedDates+instance Show SwaptionAdjustedDates+instance SchemaType SwaptionAdjustedDates+ +data SwaptionPhysicalSettlement+instance Eq SwaptionPhysicalSettlement+instance Show SwaptionPhysicalSettlement+instance SchemaType SwaptionPhysicalSettlement+ +-- | Reference to a Valuation dates node. +data ValuationDatesReference+instance Eq ValuationDatesReference+instance Show ValuationDatesReference+instance SchemaType ValuationDatesReference+instance Extension ValuationDatesReference Reference+ +-- | Specifies how long to wait to get a quote from a settlement +-- rate option upon a price source disruption. +data ValuationPostponement+instance Eq ValuationPostponement+instance Show ValuationPostponement+instance SchemaType ValuationPostponement+ +-- | A type defining the parameters required for each of the +-- ISDA defined yield curve methods for cash settlement. +data YieldCurveMethod+instance Eq YieldCurveMethod+instance Show YieldCurveMethod+instance SchemaType YieldCurveMethod+ +-- | A product to represent a single known payment. +elementBulletPayment :: XMLParser BulletPayment+elementToXMLBulletPayment :: BulletPayment -> [Content ()]+ +-- | A cap, floor or cap floor structures product definition. +elementCapFloor :: XMLParser CapFloor+elementToXMLCapFloor :: CapFloor -> [Content ()]+ +-- | A floating rate calculation definition. +elementFloatingRateCalculation :: XMLParser FloatingRateCalculation+elementToXMLFloatingRateCalculation :: FloatingRateCalculation -> [Content ()]+ +-- | A forward rate agreement product definition. +elementFra :: XMLParser Fra+elementToXMLFra :: Fra -> [Content ()]+ +-- | An inflation rate calculation definition. +elementInflationRateCalculation :: XMLParser InflationRateCalculation+elementToXMLInflationRateCalculation :: InflationRateCalculation -> [Content ()]+ +-- | The base element for the floating rate calculation +-- definitions. +elementRateCalculation :: XMLParser Rate+ +-- | A swap product definition. +elementSwap :: XMLParser Swap+elementToXMLSwap :: Swap -> [Content ()]+ +-- | A swaption product definition. +elementSwaption :: XMLParser Swaption+elementToXMLSwaption :: Swaption -> [Content ()]+ + +
+ Data/FpML/V53/Main.hs view
@@ -0,0 +1,156 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Main+ ( module Data.FpML.V53.Main+ , module Data.FpML.V53.Generic+ , module Data.FpML.V53.Standard+ , module Data.FpML.V53.IRD+ , module Data.FpML.V53.FX+ , module Data.FpML.V53.Eqd+ , module Data.FpML.V53.Swaps.Return+ , module Data.FpML.V53.CD+ , module Data.FpML.V53.Option.Bond+ , module Data.FpML.V53.Swaps.Correlation+ , module Data.FpML.V53.Swaps.Dividend+ , module Data.FpML.V53.Swaps.Variance+ , module Data.FpML.V53.Com+ , module Data.FpML.V53.Notification.CreditEvent+ , module Data.FpML.V53.Reporting.Valuation+ , module Data.FpML.V53.Processes.Recordkeeping+ , module Data.FpML.V53.Valuation+ ) 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.Generic+import Data.FpML.V53.Standard+import Data.FpML.V53.IRD+import Data.FpML.V53.FX+import Data.FpML.V53.Eqd+import Data.FpML.V53.Swaps.Return+import Data.FpML.V53.CD+import Data.FpML.V53.Option.Bond+import Data.FpML.V53.Swaps.Correlation+import Data.FpML.V53.Swaps.Dividend+import Data.FpML.V53.Swaps.Variance+import Data.FpML.V53.Com+import Data.FpML.V53.Notification.CreditEvent+import Data.FpML.V53.Reporting.Valuation+import Data.FpML.V53.Processes.Recordkeeping+import Data.FpML.V53.Valuation+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | products+ +-- | business process messaging+ +-- | reporting and settlement+ +-- | A type defining a content model that includes valuation +-- (pricing and risk) data without expressing any processing +-- intention.+data ValuationDocument = ValuationDocument+ { valDocum_fpmlVersion :: Xsd.XsdString+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , valDocum_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , valDocum_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , valDocum_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , valDocum_choice1 :: (Maybe (OneOf2 Xsd.Boolean Xsd.Boolean))+ -- ^ Choice between:+ -- + -- (1) Indicates if this message corrects an earlier request.+ -- + -- (2) Indicates if this message corrects an earlier request.+ , valDocum_onBehalfOf :: Maybe OnBehalfOf+ -- ^ Indicates which party (and accounts) a trade is being + -- processed for.+ , valDocum_originatingEvent :: Maybe OriginatingEvent+ , valDocum_trade :: [Trade]+ -- ^ The root element in an FpML trade document.+ , valDocum_party :: [Party]+ , valDocum_account :: [Account]+ -- ^ Optional account information used to precisely define the + -- origination and destination of financial instruments.+ , valDocum_market :: [Market]+ -- ^ This is a global element used for creating global types. It + -- holds Market information, e.g. curves, surfaces, quotes, + -- etc.+ , valDocum_valuationSet :: [ValuationSet]+ }+ deriving (Eq,Show)+instance SchemaType ValuationDocument 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 (ValuationDocument 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")+ `apply` many (elementMarket)+ `apply` many (elementValuationSet)+ schemaTypeToXML s x@ValuationDocument{} =+ toXMLElement s [ toXMLAttribute "fpmlVersion" $ valDocum_fpmlVersion x+ , maybe [] (toXMLAttribute "expectedBuild") $ valDocum_expectedBuild x+ , maybe [] (toXMLAttribute "actualBuild") $ valDocum_actualBuild x+ ]+ [ concatMap (schemaTypeToXML "validation") $ valDocum_validation x+ , maybe [] (foldOneOf2 (schemaTypeToXML "isCorrection")+ (schemaTypeToXML "isCancellation")+ ) $ valDocum_choice1 x+ , maybe [] (schemaTypeToXML "onBehalfOf") $ valDocum_onBehalfOf x+ , maybe [] (schemaTypeToXML "originatingEvent") $ valDocum_originatingEvent x+ , concatMap (schemaTypeToXML "trade") $ valDocum_trade x+ , concatMap (schemaTypeToXML "party") $ valDocum_party x+ , concatMap (schemaTypeToXML "account") $ valDocum_account x+ , concatMap (elementToXMLMarket) $ valDocum_market x+ , concatMap (elementToXMLValuationSet) $ valDocum_valuationSet x+ ]+instance Extension ValuationDocument DataDocument where+ supertype (ValuationDocument a0 a1 a2 e0 e1 e2 e3 e4 e5 e6 e7 e8) =+ DataDocument a0 a1 a2 e0 e1 e2 e3 e4 e5 e6+instance Extension ValuationDocument Document where+ supertype = (supertype :: DataDocument -> Document)+ . (supertype :: ValuationDocument -> DataDocument)+ + +-- | A document containing trade and/or portfolio and/or party +-- data without expressing any processing intention.+elementDataDocument :: XMLParser DataDocument+elementDataDocument = parseSchemaType "dataDocument"+elementToXMLDataDocument :: DataDocument -> [Content ()]+elementToXMLDataDocument = schemaTypeToXML "dataDocument"+ +-- | A document that includes trade and/or valuation (pricing +-- and risk) data without expressing any processing intention.+elementValuationDocument :: XMLParser ValuationDocument+elementValuationDocument = parseSchemaType "valuationDocument"+elementToXMLValuationDocument :: ValuationDocument -> [Content ()]+elementToXMLValuationDocument = schemaTypeToXML "valuationDocument"
+ Data/FpML/V53/Main.hs-boot view
@@ -0,0 +1,67 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Main+ ( module Data.FpML.V53.Main+ , module Data.FpML.V53.Generic+ , module Data.FpML.V53.Standard+ , module Data.FpML.V53.IRD+ , module Data.FpML.V53.FX+ , module Data.FpML.V53.Eqd+ , module Data.FpML.V53.Swaps.Return+ , module Data.FpML.V53.CD+ , module Data.FpML.V53.Option.Bond+ , module Data.FpML.V53.Swaps.Correlation+ , module Data.FpML.V53.Swaps.Dividend+ , module Data.FpML.V53.Swaps.Variance+ , module Data.FpML.V53.Com+ , module Data.FpML.V53.Notification.CreditEvent+ , module Data.FpML.V53.Reporting.Valuation+ , module Data.FpML.V53.Processes.Recordkeeping+ , module Data.FpML.V53.Valuation+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Generic+import {-# SOURCE #-} Data.FpML.V53.Standard+import {-# SOURCE #-} Data.FpML.V53.IRD+import {-# SOURCE #-} Data.FpML.V53.FX+import {-# SOURCE #-} Data.FpML.V53.Eqd+import {-# SOURCE #-} Data.FpML.V53.Swaps.Return+import {-# SOURCE #-} Data.FpML.V53.CD+import {-# SOURCE #-} Data.FpML.V53.Option.Bond+import {-# SOURCE #-} Data.FpML.V53.Swaps.Correlation+import {-# SOURCE #-} Data.FpML.V53.Swaps.Dividend+import {-# SOURCE #-} Data.FpML.V53.Swaps.Variance+import {-# SOURCE #-} Data.FpML.V53.Com+import {-# SOURCE #-} Data.FpML.V53.Notification.CreditEvent+import {-# SOURCE #-} Data.FpML.V53.Reporting.Valuation+import {-# SOURCE #-} Data.FpML.V53.Processes.Recordkeeping+import {-# SOURCE #-} Data.FpML.V53.Valuation+ +-- | products + +-- | business process messaging + +-- | reporting and settlement + +-- | A type defining a content model that includes valuation +-- (pricing and risk) data without expressing any processing +-- intention. +data ValuationDocument+instance Eq ValuationDocument+instance Show ValuationDocument+instance SchemaType ValuationDocument+instance Extension ValuationDocument DataDocument+instance Extension ValuationDocument Document+ +-- | A document containing trade and/or portfolio and/or party +-- data without expressing any processing intention. +elementDataDocument :: XMLParser DataDocument+elementToXMLDataDocument :: DataDocument -> [Content ()]+ +-- | A document that includes trade and/or valuation (pricing +-- and risk) data without expressing any processing intention. +elementValuationDocument :: XMLParser ValuationDocument+elementToXMLValuationDocument :: ValuationDocument -> [Content ()]
+ Data/FpML/V53/Mktenv.hs view
@@ -0,0 +1,1081 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Mktenv+ ( module Data.FpML.V53.Mktenv+ , module Data.FpML.V53.Doc+ , module Data.FpML.V53.Asset+ , module Data.FpML.V53.Riskdef+ , module Data.FpML.V53.CD+ ) 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.Doc+import Data.FpML.V53.Asset+import Data.FpML.V53.Riskdef+import Data.FpML.V53.CD+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | The frequency at which a rate is compounded.+data CompoundingFrequency = CompoundingFrequency Scheme CompoundingFrequencyAttributes deriving (Eq,Show)+data CompoundingFrequencyAttributes = CompoundingFrequencyAttributes+ { compoFrequAttrib_compoundingFrequencyScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CompoundingFrequency where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "compoundingFrequencyScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CompoundingFrequency v (CompoundingFrequencyAttributes a0)+ schemaTypeToXML s (CompoundingFrequency bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "compoundingFrequencyScheme") $ compoFrequAttrib_compoundingFrequencyScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CompoundingFrequency Scheme where+ supertype (CompoundingFrequency s _) = s+ +-- | A generic credit curve definition.+data CreditCurve = CreditCurve+ { creditCurve_ID :: Maybe Xsd.ID+ , creditCurve_name :: Maybe Xsd.NormalizedString+ -- ^ The name of the structure, e.g "USDLIBOR-3M EOD Curve".+ , creditCurve_currency :: Maybe Currency+ -- ^ The currency that the structure is expressed in (this is + -- relevant mostly for the Interes Rates asset class).+ , creditCurve_choice2 :: (Maybe (OneOf2 LegalEntity LegalEntityReference))+ -- ^ Choice between:+ -- + -- (1) The entity for which this is defined.+ -- + -- (2) An XML reference a credit entity defined elsewhere in + -- the document.+ , creditCurve_creditEvents :: Maybe CreditEvents+ -- ^ The material credit event.+ , creditCurve_seniority :: Maybe CreditSeniority+ -- ^ The level of seniority of the deliverable obligation.+ , creditCurve_secured :: Maybe Xsd.Boolean+ -- ^ Whether the deliverable obligation is secured or unsecured.+ , creditCurve_obligationCurrency :: Maybe Currency+ -- ^ The currency of denomination of the deliverable obligation.+ , creditCurve_obligations :: Maybe Obligations+ -- ^ The underlying obligations of the reference entity on which + -- you are buying or selling protection+ , creditCurve_deliverableObligations :: Maybe DeliverableObligations+ -- ^ What sort of obligation may be delivered in the event of + -- the credit event. ISDA 2003 Term: Obligation + -- Category/Deliverable Obligation Category+ }+ deriving (Eq,Show)+instance SchemaType CreditCurve where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CreditCurve a0)+ `apply` optional (parseSchemaType "name")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (oneOf' [ ("LegalEntity", fmap OneOf2 (parseSchemaType "referenceEntity"))+ , ("LegalEntityReference", fmap TwoOf2 (parseSchemaType "creditEntityReference"))+ ])+ `apply` optional (parseSchemaType "creditEvents")+ `apply` optional (parseSchemaType "seniority")+ `apply` optional (parseSchemaType "secured")+ `apply` optional (parseSchemaType "obligationCurrency")+ `apply` optional (parseSchemaType "obligations")+ `apply` optional (parseSchemaType "deliverableObligations")+ schemaTypeToXML s x@CreditCurve{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ creditCurve_ID x+ ]+ [ maybe [] (schemaTypeToXML "name") $ creditCurve_name x+ , maybe [] (schemaTypeToXML "currency") $ creditCurve_currency x+ , maybe [] (foldOneOf2 (schemaTypeToXML "referenceEntity")+ (schemaTypeToXML "creditEntityReference")+ ) $ creditCurve_choice2 x+ , maybe [] (schemaTypeToXML "creditEvents") $ creditCurve_creditEvents x+ , maybe [] (schemaTypeToXML "seniority") $ creditCurve_seniority x+ , maybe [] (schemaTypeToXML "secured") $ creditCurve_secured x+ , maybe [] (schemaTypeToXML "obligationCurrency") $ creditCurve_obligationCurrency x+ , maybe [] (schemaTypeToXML "obligations") $ creditCurve_obligations x+ , maybe [] (schemaTypeToXML "deliverableObligations") $ creditCurve_deliverableObligations x+ ]+instance Extension CreditCurve PricingStructure where+ supertype v = PricingStructure_CreditCurve v+ +-- | A set of credit curve values, which can include pricing +-- inputs (which are typically credit spreads), default +-- probabilities, and recovery rates.+data CreditCurveValuation = CreditCurveValuation+ { creditCurveVal_ID :: Maybe Xsd.ID+ , creditCurveVal_definitionRef :: Maybe Xsd.IDREF+ -- ^ An optional reference to the scenario that this valuation + -- applies to.+ , creditCurveVal_objectReference :: Maybe AnyAssetReference+ -- ^ A reference to the asset or pricing structure that this + -- values.+ , creditCurveVal_valuationScenarioReference :: Maybe ValuationScenarioReference+ -- ^ A reference to the valuation scenario used to calculate + -- this valuation. If the Valuation occurs within a + -- ValuationSet, this value is optional and is defaulted from + -- the ValuationSet. If this value occurs in both places, the + -- lower level value (i.e. the one here) overrides that in the + -- higher (i.e. ValuationSet).+ , creditCurveVal_baseDate :: Maybe IdentifiedDate+ -- ^ The base date for which the structure applies, i.e. the + -- curve date. Normally this will align with the valuation + -- date.+ , creditCurveVal_spotDate :: Maybe IdentifiedDate+ -- ^ The spot settlement date for which the structure applies, + -- normally 0-2 days after the base date. The difference + -- between the baseDate and the spotDate is termed the + -- settlement lag, and is sometimes called "days to spot".+ , creditCurveVal_inputDataDate :: Maybe IdentifiedDate+ -- ^ The date from which the input data used to construct the + -- pricing input was obtained. Often the same as the baseDate, + -- but sometimes the pricing input may be "rolled forward", in + -- which input data from one date is used to generate a curve + -- for a later date.+ , creditCurveVal_endDate :: Maybe IdentifiedDate+ -- ^ The last date for which data is supplied in this pricing + -- input.+ , creditCurveVal_buildDateTime :: Maybe Xsd.DateTime+ -- ^ The date and time when the pricing input was generated.+ , creditCurveVal_inputs :: Maybe QuotedAssetSet+ , creditCurveVal_defaultProbabilityCurve :: Maybe DefaultProbabilityCurve+ -- ^ A curve of default probabilities.+ , creditCurveVal_choice9 :: (Maybe (OneOf2 Xsd.Decimal TermCurve))+ -- ^ Choice between:+ -- + -- (1) A single recovery rate, to be used for all terms.+ -- + -- (2) A curve of recovery rates, allowing different terms to + -- have different recovery rates.+ }+ deriving (Eq,Show)+instance SchemaType CreditCurveValuation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ a1 <- optional $ getAttribute "definitionRef" e pos+ commit $ interior e $ return (CreditCurveValuation a0 a1)+ `apply` optional (parseSchemaType "objectReference")+ `apply` optional (parseSchemaType "valuationScenarioReference")+ `apply` optional (parseSchemaType "baseDate")+ `apply` optional (parseSchemaType "spotDate")+ `apply` optional (parseSchemaType "inputDataDate")+ `apply` optional (parseSchemaType "endDate")+ `apply` optional (parseSchemaType "buildDateTime")+ `apply` optional (parseSchemaType "inputs")+ `apply` optional (parseSchemaType "defaultProbabilityCurve")+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "recoveryRate"))+ , ("TermCurve", fmap TwoOf2 (parseSchemaType "recoveryRateCurve"))+ ])+ schemaTypeToXML s x@CreditCurveValuation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ creditCurveVal_ID x+ , maybe [] (toXMLAttribute "definitionRef") $ creditCurveVal_definitionRef x+ ]+ [ maybe [] (schemaTypeToXML "objectReference") $ creditCurveVal_objectReference x+ , maybe [] (schemaTypeToXML "valuationScenarioReference") $ creditCurveVal_valuationScenarioReference x+ , maybe [] (schemaTypeToXML "baseDate") $ creditCurveVal_baseDate x+ , maybe [] (schemaTypeToXML "spotDate") $ creditCurveVal_spotDate x+ , maybe [] (schemaTypeToXML "inputDataDate") $ creditCurveVal_inputDataDate x+ , maybe [] (schemaTypeToXML "endDate") $ creditCurveVal_endDate x+ , maybe [] (schemaTypeToXML "buildDateTime") $ creditCurveVal_buildDateTime x+ , maybe [] (schemaTypeToXML "inputs") $ creditCurveVal_inputs x+ , maybe [] (schemaTypeToXML "defaultProbabilityCurve") $ creditCurveVal_defaultProbabilityCurve x+ , maybe [] (foldOneOf2 (schemaTypeToXML "recoveryRate")+ (schemaTypeToXML "recoveryRateCurve")+ ) $ creditCurveVal_choice9 x+ ]+instance Extension CreditCurveValuation PricingStructureValuation where+ supertype (CreditCurveValuation a0 a1 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9) =+ PricingStructureValuation a0 a1 e0 e1 e2 e3 e4 e5 e6+instance Extension CreditCurveValuation Valuation where+ supertype = (supertype :: PricingStructureValuation -> Valuation)+ . (supertype :: CreditCurveValuation -> PricingStructureValuation)+ + +-- | A set of default probabilities.+data DefaultProbabilityCurve = DefaultProbabilityCurve+ { defaultProbabCurve_ID :: Maybe Xsd.ID+ , defaultProbabCurve_definitionRef :: Maybe Xsd.IDREF+ -- ^ An optional reference to the scenario that this valuation + -- applies to.+ , defaultProbabCurve_objectReference :: Maybe AnyAssetReference+ -- ^ A reference to the asset or pricing structure that this + -- values.+ , defaultProbabCurve_valuationScenarioReference :: Maybe ValuationScenarioReference+ -- ^ A reference to the valuation scenario used to calculate + -- this valuation. If the Valuation occurs within a + -- ValuationSet, this value is optional and is defaulted from + -- the ValuationSet. If this value occurs in both places, the + -- lower level value (i.e. the one here) overrides that in the + -- higher (i.e. ValuationSet).+ , defaultProbabCurve_baseDate :: Maybe IdentifiedDate+ -- ^ The base date for which the structure applies, i.e. the + -- curve date. Normally this will align with the valuation + -- date.+ , defaultProbabCurve_spotDate :: Maybe IdentifiedDate+ -- ^ The spot settlement date for which the structure applies, + -- normally 0-2 days after the base date. The difference + -- between the baseDate and the spotDate is termed the + -- settlement lag, and is sometimes called "days to spot".+ , defaultProbabCurve_inputDataDate :: Maybe IdentifiedDate+ -- ^ The date from which the input data used to construct the + -- pricing input was obtained. Often the same as the baseDate, + -- but sometimes the pricing input may be "rolled forward", in + -- which input data from one date is used to generate a curve + -- for a later date.+ , defaultProbabCurve_endDate :: Maybe IdentifiedDate+ -- ^ The last date for which data is supplied in this pricing + -- input.+ , defaultProbabCurve_buildDateTime :: Maybe Xsd.DateTime+ -- ^ The date and time when the pricing input was generated.+ , defaultProbabCurve_baseYieldCurve :: Maybe PricingStructureReference+ -- ^ A reference to the yield curve values used as a basis for + -- this credit curve valuation.+ , defaultProbabCurve_defaultProbabilities :: Maybe TermCurve+ -- ^ A collection of default probabilities.+ }+ deriving (Eq,Show)+instance SchemaType DefaultProbabilityCurve where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ a1 <- optional $ getAttribute "definitionRef" e pos+ commit $ interior e $ return (DefaultProbabilityCurve a0 a1)+ `apply` optional (parseSchemaType "objectReference")+ `apply` optional (parseSchemaType "valuationScenarioReference")+ `apply` optional (parseSchemaType "baseDate")+ `apply` optional (parseSchemaType "spotDate")+ `apply` optional (parseSchemaType "inputDataDate")+ `apply` optional (parseSchemaType "endDate")+ `apply` optional (parseSchemaType "buildDateTime")+ `apply` optional (parseSchemaType "baseYieldCurve")+ `apply` optional (parseSchemaType "defaultProbabilities")+ schemaTypeToXML s x@DefaultProbabilityCurve{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ defaultProbabCurve_ID x+ , maybe [] (toXMLAttribute "definitionRef") $ defaultProbabCurve_definitionRef x+ ]+ [ maybe [] (schemaTypeToXML "objectReference") $ defaultProbabCurve_objectReference x+ , maybe [] (schemaTypeToXML "valuationScenarioReference") $ defaultProbabCurve_valuationScenarioReference x+ , maybe [] (schemaTypeToXML "baseDate") $ defaultProbabCurve_baseDate x+ , maybe [] (schemaTypeToXML "spotDate") $ defaultProbabCurve_spotDate x+ , maybe [] (schemaTypeToXML "inputDataDate") $ defaultProbabCurve_inputDataDate x+ , maybe [] (schemaTypeToXML "endDate") $ defaultProbabCurve_endDate x+ , maybe [] (schemaTypeToXML "buildDateTime") $ defaultProbabCurve_buildDateTime x+ , maybe [] (schemaTypeToXML "baseYieldCurve") $ defaultProbabCurve_baseYieldCurve x+ , maybe [] (schemaTypeToXML "defaultProbabilities") $ defaultProbabCurve_defaultProbabilities x+ ]+instance Extension DefaultProbabilityCurve PricingStructureValuation where+ supertype (DefaultProbabilityCurve a0 a1 e0 e1 e2 e3 e4 e5 e6 e7 e8) =+ PricingStructureValuation a0 a1 e0 e1 e2 e3 e4 e5 e6+instance Extension DefaultProbabilityCurve Valuation where+ supertype = (supertype :: PricingStructureValuation -> Valuation)+ . (supertype :: DefaultProbabilityCurve -> PricingStructureValuation)+ + +-- | A curve used to model a set of forward interest rates. Used +-- for forecasting interest rates as part of a pricing +-- calculation.+data ForwardRateCurve = ForwardRateCurve+ { forwardRateCurve_assetReference :: Maybe AssetReference+ -- ^ A reference to the rate index whose forwards are modeled.+ , forwardRateCurve_rateCurve :: Maybe TermCurve+ -- ^ The curve of forward values.+ }+ deriving (Eq,Show)+instance SchemaType ForwardRateCurve where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ForwardRateCurve+ `apply` optional (parseSchemaType "assetReference")+ `apply` optional (parseSchemaType "rateCurve")+ schemaTypeToXML s x@ForwardRateCurve{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "assetReference") $ forwardRateCurve_assetReference x+ , maybe [] (schemaTypeToXML "rateCurve") $ forwardRateCurve_rateCurve x+ ]+ +-- | An fx curve object., which includes pricing inputs and term +-- structures for fx forwards.+data FxCurve = FxCurve+ { fxCurve_ID :: Maybe Xsd.ID+ , fxCurve_name :: Maybe Xsd.NormalizedString+ -- ^ The name of the structure, e.g "USDLIBOR-3M EOD Curve".+ , fxCurve_currency :: Maybe Currency+ -- ^ The currency that the structure is expressed in (this is + -- relevant mostly for the Interes Rates asset class).+ , fxCurve_quotedCurrencyPair :: Maybe QuotedCurrencyPair+ -- ^ Defines the two currencies for an FX trade and the + -- quotation relationship between the two currencies.+ }+ deriving (Eq,Show)+instance SchemaType FxCurve where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FxCurve a0)+ `apply` optional (parseSchemaType "name")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "quotedCurrencyPair")+ schemaTypeToXML s x@FxCurve{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxCurve_ID x+ ]+ [ maybe [] (schemaTypeToXML "name") $ fxCurve_name x+ , maybe [] (schemaTypeToXML "currency") $ fxCurve_currency x+ , maybe [] (schemaTypeToXML "quotedCurrencyPair") $ fxCurve_quotedCurrencyPair x+ ]+instance Extension FxCurve PricingStructure where+ supertype v = PricingStructure_FxCurve v+ +-- | A valuation of an FX curve object., which includes pricing +-- inputs and term structures for fx forwards.+data FxCurveValuation = FxCurveValuation+ { fxCurveVal_ID :: Maybe Xsd.ID+ , fxCurveVal_definitionRef :: Maybe Xsd.IDREF+ -- ^ An optional reference to the scenario that this valuation + -- applies to.+ , fxCurveVal_objectReference :: Maybe AnyAssetReference+ -- ^ A reference to the asset or pricing structure that this + -- values.+ , fxCurveVal_valuationScenarioReference :: Maybe ValuationScenarioReference+ -- ^ A reference to the valuation scenario used to calculate + -- this valuation. If the Valuation occurs within a + -- ValuationSet, this value is optional and is defaulted from + -- the ValuationSet. If this value occurs in both places, the + -- lower level value (i.e. the one here) overrides that in the + -- higher (i.e. ValuationSet).+ , fxCurveVal_baseDate :: Maybe IdentifiedDate+ -- ^ The base date for which the structure applies, i.e. the + -- curve date. Normally this will align with the valuation + -- date.+ , fxCurveVal_spotDate :: Maybe IdentifiedDate+ -- ^ The spot settlement date for which the structure applies, + -- normally 0-2 days after the base date. The difference + -- between the baseDate and the spotDate is termed the + -- settlement lag, and is sometimes called "days to spot".+ , fxCurveVal_inputDataDate :: Maybe IdentifiedDate+ -- ^ The date from which the input data used to construct the + -- pricing input was obtained. Often the same as the baseDate, + -- but sometimes the pricing input may be "rolled forward", in + -- which input data from one date is used to generate a curve + -- for a later date.+ , fxCurveVal_endDate :: Maybe IdentifiedDate+ -- ^ The last date for which data is supplied in this pricing + -- input.+ , fxCurveVal_buildDateTime :: Maybe Xsd.DateTime+ -- ^ The date and time when the pricing input was generated.+ , fxCurveVal_settlementCurrencyYieldCurve :: Maybe PricingStructureReference+ , fxCurveVal_forecastCurrencyYieldCurve :: Maybe PricingStructureReference+ , fxCurveVal_spotRate :: Maybe FxRateSet+ , fxCurveVal_fxForwardCurve :: Maybe TermCurve+ -- ^ A curve of fx forward rates.+ , fxCurveVal_fxForwardPointsCurve :: Maybe TermCurve+ -- ^ A curve of fx forward point spreads.+ }+ deriving (Eq,Show)+instance SchemaType FxCurveValuation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ a1 <- optional $ getAttribute "definitionRef" e pos+ commit $ interior e $ return (FxCurveValuation a0 a1)+ `apply` optional (parseSchemaType "objectReference")+ `apply` optional (parseSchemaType "valuationScenarioReference")+ `apply` optional (parseSchemaType "baseDate")+ `apply` optional (parseSchemaType "spotDate")+ `apply` optional (parseSchemaType "inputDataDate")+ `apply` optional (parseSchemaType "endDate")+ `apply` optional (parseSchemaType "buildDateTime")+ `apply` optional (parseSchemaType "settlementCurrencyYieldCurve")+ `apply` optional (parseSchemaType "forecastCurrencyYieldCurve")+ `apply` optional (parseSchemaType "spotRate")+ `apply` optional (parseSchemaType "fxForwardCurve")+ `apply` optional (parseSchemaType "fxForwardPointsCurve")+ schemaTypeToXML s x@FxCurveValuation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxCurveVal_ID x+ , maybe [] (toXMLAttribute "definitionRef") $ fxCurveVal_definitionRef x+ ]+ [ maybe [] (schemaTypeToXML "objectReference") $ fxCurveVal_objectReference x+ , maybe [] (schemaTypeToXML "valuationScenarioReference") $ fxCurveVal_valuationScenarioReference x+ , maybe [] (schemaTypeToXML "baseDate") $ fxCurveVal_baseDate x+ , maybe [] (schemaTypeToXML "spotDate") $ fxCurveVal_spotDate x+ , maybe [] (schemaTypeToXML "inputDataDate") $ fxCurveVal_inputDataDate x+ , maybe [] (schemaTypeToXML "endDate") $ fxCurveVal_endDate x+ , maybe [] (schemaTypeToXML "buildDateTime") $ fxCurveVal_buildDateTime x+ , maybe [] (schemaTypeToXML "settlementCurrencyYieldCurve") $ fxCurveVal_settlementCurrencyYieldCurve x+ , maybe [] (schemaTypeToXML "forecastCurrencyYieldCurve") $ fxCurveVal_forecastCurrencyYieldCurve x+ , maybe [] (schemaTypeToXML "spotRate") $ fxCurveVal_spotRate x+ , maybe [] (schemaTypeToXML "fxForwardCurve") $ fxCurveVal_fxForwardCurve x+ , maybe [] (schemaTypeToXML "fxForwardPointsCurve") $ fxCurveVal_fxForwardPointsCurve x+ ]+instance Extension FxCurveValuation PricingStructureValuation where+ supertype (FxCurveValuation a0 a1 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11) =+ PricingStructureValuation a0 a1 e0 e1 e2 e3 e4 e5 e6+instance Extension FxCurveValuation Valuation where+ supertype = (supertype :: PricingStructureValuation -> Valuation)+ . (supertype :: FxCurveValuation -> PricingStructureValuation)+ + +-- | A collection of spot FX rates used in pricing.+data FxRateSet = FxRateSet+ { fxRateSet_instrumentSet :: Maybe InstrumentSet+ -- ^ A collection of instruments used as a basis for quotation.+ , fxRateSet_assetQuote :: [BasicAssetValuation]+ -- ^ A collection of valuations (quotes) for the assets needed + -- in the set. Normally these quotes will be for the + -- underlying assets listed above, but they don't necesarily + -- have to be.+ }+ deriving (Eq,Show)+instance SchemaType FxRateSet where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxRateSet+ `apply` optional (parseSchemaType "instrumentSet")+ `apply` many (parseSchemaType "assetQuote")+ schemaTypeToXML s x@FxRateSet{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "instrumentSet") $ fxRateSet_instrumentSet x+ , concatMap (schemaTypeToXML "assetQuote") $ fxRateSet_assetQuote x+ ]+instance Extension FxRateSet QuotedAssetSet where+ supertype (FxRateSet e0 e1) =+ QuotedAssetSet e0 e1+ +-- | A pricing data set that contains a series of points with +-- coordinates. It is a sparse matrix representation of a +-- multi-dimensional matrix.+data MultiDimensionalPricingData = MultiDimensionalPricingData+ { multiDimensPricingData_measureType :: Maybe AssetMeasureType+ -- ^ The type of the value that is measured. This could be an + -- NPV, a cash flow, a clean price, etc.+ , multiDimensPricingData_quoteUnits :: Maybe PriceQuoteUnits+ -- ^ The optional units that the measure is expressed in. If not + -- supplied, this is assumed to be a price/value in currency + -- units.+ , multiDimensPricingData_side :: Maybe QuotationSideEnum+ -- ^ The side (bid/mid/ask) of the measure.+ , multiDimensPricingData_currency :: Maybe Currency+ -- ^ The optional currency that the measure is expressed in. If + -- not supplied, this is defaulted from the reportingCurrency + -- in the valuationScenarioDefinition.+ , multiDimensPricingData_currencyType :: Maybe ReportingCurrencyType+ -- ^ The optional currency that the measure is expressed in. If + -- not supplied, this is defaulted from the reportingCurrency + -- in the valuationScenarioDefinition.+ , multiDimensPricingData_timing :: Maybe QuoteTiming+ -- ^ When during a day the quote is for. Typically, if this + -- element is supplied, the QuoteLocation needs also to be + -- supplied.+ , multiDimensPricingData_choice6 :: (Maybe (OneOf2 BusinessCenter ExchangeId))+ -- ^ Choice between:+ -- + -- (1) A city or other business center.+ -- + -- (2) The exchange (e.g. stock or futures exchange) from + -- which the quote is obtained.+ , multiDimensPricingData_informationSource :: [InformationSource]+ -- ^ The information source where a published or displayed + -- market rate will be obtained, e.g. Telerate Page 3750.+ , multiDimensPricingData_pricingModel :: Maybe PricingModel+ -- ^ .+ , multiDimensPricingData_time :: Maybe Xsd.DateTime+ -- ^ When the quote was observed or derived.+ , multiDimensPricingData_valuationDate :: Maybe Xsd.Date+ -- ^ When the quote was computed.+ , multiDimensPricingData_expiryTime :: Maybe Xsd.DateTime+ -- ^ When does the quote cease to be valid.+ , multiDimensPricingData_cashflowType :: Maybe CashflowType+ -- ^ For cash flows, the type of the cash flows. Examples + -- include: Coupon payment, Premium Fee, Settlement Fee, + -- Brokerage Fee, etc.+ , multiDimensPricingData_point :: [PricingStructurePoint]+ }+ deriving (Eq,Show)+instance SchemaType MultiDimensionalPricingData where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return MultiDimensionalPricingData+ `apply` optional (parseSchemaType "measureType")+ `apply` optional (parseSchemaType "quoteUnits")+ `apply` optional (parseSchemaType "side")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "currencyType")+ `apply` optional (parseSchemaType "timing")+ `apply` optional (oneOf' [ ("BusinessCenter", fmap OneOf2 (parseSchemaType "businessCenter"))+ , ("ExchangeId", fmap TwoOf2 (parseSchemaType "exchangeId"))+ ])+ `apply` many (parseSchemaType "informationSource")+ `apply` optional (parseSchemaType "pricingModel")+ `apply` optional (parseSchemaType "time")+ `apply` optional (parseSchemaType "valuationDate")+ `apply` optional (parseSchemaType "expiryTime")+ `apply` optional (parseSchemaType "cashflowType")+ `apply` many (parseSchemaType "point")+ schemaTypeToXML s x@MultiDimensionalPricingData{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "measureType") $ multiDimensPricingData_measureType x+ , maybe [] (schemaTypeToXML "quoteUnits") $ multiDimensPricingData_quoteUnits x+ , maybe [] (schemaTypeToXML "side") $ multiDimensPricingData_side x+ , maybe [] (schemaTypeToXML "currency") $ multiDimensPricingData_currency x+ , maybe [] (schemaTypeToXML "currencyType") $ multiDimensPricingData_currencyType x+ , maybe [] (schemaTypeToXML "timing") $ multiDimensPricingData_timing x+ , maybe [] (foldOneOf2 (schemaTypeToXML "businessCenter")+ (schemaTypeToXML "exchangeId")+ ) $ multiDimensPricingData_choice6 x+ , concatMap (schemaTypeToXML "informationSource") $ multiDimensPricingData_informationSource x+ , maybe [] (schemaTypeToXML "pricingModel") $ multiDimensPricingData_pricingModel x+ , maybe [] (schemaTypeToXML "time") $ multiDimensPricingData_time x+ , maybe [] (schemaTypeToXML "valuationDate") $ multiDimensPricingData_valuationDate x+ , maybe [] (schemaTypeToXML "expiryTime") $ multiDimensPricingData_expiryTime x+ , maybe [] (schemaTypeToXML "cashflowType") $ multiDimensPricingData_cashflowType x+ , concatMap (schemaTypeToXML "point") $ multiDimensPricingData_point x+ ]+ +-- | An adjustment used to accommodate a parameter of the input +-- trade, e.g. the strike.+data ParametricAdjustment = ParametricAdjustment+ { paramAdjust_name :: Maybe Xsd.NormalizedString+ -- ^ The name of the adjustment parameter (e.g. "Volatility + -- Skew").+ , paramAdjust_inputUnits :: Maybe PriceQuoteUnits+ -- ^ The units of the input parameter, e.g. Yield.+ , paramAdjust_datapoint :: [ParametricAdjustmentPoint]+ -- ^ The values of the adjustment parameter.+ }+ deriving (Eq,Show)+instance SchemaType ParametricAdjustment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ParametricAdjustment+ `apply` optional (parseSchemaType "name")+ `apply` optional (parseSchemaType "inputUnits")+ `apply` many (parseSchemaType "datapoint")+ schemaTypeToXML s x@ParametricAdjustment{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "name") $ paramAdjust_name x+ , maybe [] (schemaTypeToXML "inputUnits") $ paramAdjust_inputUnits x+ , concatMap (schemaTypeToXML "datapoint") $ paramAdjust_datapoint x+ ]+ +-- | A value of the adjustment point, consisting of the x value +-- and the corresponding y value.+data ParametricAdjustmentPoint = ParametricAdjustmentPoint+ { paramAdjustPoint_parameterValue :: Maybe Xsd.Decimal+ -- ^ The value of the independent variable (e.g. strike offset).+ , paramAdjustPoint_adjustmentValue :: Maybe Xsd.Decimal+ -- ^ The value of the dependent variable, the actual adjustment + -- amount.+ }+ deriving (Eq,Show)+instance SchemaType ParametricAdjustmentPoint where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ParametricAdjustmentPoint+ `apply` optional (parseSchemaType "parameterValue")+ `apply` optional (parseSchemaType "adjustmentValue")+ schemaTypeToXML s x@ParametricAdjustmentPoint{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "parameterValue") $ paramAdjustPoint_parameterValue x+ , maybe [] (schemaTypeToXML "adjustmentValue") $ paramAdjustPoint_adjustmentValue x+ ]+ +-- | A single valued point with a set of coordinates that define +-- an arbitrary number of indentifying indexes (0 or more). +-- Note that the collection of coordinates/coordinate +-- references for a PricingStructurePoint must not define a +-- given dimension (other than "generic") more than once. This +-- is to avoid ambiguity.+data PricingStructurePoint = PricingStructurePoint+ { pricingStructPoint_ID :: Maybe Xsd.ID+ , pricingStructPoint_choice0 :: (Maybe (OneOf2 PricingDataPointCoordinate PricingDataPointCoordinateReference))+ -- ^ Choice between:+ -- + -- (1) An explicit, filled in data point coordinate. This + -- might specify expiration, strike, etc.+ -- + -- (2) A reference to a pricing data point coordinate within + -- this document.+ , pricingStructPoint_choice1 :: (Maybe (OneOf2 Asset AssetReference))+ -- ^ Choice between:+ -- + -- (1) Define the underlying asset, either a listed security + -- or other instrument.+ -- + -- (2) A reference to an underlying asset that defines the + -- meaning of the value, i.e. the product that the value + -- corresponds to. For example, this could be a caplet or + -- simple european swaption.+ , pricingStructPoint_value :: Maybe Xsd.Decimal+ -- ^ The value of the the quotation.+ , pricingStructPoint_measureType :: Maybe AssetMeasureType+ -- ^ The type of the value that is measured. This could be an + -- NPV, a cash flow, a clean price, etc.+ , pricingStructPoint_quoteUnits :: Maybe PriceQuoteUnits+ -- ^ The optional units that the measure is expressed in. If not + -- supplied, this is assumed to be a price/value in currency + -- units.+ , pricingStructPoint_side :: Maybe QuotationSideEnum+ -- ^ The side (bid/mid/ask) of the measure.+ , pricingStructPoint_currency :: Maybe Currency+ -- ^ The optional currency that the measure is expressed in. If + -- not supplied, this is defaulted from the reportingCurrency + -- in the valuationScenarioDefinition.+ , pricingStructPoint_currencyType :: Maybe ReportingCurrencyType+ -- ^ The optional currency that the measure is expressed in. If + -- not supplied, this is defaulted from the reportingCurrency + -- in the valuationScenarioDefinition.+ , pricingStructPoint_timing :: Maybe QuoteTiming+ -- ^ When during a day the quote is for. Typically, if this + -- element is supplied, the QuoteLocation needs also to be + -- supplied.+ , pricingStructPoint_choice9 :: (Maybe (OneOf2 BusinessCenter ExchangeId))+ -- ^ Choice between:+ -- + -- (1) A city or other business center.+ -- + -- (2) The exchange (e.g. stock or futures exchange) from + -- which the quote is obtained.+ , pricingStructPoint_informationSource :: [InformationSource]+ -- ^ The information source where a published or displayed + -- market rate will be obtained, e.g. Telerate Page 3750.+ , pricingStructPoint_pricingModel :: Maybe PricingModel+ -- ^ .+ , pricingStructPoint_time :: Maybe Xsd.DateTime+ -- ^ When the quote was observed or derived.+ , pricingStructPoint_valuationDate :: Maybe Xsd.Date+ -- ^ When the quote was computed.+ , pricingStructPoint_expiryTime :: Maybe Xsd.DateTime+ -- ^ When does the quote cease to be valid.+ , pricingStructPoint_cashflowType :: Maybe CashflowType+ -- ^ For cash flows, the type of the cash flows. Examples + -- include: Coupon payment, Premium Fee, Settlement Fee, + -- Brokerage Fee, etc.+ }+ deriving (Eq,Show)+instance SchemaType PricingStructurePoint where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PricingStructurePoint a0)+ `apply` optional (oneOf' [ ("PricingDataPointCoordinate", fmap OneOf2 (parseSchemaType "coordinate"))+ , ("PricingDataPointCoordinateReference", fmap TwoOf2 (parseSchemaType "coordinateReference"))+ ])+ `apply` optional (oneOf' [ ("Asset", fmap OneOf2 (elementUnderlyingAsset))+ , ("AssetReference", fmap TwoOf2 (parseSchemaType "underlyingAssetReference"))+ ])+ `apply` optional (parseSchemaType "value")+ `apply` optional (parseSchemaType "measureType")+ `apply` optional (parseSchemaType "quoteUnits")+ `apply` optional (parseSchemaType "side")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "currencyType")+ `apply` optional (parseSchemaType "timing")+ `apply` optional (oneOf' [ ("BusinessCenter", fmap OneOf2 (parseSchemaType "businessCenter"))+ , ("ExchangeId", fmap TwoOf2 (parseSchemaType "exchangeId"))+ ])+ `apply` many (parseSchemaType "informationSource")+ `apply` optional (parseSchemaType "pricingModel")+ `apply` optional (parseSchemaType "time")+ `apply` optional (parseSchemaType "valuationDate")+ `apply` optional (parseSchemaType "expiryTime")+ `apply` optional (parseSchemaType "cashflowType")+ schemaTypeToXML s x@PricingStructurePoint{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ pricingStructPoint_ID x+ ]+ [ maybe [] (foldOneOf2 (schemaTypeToXML "coordinate")+ (schemaTypeToXML "coordinateReference")+ ) $ pricingStructPoint_choice0 x+ , maybe [] (foldOneOf2 (elementToXMLUnderlyingAsset)+ (schemaTypeToXML "underlyingAssetReference")+ ) $ pricingStructPoint_choice1 x+ , maybe [] (schemaTypeToXML "value") $ pricingStructPoint_value x+ , maybe [] (schemaTypeToXML "measureType") $ pricingStructPoint_measureType x+ , maybe [] (schemaTypeToXML "quoteUnits") $ pricingStructPoint_quoteUnits x+ , maybe [] (schemaTypeToXML "side") $ pricingStructPoint_side x+ , maybe [] (schemaTypeToXML "currency") $ pricingStructPoint_currency x+ , maybe [] (schemaTypeToXML "currencyType") $ pricingStructPoint_currencyType x+ , maybe [] (schemaTypeToXML "timing") $ pricingStructPoint_timing x+ , maybe [] (foldOneOf2 (schemaTypeToXML "businessCenter")+ (schemaTypeToXML "exchangeId")+ ) $ pricingStructPoint_choice9 x+ , concatMap (schemaTypeToXML "informationSource") $ pricingStructPoint_informationSource x+ , maybe [] (schemaTypeToXML "pricingModel") $ pricingStructPoint_pricingModel x+ , maybe [] (schemaTypeToXML "time") $ pricingStructPoint_time x+ , maybe [] (schemaTypeToXML "valuationDate") $ pricingStructPoint_valuationDate x+ , maybe [] (schemaTypeToXML "expiryTime") $ pricingStructPoint_expiryTime x+ , maybe [] (schemaTypeToXML "cashflowType") $ pricingStructPoint_cashflowType x+ ]+ +-- | A curve consisting only of values over a term. This is a +-- restricted form of One Dimensional Structure.+data TermCurve = TermCurve+ { termCurve_interpolationMethod :: Maybe InterpolationMethod+ , termCurve_extrapolationPermitted :: Maybe Xsd.Boolean+ , termCurve_point :: [TermPoint]+ }+ deriving (Eq,Show)+instance SchemaType TermCurve where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return TermCurve+ `apply` optional (parseSchemaType "interpolationMethod")+ `apply` optional (parseSchemaType "extrapolationPermitted")+ `apply` many (parseSchemaType "point")+ schemaTypeToXML s x@TermCurve{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "interpolationMethod") $ termCurve_interpolationMethod x+ , maybe [] (schemaTypeToXML "extrapolationPermitted") $ termCurve_extrapolationPermitted x+ , concatMap (schemaTypeToXML "point") $ termCurve_point x+ ]+ +-- | A value point that can have a time dimension. Allows bid, +-- mid, ask, and spread values to be represented.+data TermPoint = TermPoint+ { termPoint_ID :: Maybe Xsd.ID+ , termPoint_term :: Maybe TimeDimension+ -- ^ The time dimension of the point (tenor and/or date)+ , termPoint_bid :: Maybe Xsd.Decimal+ -- ^ A price "bid" by a buyer for an asset, i.e. the price a + -- buyer is willing to pay.+ , termPoint_mid :: Maybe Xsd.Decimal+ -- ^ A price midway between the bid and the ask price.+ , termPoint_ask :: Maybe Xsd.Decimal+ -- ^ A price "asked" by a seller for an asset, i.e. the price at + -- which a seller is willing to sell.+ , termPoint_spreadValue :: Maybe Xsd.Decimal+ -- ^ The spread value can be used in conjunction with the "mid" + -- value to define the bid and the ask value.+ , termPoint_definition :: Maybe AssetReference+ -- ^ An optional reference to an underlying asset that defines + -- the meaning of the value, i.e. the product that the value + -- corresponds to. For example, this could be a discount + -- instrument.+ }+ deriving (Eq,Show)+instance SchemaType TermPoint where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (TermPoint a0)+ `apply` optional (parseSchemaType "term")+ `apply` optional (parseSchemaType "bid")+ `apply` optional (parseSchemaType "mid")+ `apply` optional (parseSchemaType "ask")+ `apply` optional (parseSchemaType "spreadValue")+ `apply` optional (parseSchemaType "definition")+ schemaTypeToXML s x@TermPoint{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ termPoint_ID x+ ]+ [ maybe [] (schemaTypeToXML "term") $ termPoint_term x+ , maybe [] (schemaTypeToXML "bid") $ termPoint_bid x+ , maybe [] (schemaTypeToXML "mid") $ termPoint_mid x+ , maybe [] (schemaTypeToXML "ask") $ termPoint_ask x+ , maybe [] (schemaTypeToXML "spreadValue") $ termPoint_spreadValue x+ , maybe [] (schemaTypeToXML "definition") $ termPoint_definition x+ ]+ +-- | A matrix of volatilities with dimension 0-3.+data VolatilityMatrix = VolatilityMatrix+ { volatMatrix_ID :: Maybe Xsd.ID+ , volatMatrix_definitionRef :: Maybe Xsd.IDREF+ -- ^ An optional reference to the scenario that this valuation + -- applies to.+ , volatMatrix_objectReference :: Maybe AnyAssetReference+ -- ^ A reference to the asset or pricing structure that this + -- values.+ , volatMatrix_valuationScenarioReference :: Maybe ValuationScenarioReference+ -- ^ A reference to the valuation scenario used to calculate + -- this valuation. If the Valuation occurs within a + -- ValuationSet, this value is optional and is defaulted from + -- the ValuationSet. If this value occurs in both places, the + -- lower level value (i.e. the one here) overrides that in the + -- higher (i.e. ValuationSet).+ , volatMatrix_baseDate :: Maybe IdentifiedDate+ -- ^ The base date for which the structure applies, i.e. the + -- curve date. Normally this will align with the valuation + -- date.+ , volatMatrix_spotDate :: Maybe IdentifiedDate+ -- ^ The spot settlement date for which the structure applies, + -- normally 0-2 days after the base date. The difference + -- between the baseDate and the spotDate is termed the + -- settlement lag, and is sometimes called "days to spot".+ , volatMatrix_inputDataDate :: Maybe IdentifiedDate+ -- ^ The date from which the input data used to construct the + -- pricing input was obtained. Often the same as the baseDate, + -- but sometimes the pricing input may be "rolled forward", in + -- which input data from one date is used to generate a curve + -- for a later date.+ , volatMatrix_endDate :: Maybe IdentifiedDate+ -- ^ The last date for which data is supplied in this pricing + -- input.+ , volatMatrix_buildDateTime :: Maybe Xsd.DateTime+ -- ^ The date and time when the pricing input was generated.+ , volatMatrix_dataPoints :: Maybe MultiDimensionalPricingData+ -- ^ The raw volatility matrix data, expressed as a + -- multi-dimensional array.+ , volatMatrix_adjustment :: [ParametricAdjustment]+ -- ^ An adjustment factor, such as for vol smile/skew.+ }+ deriving (Eq,Show)+instance SchemaType VolatilityMatrix where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ a1 <- optional $ getAttribute "definitionRef" e pos+ commit $ interior e $ return (VolatilityMatrix a0 a1)+ `apply` optional (parseSchemaType "objectReference")+ `apply` optional (parseSchemaType "valuationScenarioReference")+ `apply` optional (parseSchemaType "baseDate")+ `apply` optional (parseSchemaType "spotDate")+ `apply` optional (parseSchemaType "inputDataDate")+ `apply` optional (parseSchemaType "endDate")+ `apply` optional (parseSchemaType "buildDateTime")+ `apply` optional (parseSchemaType "dataPoints")+ `apply` many (parseSchemaType "adjustment")+ schemaTypeToXML s x@VolatilityMatrix{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ volatMatrix_ID x+ , maybe [] (toXMLAttribute "definitionRef") $ volatMatrix_definitionRef x+ ]+ [ maybe [] (schemaTypeToXML "objectReference") $ volatMatrix_objectReference x+ , maybe [] (schemaTypeToXML "valuationScenarioReference") $ volatMatrix_valuationScenarioReference x+ , maybe [] (schemaTypeToXML "baseDate") $ volatMatrix_baseDate x+ , maybe [] (schemaTypeToXML "spotDate") $ volatMatrix_spotDate x+ , maybe [] (schemaTypeToXML "inputDataDate") $ volatMatrix_inputDataDate x+ , maybe [] (schemaTypeToXML "endDate") $ volatMatrix_endDate x+ , maybe [] (schemaTypeToXML "buildDateTime") $ volatMatrix_buildDateTime x+ , maybe [] (schemaTypeToXML "dataPoints") $ volatMatrix_dataPoints x+ , concatMap (schemaTypeToXML "adjustment") $ volatMatrix_adjustment x+ ]+instance Extension VolatilityMatrix PricingStructureValuation where+ supertype (VolatilityMatrix a0 a1 e0 e1 e2 e3 e4 e5 e6 e7 e8) =+ PricingStructureValuation a0 a1 e0 e1 e2 e3 e4 e5 e6+instance Extension VolatilityMatrix Valuation where+ supertype = (supertype :: PricingStructureValuation -> Valuation)+ . (supertype :: VolatilityMatrix -> PricingStructureValuation)+ + +-- | A representation of volatilities of an asset. This is a +-- generic structure whose values can be supplied in a +-- specific volatility matrix.+data VolatilityRepresentation = VolatilityRepresentation+ { volatRepres_ID :: Maybe Xsd.ID+ , volatRepres_name :: Maybe Xsd.NormalizedString+ -- ^ The name of the structure, e.g "USDLIBOR-3M EOD Curve".+ , volatRepres_currency :: Maybe Currency+ -- ^ The currency that the structure is expressed in (this is + -- relevant mostly for the Interes Rates asset class).+ , volatRepres_asset :: Maybe AnyAssetReference+ -- ^ A reference to the asset whose volatility is modeled.+ }+ deriving (Eq,Show)+instance SchemaType VolatilityRepresentation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (VolatilityRepresentation a0)+ `apply` optional (parseSchemaType "name")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "asset")+ schemaTypeToXML s x@VolatilityRepresentation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ volatRepres_ID x+ ]+ [ maybe [] (schemaTypeToXML "name") $ volatRepres_name x+ , maybe [] (schemaTypeToXML "currency") $ volatRepres_currency x+ , maybe [] (schemaTypeToXML "asset") $ volatRepres_asset x+ ]+instance Extension VolatilityRepresentation PricingStructure where+ supertype v = PricingStructure_VolatilityRepresentation v+ +-- | A generic yield curve object, which can be valued in a +-- variety of ways.+data YieldCurve = YieldCurve+ { yieldCurve_ID :: Maybe Xsd.ID+ , yieldCurve_name :: Maybe Xsd.NormalizedString+ -- ^ The name of the structure, e.g "USDLIBOR-3M EOD Curve".+ , yieldCurve_currency :: Maybe Currency+ -- ^ The currency that the structure is expressed in (this is + -- relevant mostly for the Interes Rates asset class).+ , yieldCurve_algorithm :: Maybe Xsd.XsdString+ , yieldCurve_forecastRateIndex :: Maybe ForecastRateIndex+ }+ deriving (Eq,Show)+instance SchemaType YieldCurve where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (YieldCurve a0)+ `apply` optional (parseSchemaType "name")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "algorithm")+ `apply` optional (parseSchemaType "forecastRateIndex")+ schemaTypeToXML s x@YieldCurve{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ yieldCurve_ID x+ ]+ [ maybe [] (schemaTypeToXML "name") $ yieldCurve_name x+ , maybe [] (schemaTypeToXML "currency") $ yieldCurve_currency x+ , maybe [] (schemaTypeToXML "algorithm") $ yieldCurve_algorithm x+ , maybe [] (schemaTypeToXML "forecastRateIndex") $ yieldCurve_forecastRateIndex x+ ]+instance Extension YieldCurve PricingStructure where+ supertype v = PricingStructure_YieldCurve v+ +-- | The values of a yield curve, including possibly inputs and +-- outputs (dfs, forwards, zero rates).+data YieldCurveValuation = YieldCurveValuation+ { yieldCurveVal_ID :: Maybe Xsd.ID+ , yieldCurveVal_definitionRef :: Maybe Xsd.IDREF+ -- ^ An optional reference to the scenario that this valuation + -- applies to.+ , yieldCurveVal_objectReference :: Maybe AnyAssetReference+ -- ^ A reference to the asset or pricing structure that this + -- values.+ , yieldCurveVal_valuationScenarioReference :: Maybe ValuationScenarioReference+ -- ^ A reference to the valuation scenario used to calculate + -- this valuation. If the Valuation occurs within a + -- ValuationSet, this value is optional and is defaulted from + -- the ValuationSet. If this value occurs in both places, the + -- lower level value (i.e. the one here) overrides that in the + -- higher (i.e. ValuationSet).+ , yieldCurveVal_baseDate :: Maybe IdentifiedDate+ -- ^ The base date for which the structure applies, i.e. the + -- curve date. Normally this will align with the valuation + -- date.+ , yieldCurveVal_spotDate :: Maybe IdentifiedDate+ -- ^ The spot settlement date for which the structure applies, + -- normally 0-2 days after the base date. The difference + -- between the baseDate and the spotDate is termed the + -- settlement lag, and is sometimes called "days to spot".+ , yieldCurveVal_inputDataDate :: Maybe IdentifiedDate+ -- ^ The date from which the input data used to construct the + -- pricing input was obtained. Often the same as the baseDate, + -- but sometimes the pricing input may be "rolled forward", in + -- which input data from one date is used to generate a curve + -- for a later date.+ , yieldCurveVal_endDate :: Maybe IdentifiedDate+ -- ^ The last date for which data is supplied in this pricing + -- input.+ , yieldCurveVal_buildDateTime :: Maybe Xsd.DateTime+ -- ^ The date and time when the pricing input was generated.+ , yieldCurveVal_inputs :: Maybe QuotedAssetSet+ , yieldCurveVal_zeroCurve :: Maybe ZeroRateCurve+ -- ^ A curve of zero rates.+ , yieldCurveVal_forwardCurve :: [ForwardRateCurve]+ -- ^ A curve of forward rates.+ , yieldCurveVal_discountFactorCurve :: Maybe TermCurve+ -- ^ A curve of discount factors.+ }+ deriving (Eq,Show)+instance SchemaType YieldCurveValuation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ a1 <- optional $ getAttribute "definitionRef" e pos+ commit $ interior e $ return (YieldCurveValuation a0 a1)+ `apply` optional (parseSchemaType "objectReference")+ `apply` optional (parseSchemaType "valuationScenarioReference")+ `apply` optional (parseSchemaType "baseDate")+ `apply` optional (parseSchemaType "spotDate")+ `apply` optional (parseSchemaType "inputDataDate")+ `apply` optional (parseSchemaType "endDate")+ `apply` optional (parseSchemaType "buildDateTime")+ `apply` optional (parseSchemaType "inputs")+ `apply` optional (parseSchemaType "zeroCurve")+ `apply` many (parseSchemaType "forwardCurve")+ `apply` optional (parseSchemaType "discountFactorCurve")+ schemaTypeToXML s x@YieldCurveValuation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ yieldCurveVal_ID x+ , maybe [] (toXMLAttribute "definitionRef") $ yieldCurveVal_definitionRef x+ ]+ [ maybe [] (schemaTypeToXML "objectReference") $ yieldCurveVal_objectReference x+ , maybe [] (schemaTypeToXML "valuationScenarioReference") $ yieldCurveVal_valuationScenarioReference x+ , maybe [] (schemaTypeToXML "baseDate") $ yieldCurveVal_baseDate x+ , maybe [] (schemaTypeToXML "spotDate") $ yieldCurveVal_spotDate x+ , maybe [] (schemaTypeToXML "inputDataDate") $ yieldCurveVal_inputDataDate x+ , maybe [] (schemaTypeToXML "endDate") $ yieldCurveVal_endDate x+ , maybe [] (schemaTypeToXML "buildDateTime") $ yieldCurveVal_buildDateTime x+ , maybe [] (schemaTypeToXML "inputs") $ yieldCurveVal_inputs x+ , maybe [] (schemaTypeToXML "zeroCurve") $ yieldCurveVal_zeroCurve x+ , concatMap (schemaTypeToXML "forwardCurve") $ yieldCurveVal_forwardCurve x+ , maybe [] (schemaTypeToXML "discountFactorCurve") $ yieldCurveVal_discountFactorCurve x+ ]+instance Extension YieldCurveValuation PricingStructureValuation where+ supertype (YieldCurveValuation a0 a1 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10) =+ PricingStructureValuation a0 a1 e0 e1 e2 e3 e4 e5 e6+instance Extension YieldCurveValuation Valuation where+ supertype = (supertype :: PricingStructureValuation -> Valuation)+ . (supertype :: YieldCurveValuation -> PricingStructureValuation)+ + +-- | A curve used to model a set of zero-coupon interest rates.+data ZeroRateCurve = ZeroRateCurve+ { zeroRateCurve_compoundingFrequency :: Maybe CompoundingFrequency+ -- ^ The frequency at which the rates are compounded (e.g. + -- continuously compounded).+ , zeroRateCurve_rateCurve :: Maybe TermCurve+ -- ^ The curve of zero-coupon values.+ }+ deriving (Eq,Show)+instance SchemaType ZeroRateCurve where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ZeroRateCurve+ `apply` optional (parseSchemaType "compoundingFrequency")+ `apply` optional (parseSchemaType "rateCurve")+ schemaTypeToXML s x@ZeroRateCurve{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "compoundingFrequency") $ zeroRateCurve_compoundingFrequency x+ , maybe [] (schemaTypeToXML "rateCurve") $ zeroRateCurve_rateCurve x+ ]+ +elementCreditCurve :: XMLParser CreditCurve+elementCreditCurve = parseSchemaType "creditCurve"+elementToXMLCreditCurve :: CreditCurve -> [Content ()]+elementToXMLCreditCurve = schemaTypeToXML "creditCurve"+ +elementCreditCurveValuation :: XMLParser CreditCurveValuation+elementCreditCurveValuation = parseSchemaType "creditCurveValuation"+elementToXMLCreditCurveValuation :: CreditCurveValuation -> [Content ()]+elementToXMLCreditCurveValuation = schemaTypeToXML "creditCurveValuation"+ +elementFxCurve :: XMLParser FxCurve+elementFxCurve = parseSchemaType "fxCurve"+elementToXMLFxCurve :: FxCurve -> [Content ()]+elementToXMLFxCurve = schemaTypeToXML "fxCurve"+ +elementFxCurveValuation :: XMLParser FxCurveValuation+elementFxCurveValuation = parseSchemaType "fxCurveValuation"+elementToXMLFxCurveValuation :: FxCurveValuation -> [Content ()]+elementToXMLFxCurveValuation = schemaTypeToXML "fxCurveValuation"+ +elementVolatilityMatrixValuation :: XMLParser VolatilityMatrix+elementVolatilityMatrixValuation = parseSchemaType "volatilityMatrixValuation"+elementToXMLVolatilityMatrixValuation :: VolatilityMatrix -> [Content ()]+elementToXMLVolatilityMatrixValuation = schemaTypeToXML "volatilityMatrixValuation"+ +elementVolatilityRepresentation :: XMLParser VolatilityRepresentation+elementVolatilityRepresentation = parseSchemaType "volatilityRepresentation"+elementToXMLVolatilityRepresentation :: VolatilityRepresentation -> [Content ()]+elementToXMLVolatilityRepresentation = schemaTypeToXML "volatilityRepresentation"+ +elementYieldCurve :: XMLParser YieldCurve+elementYieldCurve = parseSchemaType "yieldCurve"+elementToXMLYieldCurve :: YieldCurve -> [Content ()]+elementToXMLYieldCurve = schemaTypeToXML "yieldCurve"+ +elementYieldCurveValuation :: XMLParser YieldCurveValuation+elementYieldCurveValuation = parseSchemaType "yieldCurveValuation"+elementToXMLYieldCurveValuation :: YieldCurveValuation -> [Content ()]+elementToXMLYieldCurveValuation = schemaTypeToXML "yieldCurveValuation"+ + + + + +
+ Data/FpML/V53/Mktenv.hs-boot view
@@ -0,0 +1,201 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Mktenv+ ( module Data.FpML.V53.Mktenv+ , module Data.FpML.V53.Doc+ , module Data.FpML.V53.Asset+ , module Data.FpML.V53.Riskdef+ , module Data.FpML.V53.CD+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Doc+import {-# SOURCE #-} Data.FpML.V53.Asset+import {-# SOURCE #-} Data.FpML.V53.Riskdef+import {-# SOURCE #-} Data.FpML.V53.CD+ +-- | The frequency at which a rate is compounded. +data CompoundingFrequency+data CompoundingFrequencyAttributes+instance Eq CompoundingFrequency+instance Eq CompoundingFrequencyAttributes+instance Show CompoundingFrequency+instance Show CompoundingFrequencyAttributes+instance SchemaType CompoundingFrequency+instance Extension CompoundingFrequency Scheme+ +-- | A generic credit curve definition. +data CreditCurve+instance Eq CreditCurve+instance Show CreditCurve+instance SchemaType CreditCurve+instance Extension CreditCurve PricingStructure+ +-- | A set of credit curve values, which can include pricing +-- inputs (which are typically credit spreads), default +-- probabilities, and recovery rates. +data CreditCurveValuation+instance Eq CreditCurveValuation+instance Show CreditCurveValuation+instance SchemaType CreditCurveValuation+instance Extension CreditCurveValuation PricingStructureValuation+instance Extension CreditCurveValuation Valuation+ +-- | A set of default probabilities. +data DefaultProbabilityCurve+instance Eq DefaultProbabilityCurve+instance Show DefaultProbabilityCurve+instance SchemaType DefaultProbabilityCurve+instance Extension DefaultProbabilityCurve PricingStructureValuation+instance Extension DefaultProbabilityCurve Valuation+ +-- | A curve used to model a set of forward interest rates. Used +-- for forecasting interest rates as part of a pricing +-- calculation. +data ForwardRateCurve+instance Eq ForwardRateCurve+instance Show ForwardRateCurve+instance SchemaType ForwardRateCurve+ +-- | An fx curve object., which includes pricing inputs and term +-- structures for fx forwards. +data FxCurve+instance Eq FxCurve+instance Show FxCurve+instance SchemaType FxCurve+instance Extension FxCurve PricingStructure+ +-- | A valuation of an FX curve object., which includes pricing +-- inputs and term structures for fx forwards. +data FxCurveValuation+instance Eq FxCurveValuation+instance Show FxCurveValuation+instance SchemaType FxCurveValuation+instance Extension FxCurveValuation PricingStructureValuation+instance Extension FxCurveValuation Valuation+ +-- | A collection of spot FX rates used in pricing. +data FxRateSet+instance Eq FxRateSet+instance Show FxRateSet+instance SchemaType FxRateSet+instance Extension FxRateSet QuotedAssetSet+ +-- | A pricing data set that contains a series of points with +-- coordinates. It is a sparse matrix representation of a +-- multi-dimensional matrix. +data MultiDimensionalPricingData+instance Eq MultiDimensionalPricingData+instance Show MultiDimensionalPricingData+instance SchemaType MultiDimensionalPricingData+ +-- | An adjustment used to accommodate a parameter of the input +-- trade, e.g. the strike. +data ParametricAdjustment+instance Eq ParametricAdjustment+instance Show ParametricAdjustment+instance SchemaType ParametricAdjustment+ +-- | A value of the adjustment point, consisting of the x value +-- and the corresponding y value. +data ParametricAdjustmentPoint+instance Eq ParametricAdjustmentPoint+instance Show ParametricAdjustmentPoint+instance SchemaType ParametricAdjustmentPoint+ +-- | A single valued point with a set of coordinates that define +-- an arbitrary number of indentifying indexes (0 or more). +-- Note that the collection of coordinates/coordinate +-- references for a PricingStructurePoint must not define a +-- given dimension (other than "generic") more than once. This +-- is to avoid ambiguity. +data PricingStructurePoint+instance Eq PricingStructurePoint+instance Show PricingStructurePoint+instance SchemaType PricingStructurePoint+ +-- | A curve consisting only of values over a term. This is a +-- restricted form of One Dimensional Structure. +data TermCurve+instance Eq TermCurve+instance Show TermCurve+instance SchemaType TermCurve+ +-- | A value point that can have a time dimension. Allows bid, +-- mid, ask, and spread values to be represented. +data TermPoint+instance Eq TermPoint+instance Show TermPoint+instance SchemaType TermPoint+ +-- | A matrix of volatilities with dimension 0-3. +data VolatilityMatrix+instance Eq VolatilityMatrix+instance Show VolatilityMatrix+instance SchemaType VolatilityMatrix+instance Extension VolatilityMatrix PricingStructureValuation+instance Extension VolatilityMatrix Valuation+ +-- | A representation of volatilities of an asset. This is a +-- generic structure whose values can be supplied in a +-- specific volatility matrix. +data VolatilityRepresentation+instance Eq VolatilityRepresentation+instance Show VolatilityRepresentation+instance SchemaType VolatilityRepresentation+instance Extension VolatilityRepresentation PricingStructure+ +-- | A generic yield curve object, which can be valued in a +-- variety of ways. +data YieldCurve+instance Eq YieldCurve+instance Show YieldCurve+instance SchemaType YieldCurve+instance Extension YieldCurve PricingStructure+ +-- | The values of a yield curve, including possibly inputs and +-- outputs (dfs, forwards, zero rates). +data YieldCurveValuation+instance Eq YieldCurveValuation+instance Show YieldCurveValuation+instance SchemaType YieldCurveValuation+instance Extension YieldCurveValuation PricingStructureValuation+instance Extension YieldCurveValuation Valuation+ +-- | A curve used to model a set of zero-coupon interest rates. +data ZeroRateCurve+instance Eq ZeroRateCurve+instance Show ZeroRateCurve+instance SchemaType ZeroRateCurve+ +elementCreditCurve :: XMLParser CreditCurve+elementToXMLCreditCurve :: CreditCurve -> [Content ()]+ +elementCreditCurveValuation :: XMLParser CreditCurveValuation+elementToXMLCreditCurveValuation :: CreditCurveValuation -> [Content ()]+ +elementFxCurve :: XMLParser FxCurve+elementToXMLFxCurve :: FxCurve -> [Content ()]+ +elementFxCurveValuation :: XMLParser FxCurveValuation+elementToXMLFxCurveValuation :: FxCurveValuation -> [Content ()]+ +elementVolatilityMatrixValuation :: XMLParser VolatilityMatrix+elementToXMLVolatilityMatrixValuation :: VolatilityMatrix -> [Content ()]+ +elementVolatilityRepresentation :: XMLParser VolatilityRepresentation+elementToXMLVolatilityRepresentation :: VolatilityRepresentation -> [Content ()]+ +elementYieldCurve :: XMLParser YieldCurve+elementToXMLYieldCurve :: YieldCurve -> [Content ()]+ +elementYieldCurveValuation :: XMLParser YieldCurveValuation+elementToXMLYieldCurveValuation :: YieldCurveValuation -> [Content ()]+ + + + + +
+ Data/FpML/V53/Msg.hs view
@@ -0,0 +1,1966 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Msg+ ( module Data.FpML.V53.Msg+ , module Data.FpML.V53.Doc+ ) 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.Doc+import Data.Xmldsig.Core.Schema as Dsig+ +-- Some hs-boot imports are required, for fwd-declaring types.+import {-# SOURCE #-} Data.FpML.V53.Notification.CreditEvent ( CreditEventNotification )+import {-# SOURCE #-} Data.FpML.V53.Processes.Recordkeeping ( NonpublicExecutionReport )+import {-# SOURCE #-} Data.FpML.V53.Reporting.Valuation ( RequestValuationReport )+import {-# SOURCE #-} Data.FpML.V53.Processes.Recordkeeping ( NonpublicExecutionReportRetracted )+import {-# SOURCE #-} Data.FpML.V53.Reporting.Valuation ( ValuationReportRetracted )+import {-# SOURCE #-} Data.FpML.V53.Reporting.Valuation ( ValuationReport )+ +data Acknowledgement = Acknowledgement+ { acknow_fpmlVersion :: Xsd.XsdString+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , acknow_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , acknow_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , acknow_header :: Maybe ResponseMessageHeader+ , acknow_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , acknow_parentCorrelationId :: Maybe CorrelationId+ -- ^ An optional identifier used to correlate between related + -- processes+ , acknow_correlationId :: [CorrelationId]+ -- ^ A qualified identifier used to correlate between messages+ , acknow_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric value that can be used to order messages with the + -- same correlation identifier from the same sender.+ , acknow_onBehalfOf :: [OnBehalfOf]+ -- ^ Indicates which party (or parties) (and accounts) a trade + -- or event is being processed for. Normally there will only + -- be a maximum of 2 parties, but in the case of a novation + -- there could be a transferor, transferee, remaining party, + -- and other remaining party. Except for this case, there + -- should be no more than two onABehalfOf references in a + -- message.+ , acknow_originalMessage :: Maybe UnprocessedElementWrapper+ , acknow_party :: [Party]+ , acknow_account :: [Account]+ -- ^ Optional account information used to precisely define the + -- origination and destination of financial instruments.+ }+ deriving (Eq,Show)+instance SchemaType Acknowledgement 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 (Acknowledgement 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` optional (parseSchemaType "originalMessage")+ `apply` many (parseSchemaType "party")+ `apply` many (parseSchemaType "account")+ schemaTypeToXML s x@Acknowledgement{} =+ toXMLElement s [ toXMLAttribute "fpmlVersion" $ acknow_fpmlVersion x+ , maybe [] (toXMLAttribute "expectedBuild") $ acknow_expectedBuild x+ , maybe [] (toXMLAttribute "actualBuild") $ acknow_actualBuild x+ ]+ [ maybe [] (schemaTypeToXML "header") $ acknow_header x+ , concatMap (schemaTypeToXML "validation") $ acknow_validation x+ , maybe [] (schemaTypeToXML "parentCorrelationId") $ acknow_parentCorrelationId x+ , concatMap (schemaTypeToXML "correlationId") $ acknow_correlationId x+ , maybe [] (schemaTypeToXML "sequenceNumber") $ acknow_sequenceNumber x+ , concatMap (schemaTypeToXML "onBehalfOf") $ acknow_onBehalfOf x+ , maybe [] (schemaTypeToXML "originalMessage") $ acknow_originalMessage x+ , concatMap (schemaTypeToXML "party") $ acknow_party x+ , concatMap (schemaTypeToXML "account") $ acknow_account x+ ]+instance Extension Acknowledgement ResponseMessage where+ supertype v = ResponseMessage_Acknowledgement v+instance Extension Acknowledgement Message where+ supertype = (supertype :: ResponseMessage -> Message)+ . (supertype :: Acknowledgement -> ResponseMessage)+ +instance Extension Acknowledgement Document where+ supertype = (supertype :: Message -> Document)+ . (supertype :: ResponseMessage -> Message)+ . (supertype :: Acknowledgement -> ResponseMessage)+ + +-- | Provides extra information not represented in the model +-- that may be useful in processing the message i.e. +-- diagnosing the reason for failure.+data AdditionalData = AdditionalData+ { addData_mimeType :: Maybe MimeType+ -- ^ Indicates the type of media used to provide the extra + -- information. mimeType is used to determine the software + -- product(s) that can read the content. MIME Types are + -- described in RFC 2046.+ , addData_choice1 :: (Maybe (OneOf4 Xsd.XsdString Xsd.HexBinary Xsd.Base64Binary [AnyElement]))+ -- ^ Choice between:+ -- + -- (1) Provides extra information as string. In case the extra + -- information is in XML format, a CDATA section must be + -- placed around the source message to prevent its + -- interpretation as XML content.+ -- + -- (2) Provides extra information as binary contents coded in + -- hexadecimal.+ -- + -- (3) Provides extra information as binary contents coded in + -- base64.+ -- + -- (4) Provides extra information as binary contents coded in + -- base64.+ }+ deriving (Eq,Show)+instance SchemaType AdditionalData where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return AdditionalData+ `apply` optional (parseSchemaType "mimeType")+ `apply` optional (oneOf' [ ("Xsd.XsdString", fmap OneOf4 (parseSchemaType "string"))+ , ("Xsd.HexBinary", fmap TwoOf4 (parseSchemaType "hexadecimalBinary"))+ , ("Xsd.Base64Binary", fmap ThreeOf4 (parseSchemaType "base64Binary"))+ , ("Xsd:any", fmap FourOf4 (many (parseSchemaType "originalMessage")))+ ])+ schemaTypeToXML s x@AdditionalData{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "mimeType") $ addData_mimeType x+ , maybe [] (foldOneOf4 (schemaTypeToXML "string")+ (schemaTypeToXML "hexadecimalBinary")+ (schemaTypeToXML "base64Binary")+ (concatMap (schemaTypeToXML "originalMessage"))+ ) $ addData_choice1 x+ ]+ +-- | A type defining the content model for a request message +-- that can be subsequently corrected or retracted.+data CorrectableRequestMessage+ = CorrectableRequestMessage_CreditEventNotification CreditEventNotification+ | CorrectableRequestMessage_NonpublicExecutionReport NonpublicExecutionReport+ | CorrectableRequestMessage_RequestValuationReport RequestValuationReport+ + deriving (Eq,Show)+instance SchemaType CorrectableRequestMessage where+ parseSchemaType s = do+ (fmap CorrectableRequestMessage_CreditEventNotification $ parseSchemaType s)+ `onFail`+ (fmap CorrectableRequestMessage_NonpublicExecutionReport $ parseSchemaType s)+ `onFail`+ (fmap CorrectableRequestMessage_RequestValuationReport $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of CorrectableRequestMessage,\n\+\ namely one of:\n\+\CreditEventNotification,NonpublicExecutionReport,RequestValuationReport"+ schemaTypeToXML _s (CorrectableRequestMessage_CreditEventNotification x) = schemaTypeToXML "creditEventNotification" x+ schemaTypeToXML _s (CorrectableRequestMessage_NonpublicExecutionReport x) = schemaTypeToXML "nonpublicExecutionReport" x+ schemaTypeToXML _s (CorrectableRequestMessage_RequestValuationReport x) = schemaTypeToXML "requestValuationReport" x+instance Extension CorrectableRequestMessage RequestMessage where+ supertype v = RequestMessage_CorrectableRequestMessage v+instance Extension CorrectableRequestMessage Message where+ supertype = (supertype :: RequestMessage -> Message)+ . (supertype :: CorrectableRequestMessage -> RequestMessage)+ +instance Extension CorrectableRequestMessage Document where+ supertype = (supertype :: Message -> Document)+ . (supertype :: RequestMessage -> Message)+ . (supertype :: CorrectableRequestMessage -> RequestMessage)+ + +-- | A type defining a correlation identifier and qualifying +-- scheme+data CorrelationId = CorrelationId Xsd.NormalizedString CorrelationIdAttributes deriving (Eq,Show)+data CorrelationIdAttributes = CorrelationIdAttributes+ { correlIdAttrib_correlationIdScheme :: Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CorrelationId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- getAttribute "correlationIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CorrelationId v (CorrelationIdAttributes a0)+ schemaTypeToXML s (CorrelationId bt at) =+ addXMLAttributes [ toXMLAttribute "correlationIdScheme" $ correlIdAttrib_correlationIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CorrelationId Xsd.NormalizedString where+ supertype (CorrelationId s _) = s+ +-- | Identification of a business event, for example through its +-- correlation id or a business identifier.+data EventIdentifier = EventIdentifier+ { eventIdent_choice0 :: (Maybe (OneOf2 ([CorrelationId],(Maybe (Xsd.PositiveInteger))) TradeIdentifier))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * A qualified identifier used to correlate between + -- messages+ -- + -- * A numeric value that can be used to order messages + -- with the same correlation identifier from the same + -- sender.+ -- + -- (2) tradeIdentifier+ }+ deriving (Eq,Show)+instance SchemaType EventIdentifier where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return EventIdentifier+ `apply` optional (oneOf' [ ("[CorrelationId] Maybe Xsd.PositiveInteger", fmap OneOf2 (return (,) `apply` between (Occurs (Just 0) (Just 2))+ (parseSchemaType "correlationId")+ `apply` optional (parseSchemaType "sequenceNumber")))+ , ("TradeIdentifier", fmap TwoOf2 (parseSchemaType "tradeIdentifier"))+ ])+ schemaTypeToXML s x@EventIdentifier{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (\ (a,b) -> concat [ concatMap (schemaTypeToXML "correlationId") a+ , maybe [] (schemaTypeToXML "sequenceNumber") b+ ])+ (schemaTypeToXML "tradeIdentifier")+ ) $ eventIdent_choice0 x+ ]+ +-- | A coding scheme used to describe the matching/confirmation +-- status of a trade, post-trade event, position, or cash +-- flows.+data EventStatus = EventStatus Scheme EventStatusAttributes deriving (Eq,Show)+data EventStatusAttributes = EventStatusAttributes+ { eventStatusAttrib_eventStatusScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType EventStatus where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "eventStatusScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ EventStatus v (EventStatusAttributes a0)+ schemaTypeToXML s (EventStatus bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "eventStatusScheme") $ eventStatusAttrib_eventStatusScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension EventStatus Scheme where+ supertype (EventStatus s _) = s+ +-- | A type used in event status enquiry messages which relates +-- an event identifier to its current status value.+data EventStatusItem = EventStatusItem+ { eventStatusItem_eventIdentifier :: Maybe EventIdentifier+ -- ^ An instance of a unique event identifier.+ , eventStatusItem_status :: Maybe EventStatus+ -- ^ An event status value.+ }+ deriving (Eq,Show)+instance SchemaType EventStatusItem where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return EventStatusItem+ `apply` optional (parseSchemaType "eventIdentifier")+ `apply` optional (parseSchemaType "status")+ schemaTypeToXML s x@EventStatusItem{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "eventIdentifier") $ eventStatusItem_eventIdentifier x+ , maybe [] (schemaTypeToXML "status") $ eventStatusItem_status x+ ]+ +-- | A type defining the content model for a message normally +-- generated in response to a requestEventStatus request.+data EventStatusResponse = EventStatusResponse+ { eventStatusRespon_fpmlVersion :: Xsd.XsdString+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , eventStatusRespon_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , eventStatusRespon_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , eventStatusRespon_header :: Maybe ResponseMessageHeader+ , eventStatusRespon_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , eventStatusRespon_parentCorrelationId :: Maybe CorrelationId+ -- ^ An optional identifier used to correlate between related + -- processes+ , eventStatusRespon_correlationId :: [CorrelationId]+ -- ^ A qualified identifier used to correlate between messages+ , eventStatusRespon_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric value that can be used to order messages with the + -- same correlation identifier from the same sender.+ , eventStatusRespon_onBehalfOf :: [OnBehalfOf]+ -- ^ Indicates which party (or parties) (and accounts) a trade + -- or event is being processed for. Normally there will only + -- be a maximum of 2 parties, but in the case of a novation + -- there could be a transferor, transferee, remaining party, + -- and other remaining party. Except for this case, there + -- should be no more than two onABehalfOf references in a + -- message.+ , eventStatusRespon_statusItem :: [EventStatusItem]+ , eventStatusRespon_party :: [Party]+ , eventStatusRespon_account :: [Account]+ -- ^ Optional account information used to precisely define the + -- origination and destination of financial instruments.+ }+ deriving (Eq,Show)+instance SchemaType EventStatusResponse 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 (EventStatusResponse 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` many (parseSchemaType "statusItem")+ `apply` many (parseSchemaType "party")+ `apply` many (parseSchemaType "account")+ schemaTypeToXML s x@EventStatusResponse{} =+ toXMLElement s [ toXMLAttribute "fpmlVersion" $ eventStatusRespon_fpmlVersion x+ , maybe [] (toXMLAttribute "expectedBuild") $ eventStatusRespon_expectedBuild x+ , maybe [] (toXMLAttribute "actualBuild") $ eventStatusRespon_actualBuild x+ ]+ [ maybe [] (schemaTypeToXML "header") $ eventStatusRespon_header x+ , concatMap (schemaTypeToXML "validation") $ eventStatusRespon_validation x+ , maybe [] (schemaTypeToXML "parentCorrelationId") $ eventStatusRespon_parentCorrelationId x+ , concatMap (schemaTypeToXML "correlationId") $ eventStatusRespon_correlationId x+ , maybe [] (schemaTypeToXML "sequenceNumber") $ eventStatusRespon_sequenceNumber x+ , concatMap (schemaTypeToXML "onBehalfOf") $ eventStatusRespon_onBehalfOf x+ , concatMap (schemaTypeToXML "statusItem") $ eventStatusRespon_statusItem x+ , concatMap (schemaTypeToXML "party") $ eventStatusRespon_party x+ , concatMap (schemaTypeToXML "account") $ eventStatusRespon_account x+ ]+instance Extension EventStatusResponse ResponseMessage where+ supertype v = ResponseMessage_EventStatusResponse v+instance Extension EventStatusResponse Message where+ supertype = (supertype :: ResponseMessage -> Message)+ . (supertype :: EventStatusResponse -> ResponseMessage)+ +instance Extension EventStatusResponse Document where+ supertype = (supertype :: Message -> Document)+ . (supertype :: ResponseMessage -> Message)+ . (supertype :: EventStatusResponse -> ResponseMessage)+ + +-- | A type defining the basic content for a message sent to +-- inform another system that some exception has been +-- detected.+data Exception = Exception+ { exception_fpmlVersion :: Xsd.XsdString+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , exception_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , exception_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , exception_header :: Maybe ExceptionMessageHeader+ , exception_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , exception_parentCorrelationId :: Maybe CorrelationId+ -- ^ An optional identifier used to correlate between related + -- processes+ , exception_correlationId :: [CorrelationId]+ -- ^ A qualified identifier used to correlate between messages+ , exception_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric value that can be used to order messages with the + -- same correlation identifier from the same sender.+ , exception_reason :: [Reason]+ -- ^ An instance of the Reason type used to record the nature of + -- any errors associated with a message.+ , exception_additionalData :: Maybe AdditionalData+ -- ^ Any string of additional data that may help the message + -- processor, for example in a rejection message this might + -- contain a code value or the text of the original request + -- (within a CDATA section).+ }+ deriving (Eq,Show)+instance SchemaType Exception 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 (Exception 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` many (parseSchemaType "reason")+ `apply` optional (parseSchemaType "additionalData")+ schemaTypeToXML s x@Exception{} =+ toXMLElement s [ toXMLAttribute "fpmlVersion" $ exception_fpmlVersion x+ , maybe [] (toXMLAttribute "expectedBuild") $ exception_expectedBuild x+ , maybe [] (toXMLAttribute "actualBuild") $ exception_actualBuild x+ ]+ [ maybe [] (schemaTypeToXML "header") $ exception_header x+ , concatMap (schemaTypeToXML "validation") $ exception_validation x+ , maybe [] (schemaTypeToXML "parentCorrelationId") $ exception_parentCorrelationId x+ , concatMap (schemaTypeToXML "correlationId") $ exception_correlationId x+ , maybe [] (schemaTypeToXML "sequenceNumber") $ exception_sequenceNumber x+ , concatMap (schemaTypeToXML "reason") $ exception_reason x+ , maybe [] (schemaTypeToXML "additionalData") $ exception_additionalData x+ ]+instance Extension Exception Message where+ supertype v = Message_Exception v+instance Extension Exception Document where+ supertype = (supertype :: Message -> Document)+ . (supertype :: Exception -> Message)+ + +-- | A type defining the content model for an exception message +-- header.+data ExceptionMessageHeader = ExceptionMessageHeader+ { exceptMessageHeader_messageId :: Maybe MessageId+ -- ^ A unique identifier (within its coding scheme) assigned to + -- the message by its creating party.+ , exceptMessageHeader_inReplyTo :: Maybe MessageId+ -- ^ A copy of the unique message identifier (within it own + -- coding scheme) to which this message is responding.+ , exceptMessageHeader_sentBy :: Maybe MessageAddress+ -- ^ The unique identifier (within its coding scheme) for the + -- originator of a message instance.+ , exceptMessageHeader_sendTo :: [MessageAddress]+ -- ^ A unique identifier (within its coding scheme) indicating + -- an intended recipent of a message.+ , exceptMessageHeader_copyTo :: [MessageAddress]+ -- ^ A unique identifier (within the specified coding scheme) + -- giving the details of some party to whom a copy of this + -- message will be sent for reference.+ , exceptMessageHeader_creationTimestamp :: Maybe Xsd.DateTime+ -- ^ The date and time (on the source system) when this message + -- instance was created.+ , exceptMessageHeader_expiryTimestamp :: Maybe Xsd.DateTime+ -- ^ The date and time (on the source system) when this message + -- instance will be considered expired.+ , exceptMessageHeader_implementationSpecification :: Maybe ImplementationSpecification+ -- ^ The version(s) of specifications that the sender asserts + -- the message was developed for.+ , exceptMessageHeader_partyMessageInformation :: [PartyMessageInformation]+ -- ^ Additional message information that may be provided by each + -- involved party.+ , exceptMessageHeader_signature :: [SignatureType]+ }+ deriving (Eq,Show)+instance SchemaType ExceptionMessageHeader where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ExceptionMessageHeader+ `apply` optional (parseSchemaType "messageId")+ `apply` optional (parseSchemaType "inReplyTo")+ `apply` optional (parseSchemaType "sentBy")+ `apply` many (parseSchemaType "sendTo")+ `apply` many (parseSchemaType "copyTo")+ `apply` optional (parseSchemaType "creationTimestamp")+ `apply` optional (parseSchemaType "expiryTimestamp")+ `apply` optional (parseSchemaType "implementationSpecification")+ `apply` many (parseSchemaType "partyMessageInformation")+ `apply` many (elementSignature)+ schemaTypeToXML s x@ExceptionMessageHeader{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "messageId") $ exceptMessageHeader_messageId x+ , maybe [] (schemaTypeToXML "inReplyTo") $ exceptMessageHeader_inReplyTo x+ , maybe [] (schemaTypeToXML "sentBy") $ exceptMessageHeader_sentBy x+ , concatMap (schemaTypeToXML "sendTo") $ exceptMessageHeader_sendTo x+ , concatMap (schemaTypeToXML "copyTo") $ exceptMessageHeader_copyTo x+ , maybe [] (schemaTypeToXML "creationTimestamp") $ exceptMessageHeader_creationTimestamp x+ , maybe [] (schemaTypeToXML "expiryTimestamp") $ exceptMessageHeader_expiryTimestamp x+ , maybe [] (schemaTypeToXML "implementationSpecification") $ exceptMessageHeader_implementationSpecification x+ , concatMap (schemaTypeToXML "partyMessageInformation") $ exceptMessageHeader_partyMessageInformation x+ , concatMap (elementToXMLSignature) $ exceptMessageHeader_signature x+ ]+instance Extension ExceptionMessageHeader MessageHeader where+ supertype v = MessageHeader_ExceptionMessageHeader v+ +-- | A type defining the basic structure of all FpML messages +-- which is refined by its derived types.+data Message+ = Message_ResponseMessage ResponseMessage+ | Message_RequestMessage RequestMessage+ | Message_NotificationMessage NotificationMessage+ | Message_Exception Exception+ + deriving (Eq,Show)+instance SchemaType Message where+ parseSchemaType s = do+ (fmap Message_ResponseMessage $ parseSchemaType s)+ `onFail`+ (fmap Message_RequestMessage $ parseSchemaType s)+ `onFail`+ (fmap Message_NotificationMessage $ parseSchemaType s)+ `onFail`+ (fmap Message_Exception $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of Message,\n\+\ namely one of:\n\+\ResponseMessage,RequestMessage,NotificationMessage,Exception"+ schemaTypeToXML _s (Message_ResponseMessage x) = schemaTypeToXML "responseMessage" x+ schemaTypeToXML _s (Message_RequestMessage x) = schemaTypeToXML "requestMessage" x+ schemaTypeToXML _s (Message_NotificationMessage x) = schemaTypeToXML "notificationMessage" x+ schemaTypeToXML _s (Message_Exception x) = schemaTypeToXML "exception" x+instance Extension Message Document where+ supertype v = Document_Message v+ +-- | A type holding a structure that is unvalidated+data UnprocessedElementWrapper = UnprocessedElementWrapper+ { unprocElementWrapper_any0 :: AnyElement+ }+ deriving (Eq,Show)+instance SchemaType UnprocessedElementWrapper where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return UnprocessedElementWrapper+ `apply` parseAnyElement+ schemaTypeToXML s x@UnprocessedElementWrapper{} =+ toXMLElement s []+ [ toXMLAnyElement $ unprocElementWrapper_any0 x+ ]+ +-- | The data type used for identifying a message address.+data MessageAddress = MessageAddress Scheme MessageAddressAttributes deriving (Eq,Show)+data MessageAddressAttributes = MessageAddressAttributes+ { messageAddressAttrib_messageAddressScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MessageAddress where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "messageAddressScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MessageAddress v (MessageAddressAttributes a0)+ schemaTypeToXML s (MessageAddress bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "messageAddressScheme") $ messageAddressAttrib_messageAddressScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MessageAddress Scheme where+ supertype (MessageAddress s _) = s+ +-- | A type defining the content model for a generic message +-- header that is refined by its derived classes.+data MessageHeader+ = MessageHeader_ResponseMessageHeader ResponseMessageHeader+ | MessageHeader_RequestMessageHeader RequestMessageHeader+ | MessageHeader_NotificationMessageHeader NotificationMessageHeader+ | MessageHeader_ExceptionMessageHeader ExceptionMessageHeader+ + deriving (Eq,Show)+instance SchemaType MessageHeader where+ parseSchemaType s = do+ (fmap MessageHeader_ResponseMessageHeader $ parseSchemaType s)+ `onFail`+ (fmap MessageHeader_RequestMessageHeader $ parseSchemaType s)+ `onFail`+ (fmap MessageHeader_NotificationMessageHeader $ parseSchemaType s)+ `onFail`+ (fmap MessageHeader_ExceptionMessageHeader $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of MessageHeader,\n\+\ namely one of:\n\+\ResponseMessageHeader,RequestMessageHeader,NotificationMessageHeader,ExceptionMessageHeader"+ schemaTypeToXML _s (MessageHeader_ResponseMessageHeader x) = schemaTypeToXML "responseMessageHeader" x+ schemaTypeToXML _s (MessageHeader_RequestMessageHeader x) = schemaTypeToXML "requestMessageHeader" x+ schemaTypeToXML _s (MessageHeader_NotificationMessageHeader x) = schemaTypeToXML "notificationMessageHeader" x+ schemaTypeToXML _s (MessageHeader_ExceptionMessageHeader x) = schemaTypeToXML "exceptionMessageHeader" x+ +-- | The data type use for message identifiers.+data MessageId = MessageId Scheme MessageIdAttributes deriving (Eq,Show)+data MessageIdAttributes = MessageIdAttributes+ { messageIdAttrib_messageIdScheme :: Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MessageId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- getAttribute "messageIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MessageId v (MessageIdAttributes a0)+ schemaTypeToXML s (MessageId bt at) =+ addXMLAttributes [ toXMLAttribute "messageIdScheme" $ messageIdAttrib_messageIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MessageId Scheme where+ supertype (MessageId s _) = s+ +-- | A type defining the content model for a request message +-- that cannot be subsequently corrected or retracted.+data NonCorrectableRequestMessage+ = NonCorrectableRequestMessage_VerificationStatusNotification VerificationStatusNotification+ | NonCorrectableRequestMessage_RequestRetransmission RequestRetransmission+ | NonCorrectableRequestMessage_RequestEventStatus RequestEventStatus+ | NonCorrectableRequestMessage_NonpublicExecutionReportRetracted NonpublicExecutionReportRetracted+ + deriving (Eq,Show)+instance SchemaType NonCorrectableRequestMessage where+ parseSchemaType s = do+ (fmap NonCorrectableRequestMessage_VerificationStatusNotification $ parseSchemaType s)+ `onFail`+ (fmap NonCorrectableRequestMessage_RequestRetransmission $ parseSchemaType s)+ `onFail`+ (fmap NonCorrectableRequestMessage_RequestEventStatus $ parseSchemaType s)+ `onFail`+ (fmap NonCorrectableRequestMessage_NonpublicExecutionReportRetracted $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of NonCorrectableRequestMessage,\n\+\ namely one of:\n\+\VerificationStatusNotification,RequestRetransmission,RequestEventStatus,NonpublicExecutionReportRetracted"+ schemaTypeToXML _s (NonCorrectableRequestMessage_VerificationStatusNotification x) = schemaTypeToXML "verificationStatusNotification" x+ schemaTypeToXML _s (NonCorrectableRequestMessage_RequestRetransmission x) = schemaTypeToXML "requestRetransmission" x+ schemaTypeToXML _s (NonCorrectableRequestMessage_RequestEventStatus x) = schemaTypeToXML "requestEventStatus" x+ schemaTypeToXML _s (NonCorrectableRequestMessage_NonpublicExecutionReportRetracted x) = schemaTypeToXML "nonpublicExecutionReportRetracted" x+instance Extension NonCorrectableRequestMessage RequestMessage where+ supertype v = RequestMessage_NonCorrectableRequestMessage v+instance Extension NonCorrectableRequestMessage Message where+ supertype = (supertype :: RequestMessage -> Message)+ . (supertype :: NonCorrectableRequestMessage -> RequestMessage)+ +instance Extension NonCorrectableRequestMessage Document where+ supertype = (supertype :: Message -> Document)+ . (supertype :: RequestMessage -> Message)+ . (supertype :: NonCorrectableRequestMessage -> RequestMessage)+ + +-- | A type defining the basic content for a message sent to +-- inform another system that some 'business event' has +-- occured. Notifications are not expected to be replied to.+data NotificationMessage+ = NotificationMessage_ServiceNotification ServiceNotification+ | NotificationMessage_ValuationReportRetracted ValuationReportRetracted+ | NotificationMessage_ValuationReport ValuationReport+ + deriving (Eq,Show)+instance SchemaType NotificationMessage where+ parseSchemaType s = do+ (fmap NotificationMessage_ServiceNotification $ parseSchemaType s)+ `onFail`+ (fmap NotificationMessage_ValuationReportRetracted $ parseSchemaType s)+ `onFail`+ (fmap NotificationMessage_ValuationReport $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of NotificationMessage,\n\+\ namely one of:\n\+\ServiceNotification,ValuationReportRetracted,ValuationReport"+ schemaTypeToXML _s (NotificationMessage_ServiceNotification x) = schemaTypeToXML "serviceNotification" x+ schemaTypeToXML _s (NotificationMessage_ValuationReportRetracted x) = schemaTypeToXML "valuationReportRetracted" x+ schemaTypeToXML _s (NotificationMessage_ValuationReport x) = schemaTypeToXML "valuationReport" x+instance Extension NotificationMessage Message where+ supertype v = Message_NotificationMessage v+ +-- | A type that refines the generic message header to match the +-- requirements of a NotificationMessage.+data NotificationMessageHeader = NotificationMessageHeader+ { notifMessageHeader_messageId :: Maybe MessageId+ -- ^ A unique identifier (within its coding scheme) assigned to + -- the message by its creating party.+ , notifMessageHeader_inReplyTo :: Maybe MessageId+ -- ^ A copy of the unique message identifier (within it own + -- coding scheme) to which this message is responding.+ , notifMessageHeader_sentBy :: Maybe MessageAddress+ -- ^ The unique identifier (within its coding scheme) for the + -- originator of a message instance.+ , notifMessageHeader_sendTo :: [MessageAddress]+ -- ^ A unique identifier (within its coding scheme) indicating + -- an intended recipent of a message.+ , notifMessageHeader_copyTo :: [MessageAddress]+ -- ^ A unique identifier (within the specified coding scheme) + -- giving the details of some party to whom a copy of this + -- message will be sent for reference.+ , notifMessageHeader_creationTimestamp :: Maybe Xsd.DateTime+ -- ^ The date and time (on the source system) when this message + -- instance was created.+ , notifMessageHeader_expiryTimestamp :: Maybe Xsd.DateTime+ -- ^ The date and time (on the source system) when this message + -- instance will be considered expired.+ , notifMessageHeader_implementationSpecification :: Maybe ImplementationSpecification+ -- ^ The version(s) of specifications that the sender asserts + -- the message was developed for.+ , notifMessageHeader_partyMessageInformation :: [PartyMessageInformation]+ -- ^ Additional message information that may be provided by each + -- involved party.+ , notifMessageHeader_signature :: [SignatureType]+ }+ deriving (Eq,Show)+instance SchemaType NotificationMessageHeader where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return NotificationMessageHeader+ `apply` optional (parseSchemaType "messageId")+ `apply` optional (parseSchemaType "inReplyTo")+ `apply` optional (parseSchemaType "sentBy")+ `apply` many (parseSchemaType "sendTo")+ `apply` many (parseSchemaType "copyTo")+ `apply` optional (parseSchemaType "creationTimestamp")+ `apply` optional (parseSchemaType "expiryTimestamp")+ `apply` optional (parseSchemaType "implementationSpecification")+ `apply` many (parseSchemaType "partyMessageInformation")+ `apply` many (elementSignature)+ schemaTypeToXML s x@NotificationMessageHeader{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "messageId") $ notifMessageHeader_messageId x+ , maybe [] (schemaTypeToXML "inReplyTo") $ notifMessageHeader_inReplyTo x+ , maybe [] (schemaTypeToXML "sentBy") $ notifMessageHeader_sentBy x+ , concatMap (schemaTypeToXML "sendTo") $ notifMessageHeader_sendTo x+ , concatMap (schemaTypeToXML "copyTo") $ notifMessageHeader_copyTo x+ , maybe [] (schemaTypeToXML "creationTimestamp") $ notifMessageHeader_creationTimestamp x+ , maybe [] (schemaTypeToXML "expiryTimestamp") $ notifMessageHeader_expiryTimestamp x+ , maybe [] (schemaTypeToXML "implementationSpecification") $ notifMessageHeader_implementationSpecification x+ , concatMap (schemaTypeToXML "partyMessageInformation") $ notifMessageHeader_partyMessageInformation x+ , concatMap (elementToXMLSignature) $ notifMessageHeader_signature x+ ]+instance Extension NotificationMessageHeader MessageHeader where+ supertype v = MessageHeader_NotificationMessageHeader v+ +-- | A version of a specification document used by the message +-- generator to format the document.+data ImplementationSpecification = ImplementationSpecification+ { implemSpecif_name :: Maybe Xsd.NormalizedString+ , implemSpecif_version :: Maybe ImplementationSpecificationVersion+ , implemSpecif_date :: Maybe Xsd.Date+ }+ deriving (Eq,Show)+instance SchemaType ImplementationSpecification where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ImplementationSpecification+ `apply` optional (parseSchemaType "name")+ `apply` optional (parseSchemaType "version")+ `apply` optional (parseSchemaType "date")+ schemaTypeToXML s x@ImplementationSpecification{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "name") $ implemSpecif_name x+ , maybe [] (schemaTypeToXML "version") $ implemSpecif_version x+ , maybe [] (schemaTypeToXML "date") $ implemSpecif_date x+ ]+ +data ImplementationSpecificationVersion = ImplementationSpecificationVersion Scheme ImplementationSpecificationVersionAttributes deriving (Eq,Show)+data ImplementationSpecificationVersionAttributes = ImplementationSpecificationVersionAttributes+ { isva_implementationSpecificationVersionScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ImplementationSpecificationVersion where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "implementationSpecificationVersionScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ImplementationSpecificationVersion v (ImplementationSpecificationVersionAttributes a0)+ schemaTypeToXML s (ImplementationSpecificationVersion bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "implementationSpecificationVersionScheme") $ isva_implementationSpecificationVersionScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ImplementationSpecificationVersion Scheme where+ supertype (ImplementationSpecificationVersion s _) = s+ +-- | A type defining additional information that may be recorded +-- against a message.+data PartyMessageInformation = PartyMessageInformation+ { partyMessageInfo_partyReference :: Maybe PartyReference+ -- ^ Identifies that party that has ownership of this + -- information.+ }+ deriving (Eq,Show)+instance SchemaType PartyMessageInformation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PartyMessageInformation+ `apply` optional (parseSchemaType "partyReference")+ schemaTypeToXML s x@PartyMessageInformation{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "partyReference") $ partyMessageInfo_partyReference x+ ]+ +-- | A structure used to group together individual messages that +-- can be acted on at a group level.+data PortfolioReference = PortfolioReference+ { portfRef_portfolioName :: Maybe PortfolioName+ -- ^ An identifier that is unique for each portfolio-level + -- request, and which can be used to group together the + -- individual messages in the portfolio request.+ , portfRef_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric, sequentially ascending (i.e. gapless) value + -- (starting at 1) that can be used to identify and + -- distinguish the individual constituents of a portfolio + -- request. A recipient should ensure that all sequence + -- numbers from 1 to the final sequence number (where + -- submissionsComplete is true) have arrived before completing + -- the portfolio request.+ , portfRef_submissionsComplete :: Maybe Xsd.Boolean+ -- ^ Indicates whether all individual requests have been + -- submitted for this portfolio request.+ }+ deriving (Eq,Show)+instance SchemaType PortfolioReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PortfolioReference+ `apply` optional (parseSchemaType "portfolioName")+ `apply` optional (parseSchemaType "sequenceNumber")+ `apply` optional (parseSchemaType "submissionsComplete")+ schemaTypeToXML s x@PortfolioReference{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "portfolioName") $ portfRef_portfolioName x+ , maybe [] (schemaTypeToXML "sequenceNumber") $ portfRef_sequenceNumber x+ , maybe [] (schemaTypeToXML "submissionsComplete") $ portfRef_submissionsComplete x+ ]+instance Extension PortfolioReference PortfolioReferenceBase where+ supertype (PortfolioReference e0 e1 e2) =+ PortfolioReferenceBase e0+ +-- | A structure used to group together individual messages that +-- can be acted on at a group level.+data PortfolioConstituentReference = PortfolioConstituentReference+ { portfConstitRef_portfolioName :: Maybe PortfolioName+ -- ^ An identifier that is unique for each portfolio-level + -- request, and which can be used to group together the + -- individual messages in the portfolio request.+ , portfConstitRef_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric, sequentially ascending (i.e. gapless) value + -- (starting at 1) that can be used to identify and + -- distinguish the individual constituents of a portfolio + -- request. A recipient should ensure that all sequence + -- numbers from 1 to the final sequence number (where + -- submissionsComplete is true) have arrived before completing + -- the portfolio request.+ }+ deriving (Eq,Show)+instance SchemaType PortfolioConstituentReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PortfolioConstituentReference+ `apply` optional (parseSchemaType "portfolioName")+ `apply` optional (parseSchemaType "sequenceNumber")+ schemaTypeToXML s x@PortfolioConstituentReference{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "portfolioName") $ portfConstitRef_portfolioName x+ , maybe [] (schemaTypeToXML "sequenceNumber") $ portfConstitRef_sequenceNumber x+ ]+instance Extension PortfolioConstituentReference PortfolioReferenceBase where+ supertype (PortfolioConstituentReference e0 e1) =+ PortfolioReferenceBase e0+ +-- | A structure used to identify a portfolio in a message.+data PortfolioReferenceBase = PortfolioReferenceBase+ { portfRefBase_portfolioName :: Maybe PortfolioName+ -- ^ An identifier that is unique for each portfolio-level + -- request, and which can be used to group together the + -- individual messages in the portfolio request.+ }+ deriving (Eq,Show)+instance SchemaType PortfolioReferenceBase where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PortfolioReferenceBase+ `apply` optional (parseSchemaType "portfolioName")+ schemaTypeToXML s x@PortfolioReferenceBase{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "portfolioName") $ portfRefBase_portfolioName x+ ]+ + + + + +-- | Provides a lexical location (i.e. a line number and +-- character for bad XML) or an XPath location (i.e. place to +-- identify the bad location for valid XML).+data ProblemLocation = ProblemLocation Xsd.NormalizedString ProblemLocationAttributes deriving (Eq,Show)+data ProblemLocationAttributes = ProblemLocationAttributes+ { problemLocatAttrib_locationType :: Maybe Xsd.Token+ -- ^ The value of the locationType attribute defines which type + -- of location has been given. It may take the values + -- 'lexical' or 'xpath'.+ }+ deriving (Eq,Show)+instance SchemaType ProblemLocation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "locationType" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ProblemLocation v (ProblemLocationAttributes a0)+ schemaTypeToXML s (ProblemLocation bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "locationType") $ problemLocatAttrib_locationType at+ ]+ $ schemaTypeToXML s bt+instance Extension ProblemLocation Xsd.NormalizedString where+ supertype (ProblemLocation s _) = s+ +-- | A type defining a content model for describing the nature +-- and possible location of a error within a previous message.+data Reason = Reason+ { reason_code :: Maybe ReasonCode+ -- ^ A machine interpretable error code.+ , reason_location :: Maybe ProblemLocation+ -- ^ A value indicating the location of the problem within the + -- subject message.+ , reason_description :: Maybe Xsd.XsdString+ -- ^ Plain English text describing the associated error + -- condition+ , reason_validationRuleId :: Maybe Validation+ -- ^ A reference identifying a rule within a validation scheme+ , reason_additionalData :: [AdditionalData]+ -- ^ Any string of additional data that may help the message + -- processor, for example in a rejection message this might + -- contain a code value or the text of any one of the messages + -- (within a CDATA section).+ }+ deriving (Eq,Show)+instance SchemaType Reason where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Reason+ `apply` optional (parseSchemaType "reasonCode")+ `apply` optional (parseSchemaType "location")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "validationRuleId")+ `apply` many (parseSchemaType "additionalData")+ schemaTypeToXML s x@Reason{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "reasonCode") $ reason_code x+ , maybe [] (schemaTypeToXML "location") $ reason_location x+ , maybe [] (schemaTypeToXML "description") $ reason_description x+ , maybe [] (schemaTypeToXML "validationRuleId") $ reason_validationRuleId x+ , concatMap (schemaTypeToXML "additionalData") $ reason_additionalData x+ ]+ +-- | Defines a list of machine interpretable error codes.+data ReasonCode = ReasonCode Scheme ReasonCodeAttributes deriving (Eq,Show)+data ReasonCodeAttributes = ReasonCodeAttributes+ { reasonCodeAttrib_reasonCodeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ReasonCode where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "reasonCodeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ReasonCode v (ReasonCodeAttributes a0)+ schemaTypeToXML s (ReasonCode bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "reasonCodeScheme") $ reasonCodeAttrib_reasonCodeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ReasonCode Scheme where+ supertype (ReasonCode s _) = s+ +-- | A type that allows the specific report and section to be +-- identified.+data ReportIdentification = ReportIdentification+ { reportIdent_reportId :: Maybe ReportId+ -- ^ An identifier for the specific instance of this report.+ , reportIdent_sectionNumber :: Maybe Xsd.PositiveInteger+ -- ^ A strictly ascending sequential (gapless) numeric value + -- that can be used to identify the section of a report.+ , reportIdent_numberOfSections :: Maybe Xsd.PositiveInteger+ -- ^ A numeric value, optionally supplied by the sender, that + -- can be used to specify the number of sections constituting + -- a report.+ , reportIdent_submissionsComplete :: Maybe Xsd.Boolean+ -- ^ Indicates whether all sections have been sent for this + -- report instance ID.+ }+ deriving (Eq,Show)+instance SchemaType ReportIdentification where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReportIdentification+ `apply` optional (parseSchemaType "reportId")+ `apply` optional (parseSchemaType "sectionNumber")+ `apply` optional (parseSchemaType "numberOfSections")+ `apply` optional (parseSchemaType "submissionsComplete")+ schemaTypeToXML s x@ReportIdentification{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "reportId") $ reportIdent_reportId x+ , maybe [] (schemaTypeToXML "sectionNumber") $ reportIdent_sectionNumber x+ , maybe [] (schemaTypeToXML "numberOfSections") $ reportIdent_numberOfSections x+ , maybe [] (schemaTypeToXML "submissionsComplete") $ reportIdent_submissionsComplete x+ ]+instance Extension ReportIdentification ReportSectionIdentification where+ supertype (ReportIdentification e0 e1 e2 e3) =+ ReportSectionIdentification e0 e1+ +-- | A type that allows the specific report and section to be +-- identified.+data ReportSectionIdentification = ReportSectionIdentification+ { reportSectionIdent_reportId :: Maybe ReportId+ -- ^ An identifier for the specific instance of this report.+ , reportSectionIdent_sectionNumber :: Maybe Xsd.PositiveInteger+ -- ^ A strictly ascending sequential (gapless) numeric value + -- that can be used to identify the section of a report.+ }+ deriving (Eq,Show)+instance SchemaType ReportSectionIdentification where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReportSectionIdentification+ `apply` optional (parseSchemaType "reportId")+ `apply` optional (parseSchemaType "sectionNumber")+ schemaTypeToXML s x@ReportSectionIdentification{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "reportId") $ reportSectionIdent_reportId x+ , maybe [] (schemaTypeToXML "sectionNumber") $ reportSectionIdent_sectionNumber x+ ]+ +-- | A type that can be used to hold an identifier for a report +-- instance.+data ReportId = ReportId Scheme ReportIdAttributes deriving (Eq,Show)+data ReportIdAttributes = ReportIdAttributes+ { reportIdAttrib_reportIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ReportId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "reportIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ReportId v (ReportIdAttributes a0)+ schemaTypeToXML s (ReportId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "reportIdScheme") $ reportIdAttrib_reportIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ReportId Scheme where+ supertype (ReportId s _) = s+ +-- | A type defining the content model for a message allowing +-- one party to query the status of one event (trade or +-- post-trade event) previously sent to another party.+data RequestEventStatus = RequestEventStatus+ { reqEventStatus_fpmlVersion :: Xsd.XsdString+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , reqEventStatus_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , reqEventStatus_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , reqEventStatus_header :: Maybe RequestMessageHeader+ , reqEventStatus_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , reqEventStatus_parentCorrelationId :: Maybe CorrelationId+ -- ^ An optional identifier used to correlate between related + -- processes+ , reqEventStatus_correlationId :: [CorrelationId]+ -- ^ A qualified identifier used to correlate between messages+ , reqEventStatus_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric value that can be used to order messages with the + -- same correlation identifier from the same sender.+ , reqEventStatus_onBehalfOf :: [OnBehalfOf]+ -- ^ Indicates which party (or parties) (and accounts) a trade + -- or event is being processed for. Normally there will only + -- be a maximum of 2 parties, but in the case of a novation + -- there could be a transferor, transferee, remaining party, + -- and other remaining party. Except for this case, there + -- should be no more than two onABehalfOf references in a + -- message.+ , reqEventStatus_businessProcess :: Maybe BusinessProcess+ , reqEventStatus_eventIdentifier :: Maybe EventIdentifier+ , reqEventStatus_party :: [Party]+ , reqEventStatus_account :: [Account]+ -- ^ Optional account information used to precisely define the + -- origination and destination of financial instruments.+ }+ deriving (Eq,Show)+instance SchemaType RequestEventStatus 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 (RequestEventStatus 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` optional (parseSchemaType "businessProcess")+ `apply` optional (parseSchemaType "eventIdentifier")+ `apply` many (parseSchemaType "party")+ `apply` many (parseSchemaType "account")+ schemaTypeToXML s x@RequestEventStatus{} =+ toXMLElement s [ toXMLAttribute "fpmlVersion" $ reqEventStatus_fpmlVersion x+ , maybe [] (toXMLAttribute "expectedBuild") $ reqEventStatus_expectedBuild x+ , maybe [] (toXMLAttribute "actualBuild") $ reqEventStatus_actualBuild x+ ]+ [ maybe [] (schemaTypeToXML "header") $ reqEventStatus_header x+ , concatMap (schemaTypeToXML "validation") $ reqEventStatus_validation x+ , maybe [] (schemaTypeToXML "parentCorrelationId") $ reqEventStatus_parentCorrelationId x+ , concatMap (schemaTypeToXML "correlationId") $ reqEventStatus_correlationId x+ , maybe [] (schemaTypeToXML "sequenceNumber") $ reqEventStatus_sequenceNumber x+ , concatMap (schemaTypeToXML "onBehalfOf") $ reqEventStatus_onBehalfOf x+ , maybe [] (schemaTypeToXML "businessProcess") $ reqEventStatus_businessProcess x+ , maybe [] (schemaTypeToXML "eventIdentifier") $ reqEventStatus_eventIdentifier x+ , concatMap (schemaTypeToXML "party") $ reqEventStatus_party x+ , concatMap (schemaTypeToXML "account") $ reqEventStatus_account x+ ]+instance Extension RequestEventStatus NonCorrectableRequestMessage where+ supertype v = NonCorrectableRequestMessage_RequestEventStatus v+instance Extension RequestEventStatus RequestMessage where+ supertype = (supertype :: NonCorrectableRequestMessage -> RequestMessage)+ . (supertype :: RequestEventStatus -> NonCorrectableRequestMessage)+ +instance Extension RequestEventStatus Message where+ supertype = (supertype :: RequestMessage -> Message)+ . (supertype :: NonCorrectableRequestMessage -> RequestMessage)+ . (supertype :: RequestEventStatus -> NonCorrectableRequestMessage)+ +instance Extension RequestEventStatus Document where+ supertype = (supertype :: Message -> Document)+ . (supertype :: RequestMessage -> Message)+ . (supertype :: NonCorrectableRequestMessage -> RequestMessage)+ . (supertype :: RequestEventStatus -> NonCorrectableRequestMessage)+ + +-- | A type that can be used to identify the type of business +-- process in a request. Examples include Allocation, +-- Clearing, Confirmation, etc.+data BusinessProcess = BusinessProcess Scheme BusinessProcessAttributes deriving (Eq,Show)+data BusinessProcessAttributes = BusinessProcessAttributes+ { busProcessAttrib_businessProcessScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType BusinessProcess where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "businessProcessScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ BusinessProcess v (BusinessProcessAttributes a0)+ schemaTypeToXML s (BusinessProcess bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "businessProcessScheme") $ busProcessAttrib_businessProcessScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension BusinessProcess Scheme where+ supertype (BusinessProcess s _) = s+ +-- | A type defining the basic content of a message that +-- requests the receiver to perform some business operation +-- determined by the message type and its content.+data RequestMessage+ = RequestMessage_NonCorrectableRequestMessage NonCorrectableRequestMessage+ | RequestMessage_CorrectableRequestMessage CorrectableRequestMessage+ + deriving (Eq,Show)+instance SchemaType RequestMessage where+ parseSchemaType s = do+ (fmap RequestMessage_NonCorrectableRequestMessage $ parseSchemaType s)+ `onFail`+ (fmap RequestMessage_CorrectableRequestMessage $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of RequestMessage,\n\+\ namely one of:\n\+\NonCorrectableRequestMessage,CorrectableRequestMessage"+ schemaTypeToXML _s (RequestMessage_NonCorrectableRequestMessage x) = schemaTypeToXML "nonCorrectableRequestMessage" x+ schemaTypeToXML _s (RequestMessage_CorrectableRequestMessage x) = schemaTypeToXML "correctableRequestMessage" x+instance Extension RequestMessage Message where+ supertype v = Message_RequestMessage v+ +-- | A type refining the generic message header content to make +-- it specific to request messages.+data RequestMessageHeader = RequestMessageHeader+ { reqMessageHeader_messageId :: Maybe MessageId+ -- ^ A unique identifier (within its coding scheme) assigned to + -- the message by its creating party.+ , reqMessageHeader_sentBy :: Maybe MessageAddress+ -- ^ The unique identifier (within its coding scheme) for the + -- originator of a message instance.+ , reqMessageHeader_sendTo :: [MessageAddress]+ -- ^ A unique identifier (within its coding scheme) indicating + -- an intended recipent of a message.+ , reqMessageHeader_copyTo :: [MessageAddress]+ -- ^ A unique identifier (within the specified coding scheme) + -- giving the details of some party to whom a copy of this + -- message will be sent for reference.+ , reqMessageHeader_creationTimestamp :: Maybe Xsd.DateTime+ -- ^ The date and time (on the source system) when this message + -- instance was created.+ , reqMessageHeader_expiryTimestamp :: Maybe Xsd.DateTime+ -- ^ The date and time (on the source system) when this message + -- instance will be considered expired.+ , reqMessageHeader_implementationSpecification :: Maybe ImplementationSpecification+ -- ^ The version(s) of specifications that the sender asserts + -- the message was developed for.+ , reqMessageHeader_partyMessageInformation :: [PartyMessageInformation]+ -- ^ Additional message information that may be provided by each + -- involved party.+ , reqMessageHeader_signature :: [SignatureType]+ }+ deriving (Eq,Show)+instance SchemaType RequestMessageHeader where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return RequestMessageHeader+ `apply` optional (parseSchemaType "messageId")+ `apply` optional (parseSchemaType "sentBy")+ `apply` many (parseSchemaType "sendTo")+ `apply` many (parseSchemaType "copyTo")+ `apply` optional (parseSchemaType "creationTimestamp")+ `apply` optional (parseSchemaType "expiryTimestamp")+ `apply` optional (parseSchemaType "implementationSpecification")+ `apply` many (parseSchemaType "partyMessageInformation")+ `apply` many (elementSignature)+ schemaTypeToXML s x@RequestMessageHeader{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "messageId") $ reqMessageHeader_messageId x+ , maybe [] (schemaTypeToXML "sentBy") $ reqMessageHeader_sentBy x+ , concatMap (schemaTypeToXML "sendTo") $ reqMessageHeader_sendTo x+ , concatMap (schemaTypeToXML "copyTo") $ reqMessageHeader_copyTo x+ , maybe [] (schemaTypeToXML "creationTimestamp") $ reqMessageHeader_creationTimestamp x+ , maybe [] (schemaTypeToXML "expiryTimestamp") $ reqMessageHeader_expiryTimestamp x+ , maybe [] (schemaTypeToXML "implementationSpecification") $ reqMessageHeader_implementationSpecification x+ , concatMap (schemaTypeToXML "partyMessageInformation") $ reqMessageHeader_partyMessageInformation x+ , concatMap (elementToXMLSignature) $ reqMessageHeader_signature x+ ]+instance Extension RequestMessageHeader MessageHeader where+ supertype v = MessageHeader_RequestMessageHeader v+ +-- | A message to request that a message be retransmitted. The +-- original message will typically be a component of a group +-- of messages, such as a portfolio or a report in multiple +-- parts.+data RequestRetransmission = RequestRetransmission+ { reqRetran_fpmlVersion :: Xsd.XsdString+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , reqRetran_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , reqRetran_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , reqRetran_header :: Maybe RequestMessageHeader+ , reqRetran_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , reqRetran_parentCorrelationId :: Maybe CorrelationId+ -- ^ An optional identifier used to correlate between related + -- processes+ , reqRetran_correlationId :: [CorrelationId]+ -- ^ A qualified identifier used to correlate between messages+ , reqRetran_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric value that can be used to order messages with the + -- same correlation identifier from the same sender.+ , reqRetran_onBehalfOf :: [OnBehalfOf]+ -- ^ Indicates which party (or parties) (and accounts) a trade + -- or event is being processed for. Normally there will only + -- be a maximum of 2 parties, but in the case of a novation + -- there could be a transferor, transferee, remaining party, + -- and other remaining party. Except for this case, there + -- should be no more than two onABehalfOf references in a + -- message.+ , reqRetran_choice6 :: (Maybe (OneOf2 PortfolioConstituentReference ReportSectionIdentification))+ -- ^ Choice between:+ -- + -- (1) portfolioReference+ -- + -- (2) reportIdentification+ , reqRetran_party :: [Party]+ , reqRetran_account :: [Account]+ -- ^ Optional account information used to precisely define the + -- origination and destination of financial instruments.+ }+ deriving (Eq,Show)+instance SchemaType RequestRetransmission 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 (RequestRetransmission 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` optional (oneOf' [ ("PortfolioConstituentReference", fmap OneOf2 (parseSchemaType "portfolioReference"))+ , ("ReportSectionIdentification", fmap TwoOf2 (parseSchemaType "reportIdentification"))+ ])+ `apply` many (parseSchemaType "party")+ `apply` many (parseSchemaType "account")+ schemaTypeToXML s x@RequestRetransmission{} =+ toXMLElement s [ toXMLAttribute "fpmlVersion" $ reqRetran_fpmlVersion x+ , maybe [] (toXMLAttribute "expectedBuild") $ reqRetran_expectedBuild x+ , maybe [] (toXMLAttribute "actualBuild") $ reqRetran_actualBuild x+ ]+ [ maybe [] (schemaTypeToXML "header") $ reqRetran_header x+ , concatMap (schemaTypeToXML "validation") $ reqRetran_validation x+ , maybe [] (schemaTypeToXML "parentCorrelationId") $ reqRetran_parentCorrelationId x+ , concatMap (schemaTypeToXML "correlationId") $ reqRetran_correlationId x+ , maybe [] (schemaTypeToXML "sequenceNumber") $ reqRetran_sequenceNumber x+ , concatMap (schemaTypeToXML "onBehalfOf") $ reqRetran_onBehalfOf x+ , maybe [] (foldOneOf2 (schemaTypeToXML "portfolioReference")+ (schemaTypeToXML "reportIdentification")+ ) $ reqRetran_choice6 x+ , concatMap (schemaTypeToXML "party") $ reqRetran_party x+ , concatMap (schemaTypeToXML "account") $ reqRetran_account x+ ]+instance Extension RequestRetransmission NonCorrectableRequestMessage where+ supertype v = NonCorrectableRequestMessage_RequestRetransmission v+instance Extension RequestRetransmission RequestMessage where+ supertype = (supertype :: NonCorrectableRequestMessage -> RequestMessage)+ . (supertype :: RequestRetransmission -> NonCorrectableRequestMessage)+ +instance Extension RequestRetransmission Message where+ supertype = (supertype :: RequestMessage -> Message)+ . (supertype :: NonCorrectableRequestMessage -> RequestMessage)+ . (supertype :: RequestRetransmission -> NonCorrectableRequestMessage)+ +instance Extension RequestRetransmission Document where+ supertype = (supertype :: Message -> Document)+ . (supertype :: RequestMessage -> Message)+ . (supertype :: NonCorrectableRequestMessage -> RequestMessage)+ . (supertype :: RequestRetransmission -> NonCorrectableRequestMessage)+ + +-- | A type refining the generic message content model to make +-- it specific to response messages.+data ResponseMessage+ = ResponseMessage_EventStatusResponse EventStatusResponse+ | ResponseMessage_Acknowledgement Acknowledgement+ + deriving (Eq,Show)+instance SchemaType ResponseMessage where+ parseSchemaType s = do+ (fmap ResponseMessage_EventStatusResponse $ parseSchemaType s)+ `onFail`+ (fmap ResponseMessage_Acknowledgement $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of ResponseMessage,\n\+\ namely one of:\n\+\EventStatusResponse,Acknowledgement"+ schemaTypeToXML _s (ResponseMessage_EventStatusResponse x) = schemaTypeToXML "eventStatusResponse" x+ schemaTypeToXML _s (ResponseMessage_Acknowledgement x) = schemaTypeToXML "acknowledgement" x+instance Extension ResponseMessage Message where+ supertype v = Message_ResponseMessage v+ +-- | A type refining the generic message header to make it +-- specific to response messages.+data ResponseMessageHeader = ResponseMessageHeader+ { responMessageHeader_messageId :: Maybe MessageId+ -- ^ A unique identifier (within its coding scheme) assigned to + -- the message by its creating party.+ , responMessageHeader_inReplyTo :: Maybe MessageId+ -- ^ A copy of the unique message identifier (within it own + -- coding scheme) to which this message is responding.+ , responMessageHeader_sentBy :: Maybe MessageAddress+ -- ^ The unique identifier (within its coding scheme) for the + -- originator of a message instance.+ , responMessageHeader_sendTo :: [MessageAddress]+ -- ^ A unique identifier (within its coding scheme) indicating + -- an intended recipent of a message.+ , responMessageHeader_copyTo :: [MessageAddress]+ -- ^ A unique identifier (within the specified coding scheme) + -- giving the details of some party to whom a copy of this + -- message will be sent for reference.+ , responMessageHeader_creationTimestamp :: Maybe Xsd.DateTime+ -- ^ The date and time (on the source system) when this message + -- instance was created.+ , responMessageHeader_expiryTimestamp :: Maybe Xsd.DateTime+ -- ^ The date and time (on the source system) when this message + -- instance will be considered expired.+ , responMessageHeader_implementationSpecification :: Maybe ImplementationSpecification+ -- ^ The version(s) of specifications that the sender asserts + -- the message was developed for.+ , responMessageHeader_partyMessageInformation :: [PartyMessageInformation]+ -- ^ Additional message information that may be provided by each + -- involved party.+ , responMessageHeader_signature :: [SignatureType]+ }+ deriving (Eq,Show)+instance SchemaType ResponseMessageHeader where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ResponseMessageHeader+ `apply` optional (parseSchemaType "messageId")+ `apply` optional (parseSchemaType "inReplyTo")+ `apply` optional (parseSchemaType "sentBy")+ `apply` many (parseSchemaType "sendTo")+ `apply` many (parseSchemaType "copyTo")+ `apply` optional (parseSchemaType "creationTimestamp")+ `apply` optional (parseSchemaType "expiryTimestamp")+ `apply` optional (parseSchemaType "implementationSpecification")+ `apply` many (parseSchemaType "partyMessageInformation")+ `apply` many (elementSignature)+ schemaTypeToXML s x@ResponseMessageHeader{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "messageId") $ responMessageHeader_messageId x+ , maybe [] (schemaTypeToXML "inReplyTo") $ responMessageHeader_inReplyTo x+ , maybe [] (schemaTypeToXML "sentBy") $ responMessageHeader_sentBy x+ , concatMap (schemaTypeToXML "sendTo") $ responMessageHeader_sendTo x+ , concatMap (schemaTypeToXML "copyTo") $ responMessageHeader_copyTo x+ , maybe [] (schemaTypeToXML "creationTimestamp") $ responMessageHeader_creationTimestamp x+ , maybe [] (schemaTypeToXML "expiryTimestamp") $ responMessageHeader_expiryTimestamp x+ , maybe [] (schemaTypeToXML "implementationSpecification") $ responMessageHeader_implementationSpecification x+ , concatMap (schemaTypeToXML "partyMessageInformation") $ responMessageHeader_partyMessageInformation x+ , concatMap (elementToXMLSignature) $ responMessageHeader_signature x+ ]+instance Extension ResponseMessageHeader MessageHeader where+ supertype v = MessageHeader_ResponseMessageHeader v+ + + + + + + + + +-- | Event Status messages.+ +elementRequestEventStatus :: XMLParser RequestEventStatus+elementRequestEventStatus = parseSchemaType "requestEventStatus"+elementToXMLRequestEventStatus :: RequestEventStatus -> [Content ()]+elementToXMLRequestEventStatus = schemaTypeToXML "requestEventStatus"+ +elementRequestRetransmission :: XMLParser RequestRetransmission+elementRequestRetransmission = parseSchemaType "requestRetransmission"+elementToXMLRequestRetransmission :: RequestRetransmission -> [Content ()]+elementToXMLRequestRetransmission = schemaTypeToXML "requestRetransmission"+ +-- | A type defining the content model for a message that allows +-- a service to send a notification message to a user of the +-- service.+data ServiceNotification = ServiceNotification+ { serviceNotif_fpmlVersion :: Xsd.XsdString+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , serviceNotif_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , serviceNotif_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , serviceNotif_header :: Maybe NotificationMessageHeader+ , serviceNotif_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , serviceNotif_parentCorrelationId :: Maybe CorrelationId+ -- ^ An optional identifier used to correlate between related + -- processes+ , serviceNotif_correlationId :: [CorrelationId]+ -- ^ A qualified identifier used to correlate between messages+ , serviceNotif_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric value that can be used to order messages with the + -- same correlation identifier from the same sender.+ , serviceNotif_onBehalfOf :: [OnBehalfOf]+ -- ^ Indicates which party (or parties) (and accounts) a trade + -- or event is being processed for. Normally there will only + -- be a maximum of 2 parties, but in the case of a novation + -- there could be a transferor, transferee, remaining party, + -- and other remaining party. Except for this case, there + -- should be no more than two onABehalfOf references in a + -- message.+ , serviceNotif_serviceName :: Maybe Xsd.NormalizedString+ -- ^ The name of the service to which the message applies+ , serviceNotif_choice7 :: (Maybe (OneOf3 ServiceStatus ServiceProcessingStatus ServiceAdvisory))+ -- ^ Choice between:+ -- + -- (1) The current state of the service (e.g. Available, + -- Unavailable).+ -- + -- (2) A description of the stage of processing of the + -- service, for example EndofDayProcessingCutoffOccurred, + -- EndOfDayProcessingCompleted. [TBD: could be combined + -- with advisory]+ -- + -- (3) A human-readable message providing information about + -- the service..+ }+ deriving (Eq,Show)+instance SchemaType ServiceNotification 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 (ServiceNotification 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` optional (parseSchemaType "serviceName")+ `apply` optional (oneOf' [ ("ServiceStatus", fmap OneOf3 (parseSchemaType "status"))+ , ("ServiceProcessingStatus", fmap TwoOf3 (parseSchemaType "processingStatus"))+ , ("ServiceAdvisory", fmap ThreeOf3 (parseSchemaType "advisory"))+ ])+ schemaTypeToXML s x@ServiceNotification{} =+ toXMLElement s [ toXMLAttribute "fpmlVersion" $ serviceNotif_fpmlVersion x+ , maybe [] (toXMLAttribute "expectedBuild") $ serviceNotif_expectedBuild x+ , maybe [] (toXMLAttribute "actualBuild") $ serviceNotif_actualBuild x+ ]+ [ maybe [] (schemaTypeToXML "header") $ serviceNotif_header x+ , concatMap (schemaTypeToXML "validation") $ serviceNotif_validation x+ , maybe [] (schemaTypeToXML "parentCorrelationId") $ serviceNotif_parentCorrelationId x+ , concatMap (schemaTypeToXML "correlationId") $ serviceNotif_correlationId x+ , maybe [] (schemaTypeToXML "sequenceNumber") $ serviceNotif_sequenceNumber x+ , concatMap (schemaTypeToXML "onBehalfOf") $ serviceNotif_onBehalfOf x+ , maybe [] (schemaTypeToXML "serviceName") $ serviceNotif_serviceName x+ , maybe [] (foldOneOf3 (schemaTypeToXML "status")+ (schemaTypeToXML "processingStatus")+ (schemaTypeToXML "advisory")+ ) $ serviceNotif_choice7 x+ ]+instance Extension ServiceNotification NotificationMessage where+ supertype v = NotificationMessage_ServiceNotification v+instance Extension ServiceNotification Message where+ supertype = (supertype :: NotificationMessage -> Message)+ . (supertype :: ServiceNotification -> NotificationMessage)+ +instance Extension ServiceNotification Document where+ supertype = (supertype :: Message -> Document)+ . (supertype :: NotificationMessage -> Message)+ . (supertype :: ServiceNotification -> NotificationMessage)+ + +-- | A type defining the content model for report on the status +-- of the processing by a service. In the future we may wish +-- to provide some kind of scope or other qualification for +-- the event, e.g. the currencies, products, or books to which +-- it applies.+data ServiceProcessingStatus = ServiceProcessingStatus+ { serviceProcesStatus_cycle :: Maybe ServiceProcessingCycle+ -- ^ The processing cycle or phase that this message describes. + -- For example, EndOfDay or Intraday.+ , serviceProcesStatus_step :: Maybe ServiceProcessingStep+ -- ^ The stage within a processing cycle or phase that this + -- message describes. For example, Netting or Valuation.+ , serviceProcesStatus_event :: Maybe ServiceProcessingEvent+ -- ^ The event that occurred within the cycle or step, for + -- example "Started" or "Completed"..+ }+ deriving (Eq,Show)+instance SchemaType ServiceProcessingStatus where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ServiceProcessingStatus+ `apply` optional (parseSchemaType "cycle")+ `apply` optional (parseSchemaType "step")+ `apply` optional (parseSchemaType "event")+ schemaTypeToXML s x@ServiceProcessingStatus{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "cycle") $ serviceProcesStatus_cycle x+ , maybe [] (schemaTypeToXML "step") $ serviceProcesStatus_step x+ , maybe [] (schemaTypeToXML "event") $ serviceProcesStatus_event x+ ]+ +-- | A type that can be used to describe the availability or +-- other state of a service, e.g. Available, Unavaialble.+data ServiceStatus = ServiceStatus Scheme ServiceStatusAttributes deriving (Eq,Show)+data ServiceStatusAttributes = ServiceStatusAttributes+ { serviceStatusAttrib_serviceStatusScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ServiceStatus where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "serviceStatusScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ServiceStatus v (ServiceStatusAttributes a0)+ schemaTypeToXML s (ServiceStatus bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "serviceStatusScheme") $ serviceStatusAttrib_serviceStatusScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ServiceStatus Scheme where+ supertype (ServiceStatus s _) = s+ +-- | A type that can be used to describe the processing phase of +-- a service. For example, EndOfDay, Intraday.+data ServiceProcessingCycle = ServiceProcessingCycle Scheme ServiceProcessingCycleAttributes deriving (Eq,Show)+data ServiceProcessingCycleAttributes = ServiceProcessingCycleAttributes+ { serviceProcesCycleAttrib_serviceProcessingCycleScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ServiceProcessingCycle where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "serviceProcessingCycleScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ServiceProcessingCycle v (ServiceProcessingCycleAttributes a0)+ schemaTypeToXML s (ServiceProcessingCycle bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "serviceProcessingCycleScheme") $ serviceProcesCycleAttrib_serviceProcessingCycleScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ServiceProcessingCycle Scheme where+ supertype (ServiceProcessingCycle s _) = s+ +-- | A type that can be used to describe what stage of +-- processing a service is in. For example, Netting or +-- Valuation.+data ServiceProcessingStep = ServiceProcessingStep Scheme ServiceProcessingStepAttributes deriving (Eq,Show)+data ServiceProcessingStepAttributes = ServiceProcessingStepAttributes+ { serviceProcesStepAttrib_serviceProcessingStep :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ServiceProcessingStep where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "serviceProcessingStep" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ServiceProcessingStep v (ServiceProcessingStepAttributes a0)+ schemaTypeToXML s (ServiceProcessingStep bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "serviceProcessingStep") $ serviceProcesStepAttrib_serviceProcessingStep at+ ]+ $ schemaTypeToXML s bt+instance Extension ServiceProcessingStep Scheme where+ supertype (ServiceProcessingStep s _) = s+ +-- | A type that can be used to describe a stage or step in +-- processing provided by a service, for example processing +-- completed.+data ServiceProcessingEvent = ServiceProcessingEvent Scheme ServiceProcessingEventAttributes deriving (Eq,Show)+data ServiceProcessingEventAttributes = ServiceProcessingEventAttributes+ { serviceProcesEventAttrib_serviceProcessingEventScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ServiceProcessingEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "serviceProcessingEventScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ServiceProcessingEvent v (ServiceProcessingEventAttributes a0)+ schemaTypeToXML s (ServiceProcessingEvent bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "serviceProcessingEventScheme") $ serviceProcesEventAttrib_serviceProcessingEventScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ServiceProcessingEvent Scheme where+ supertype (ServiceProcessingEvent s _) = s+ +-- | A type defining the content model for a human-readable +-- notification to the users of a service.+data ServiceAdvisory = ServiceAdvisory+ { serviceAdvis_category :: Maybe ServiceAdvisoryCategory+ -- ^ The category or type of the notification message, e.g. + -- availability, product coverage, rules, etc.+ , serviceAdvis_description :: Maybe Xsd.XsdString+ -- ^ A human-readable notification.+ , serviceAdvis_effectiveFrom :: Maybe Xsd.DateTime+ -- ^ The time at which the information supplied by the advisory + -- becomes effective. For example, if the advisory advises of + -- a newly planned service outage, it will be the time the + -- service outage begins.+ , serviceAdvis_effectiveTo :: Maybe Xsd.DateTime+ -- ^ The time at which the information supplied by the advisory + -- becomes no longer effective. For example, if the advisory + -- advises of a newly planned service outage, it will be the + -- time the service outage ends.+ }+ deriving (Eq,Show)+instance SchemaType ServiceAdvisory where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ServiceAdvisory+ `apply` optional (parseSchemaType "category")+ `apply` optional (parseSchemaType "description")+ `apply` optional (parseSchemaType "effectiveFrom")+ `apply` optional (parseSchemaType "effectiveTo")+ schemaTypeToXML s x@ServiceAdvisory{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "category") $ serviceAdvis_category x+ , maybe [] (schemaTypeToXML "description") $ serviceAdvis_description x+ , maybe [] (schemaTypeToXML "effectiveFrom") $ serviceAdvis_effectiveFrom x+ , maybe [] (schemaTypeToXML "effectiveTo") $ serviceAdvis_effectiveTo x+ ]+ +-- | A type that can be used to describe the category of an +-- advisory message, e.g.. Availability, Rules, Products, +-- etc., etc..+data ServiceAdvisoryCategory = ServiceAdvisoryCategory Scheme ServiceAdvisoryCategoryAttributes deriving (Eq,Show)+data ServiceAdvisoryCategoryAttributes = ServiceAdvisoryCategoryAttributes+ { serviceAdvisCategAttrib_serviceAdvisoryCategoryScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ServiceAdvisoryCategory where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "serviceAdvisoryCategoryScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ServiceAdvisoryCategory v (ServiceAdvisoryCategoryAttributes a0)+ schemaTypeToXML s (ServiceAdvisoryCategory bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "serviceAdvisoryCategoryScheme") $ serviceAdvisCategAttrib_serviceAdvisoryCategoryScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ServiceAdvisoryCategory Scheme where+ supertype (ServiceAdvisoryCategory s _) = s+ +data VerificationStatusNotification = VerificationStatusNotification+ { verifStatusNotif_fpmlVersion :: Xsd.XsdString+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , verifStatusNotif_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , verifStatusNotif_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , verifStatusNotif_header :: Maybe RequestMessageHeader+ , verifStatusNotif_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , verifStatusNotif_parentCorrelationId :: Maybe CorrelationId+ -- ^ An optional identifier used to correlate between related + -- processes+ , verifStatusNotif_correlationId :: [CorrelationId]+ -- ^ A qualified identifier used to correlate between messages+ , verifStatusNotif_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric value that can be used to order messages with the + -- same correlation identifier from the same sender.+ , verifStatusNotif_onBehalfOf :: [OnBehalfOf]+ -- ^ Indicates which party (or parties) (and accounts) a trade + -- or event is being processed for. Normally there will only + -- be a maximum of 2 parties, but in the case of a novation + -- there could be a transferor, transferee, remaining party, + -- and other remaining party. Except for this case, there + -- should be no more than two onABehalfOf references in a + -- message.+ , verifStatusNotif_status :: VerificationStatus+ , verifStatusNotif_reason :: [Reason]+ -- ^ The reason for any dispute or change in verification + -- status.+ , verifStatusNotif_partyTradeIdentifier :: PartyTradeIdentifier+ , verifStatusNotif_party :: [Party]+ , verifStatusNotif_account :: [Account]+ -- ^ Optional account information used to precisely define the + -- origination and destination of financial instruments.+ }+ deriving (Eq,Show)+instance SchemaType VerificationStatusNotification 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 (VerificationStatusNotification 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` parseSchemaType "status"+ `apply` many (parseSchemaType "reason")+ `apply` parseSchemaType "partyTradeIdentifier"+ `apply` many (parseSchemaType "party")+ `apply` many (parseSchemaType "account")+ schemaTypeToXML s x@VerificationStatusNotification{} =+ toXMLElement s [ toXMLAttribute "fpmlVersion" $ verifStatusNotif_fpmlVersion x+ , maybe [] (toXMLAttribute "expectedBuild") $ verifStatusNotif_expectedBuild x+ , maybe [] (toXMLAttribute "actualBuild") $ verifStatusNotif_actualBuild x+ ]+ [ maybe [] (schemaTypeToXML "header") $ verifStatusNotif_header x+ , concatMap (schemaTypeToXML "validation") $ verifStatusNotif_validation x+ , maybe [] (schemaTypeToXML "parentCorrelationId") $ verifStatusNotif_parentCorrelationId x+ , concatMap (schemaTypeToXML "correlationId") $ verifStatusNotif_correlationId x+ , maybe [] (schemaTypeToXML "sequenceNumber") $ verifStatusNotif_sequenceNumber x+ , concatMap (schemaTypeToXML "onBehalfOf") $ verifStatusNotif_onBehalfOf x+ , schemaTypeToXML "status" $ verifStatusNotif_status x+ , concatMap (schemaTypeToXML "reason") $ verifStatusNotif_reason x+ , schemaTypeToXML "partyTradeIdentifier" $ verifStatusNotif_partyTradeIdentifier x+ , concatMap (schemaTypeToXML "party") $ verifStatusNotif_party x+ , concatMap (schemaTypeToXML "account") $ verifStatusNotif_account x+ ]+instance Extension VerificationStatusNotification NonCorrectableRequestMessage where+ supertype v = NonCorrectableRequestMessage_VerificationStatusNotification v+instance Extension VerificationStatusNotification RequestMessage where+ supertype = (supertype :: NonCorrectableRequestMessage -> RequestMessage)+ . (supertype :: VerificationStatusNotification -> NonCorrectableRequestMessage)+ +instance Extension VerificationStatusNotification Message where+ supertype = (supertype :: RequestMessage -> Message)+ . (supertype :: NonCorrectableRequestMessage -> RequestMessage)+ . (supertype :: VerificationStatusNotification -> NonCorrectableRequestMessage)+ +instance Extension VerificationStatusNotification Document where+ supertype = (supertype :: Message -> Document)+ . (supertype :: RequestMessage -> Message)+ . (supertype :: NonCorrectableRequestMessage -> RequestMessage)+ . (supertype :: VerificationStatusNotification -> NonCorrectableRequestMessage)+ + +-- | The verification status of the position as reported by the +-- sender (Verified, Disputed).+data VerificationStatus = VerificationStatus Scheme VerificationStatusAttributes deriving (Eq,Show)+data VerificationStatusAttributes = VerificationStatusAttributes+ { verifStatusAttrib_verificationStatusScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType VerificationStatus where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "verificationStatusScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ VerificationStatus v (VerificationStatusAttributes a0)+ schemaTypeToXML s (VerificationStatus bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "verificationStatusScheme") $ verifStatusAttrib_verificationStatusScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension VerificationStatus Scheme where+ supertype (VerificationStatus s _) = s+ +elementEventStatusResponse :: XMLParser EventStatusResponse+elementEventStatusResponse = parseSchemaType "eventStatusResponse"+elementToXMLEventStatusResponse :: EventStatusResponse -> [Content ()]+elementToXMLEventStatusResponse = schemaTypeToXML "eventStatusResponse"+ +elementEventStatusException :: XMLParser Exception+elementEventStatusException = parseSchemaType "eventStatusException"+elementToXMLEventStatusException :: Exception -> [Content ()]+elementToXMLEventStatusException = schemaTypeToXML "eventStatusException"+ +-- | The root element used for rejected message exceptions+elementMessageRejected :: XMLParser Exception+elementMessageRejected = parseSchemaType "messageRejected"+elementToXMLMessageRejected :: Exception -> [Content ()]+elementToXMLMessageRejected = schemaTypeToXML "messageRejected"+ +elementServiceNotification :: XMLParser ServiceNotification+elementServiceNotification = parseSchemaType "serviceNotification"+elementToXMLServiceNotification :: ServiceNotification -> [Content ()]+elementToXMLServiceNotification = schemaTypeToXML "serviceNotification"+ +elementServiceNotificationException :: XMLParser Exception+elementServiceNotificationException = parseSchemaType "serviceNotificationException"+elementToXMLServiceNotificationException :: Exception -> [Content ()]+elementToXMLServiceNotificationException = schemaTypeToXML "serviceNotificationException"+ +elementVerificationStatusNotification :: XMLParser VerificationStatusNotification+elementVerificationStatusNotification = parseSchemaType "verificationStatusNotification"+elementToXMLVerificationStatusNotification :: VerificationStatusNotification -> [Content ()]+elementToXMLVerificationStatusNotification = schemaTypeToXML "verificationStatusNotification"+ +elementVerificationStatusException :: XMLParser Exception+elementVerificationStatusException = parseSchemaType "verificationStatusException"+elementToXMLVerificationStatusException :: Exception -> [Content ()]+elementToXMLVerificationStatusException = schemaTypeToXML "verificationStatusException"+ +elementVerificationStatusAcknowledgement :: XMLParser Acknowledgement+elementVerificationStatusAcknowledgement = parseSchemaType "verificationStatusAcknowledgement"+elementToXMLVerificationStatusAcknowledgement :: Acknowledgement -> [Content ()]+elementToXMLVerificationStatusAcknowledgement = schemaTypeToXML "verificationStatusAcknowledgement"
+ Data/FpML/V53/Msg.hs-boot view
@@ -0,0 +1,491 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Msg+ ( module Data.FpML.V53.Msg+ , module Data.FpML.V53.Doc+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Doc+ +data Acknowledgement+instance Eq Acknowledgement+instance Show Acknowledgement+instance SchemaType Acknowledgement+instance Extension Acknowledgement ResponseMessage+instance Extension Acknowledgement Message+instance Extension Acknowledgement Document+ +-- | Provides extra information not represented in the model +-- that may be useful in processing the message i.e. +-- diagnosing the reason for failure. +data AdditionalData+instance Eq AdditionalData+instance Show AdditionalData+instance SchemaType AdditionalData+ +-- | A type defining the content model for a request message +-- that can be subsequently corrected or retracted. +data CorrectableRequestMessage+instance Eq CorrectableRequestMessage+instance Show CorrectableRequestMessage+instance SchemaType CorrectableRequestMessage+instance Extension CorrectableRequestMessage RequestMessage+instance Extension CorrectableRequestMessage Message+instance Extension CorrectableRequestMessage Document+ +-- | A type defining a correlation identifier and qualifying +-- scheme +data CorrelationId+data CorrelationIdAttributes+instance Eq CorrelationId+instance Eq CorrelationIdAttributes+instance Show CorrelationId+instance Show CorrelationIdAttributes+instance SchemaType CorrelationId+instance Extension CorrelationId Xsd.NormalizedString+ +-- | Identification of a business event, for example through its +-- correlation id or a business identifier. +data EventIdentifier+instance Eq EventIdentifier+instance Show EventIdentifier+instance SchemaType EventIdentifier+ +-- | A coding scheme used to describe the matching/confirmation +-- status of a trade, post-trade event, position, or cash +-- flows. +data EventStatus+data EventStatusAttributes+instance Eq EventStatus+instance Eq EventStatusAttributes+instance Show EventStatus+instance Show EventStatusAttributes+instance SchemaType EventStatus+instance Extension EventStatus Scheme+ +-- | A type used in event status enquiry messages which relates +-- an event identifier to its current status value. +data EventStatusItem+instance Eq EventStatusItem+instance Show EventStatusItem+instance SchemaType EventStatusItem+ +-- | A type defining the content model for a message normally +-- generated in response to a requestEventStatus request. +data EventStatusResponse+instance Eq EventStatusResponse+instance Show EventStatusResponse+instance SchemaType EventStatusResponse+instance Extension EventStatusResponse ResponseMessage+instance Extension EventStatusResponse Message+instance Extension EventStatusResponse Document+ +-- | A type defining the basic content for a message sent to +-- inform another system that some exception has been +-- detected. +data Exception+instance Eq Exception+instance Show Exception+instance SchemaType Exception+instance Extension Exception Message+instance Extension Exception Document+ +-- | A type defining the content model for an exception message +-- header. +data ExceptionMessageHeader+instance Eq ExceptionMessageHeader+instance Show ExceptionMessageHeader+instance SchemaType ExceptionMessageHeader+instance Extension ExceptionMessageHeader MessageHeader+ +-- | A type defining the basic structure of all FpML messages +-- which is refined by its derived types. +data Message+instance Eq Message+instance Show Message+instance SchemaType Message+instance Extension Message Document+ +-- | A type holding a structure that is unvalidated +data UnprocessedElementWrapper+instance Eq UnprocessedElementWrapper+instance Show UnprocessedElementWrapper+instance SchemaType UnprocessedElementWrapper+ +-- | The data type used for identifying a message address. +data MessageAddress+data MessageAddressAttributes+instance Eq MessageAddress+instance Eq MessageAddressAttributes+instance Show MessageAddress+instance Show MessageAddressAttributes+instance SchemaType MessageAddress+instance Extension MessageAddress Scheme+ +-- | A type defining the content model for a generic message +-- header that is refined by its derived classes. +data MessageHeader+instance Eq MessageHeader+instance Show MessageHeader+instance SchemaType MessageHeader+ +-- | The data type use for message identifiers. +data MessageId+data MessageIdAttributes+instance Eq MessageId+instance Eq MessageIdAttributes+instance Show MessageId+instance Show MessageIdAttributes+instance SchemaType MessageId+instance Extension MessageId Scheme+ +-- | A type defining the content model for a request message +-- that cannot be subsequently corrected or retracted. +data NonCorrectableRequestMessage+instance Eq NonCorrectableRequestMessage+instance Show NonCorrectableRequestMessage+instance SchemaType NonCorrectableRequestMessage+instance Extension NonCorrectableRequestMessage RequestMessage+instance Extension NonCorrectableRequestMessage Message+instance Extension NonCorrectableRequestMessage Document+ +-- | A type defining the basic content for a message sent to +-- inform another system that some 'business event' has +-- occured. Notifications are not expected to be replied to. +data NotificationMessage+instance Eq NotificationMessage+instance Show NotificationMessage+instance SchemaType NotificationMessage+instance Extension NotificationMessage Message+ +-- | A type that refines the generic message header to match the +-- requirements of a NotificationMessage. +data NotificationMessageHeader+instance Eq NotificationMessageHeader+instance Show NotificationMessageHeader+instance SchemaType NotificationMessageHeader+instance Extension NotificationMessageHeader MessageHeader+ +-- | A version of a specification document used by the message +-- generator to format the document. +data ImplementationSpecification+instance Eq ImplementationSpecification+instance Show ImplementationSpecification+instance SchemaType ImplementationSpecification+ +data ImplementationSpecificationVersion+data ImplementationSpecificationVersionAttributes+instance Eq ImplementationSpecificationVersion+instance Eq ImplementationSpecificationVersionAttributes+instance Show ImplementationSpecificationVersion+instance Show ImplementationSpecificationVersionAttributes+instance SchemaType ImplementationSpecificationVersion+instance Extension ImplementationSpecificationVersion Scheme+ +-- | A type defining additional information that may be recorded +-- against a message. +data PartyMessageInformation+instance Eq PartyMessageInformation+instance Show PartyMessageInformation+instance SchemaType PartyMessageInformation+ +-- | A structure used to group together individual messages that +-- can be acted on at a group level. +data PortfolioReference+instance Eq PortfolioReference+instance Show PortfolioReference+instance SchemaType PortfolioReference+instance Extension PortfolioReference PortfolioReferenceBase+ +-- | A structure used to group together individual messages that +-- can be acted on at a group level. +data PortfolioConstituentReference+instance Eq PortfolioConstituentReference+instance Show PortfolioConstituentReference+instance SchemaType PortfolioConstituentReference+instance Extension PortfolioConstituentReference PortfolioReferenceBase+ +-- | A structure used to identify a portfolio in a message. +data PortfolioReferenceBase+instance Eq PortfolioReferenceBase+instance Show PortfolioReferenceBase+instance SchemaType PortfolioReferenceBase+ + + + + +-- | Provides a lexical location (i.e. a line number and +-- character for bad XML) or an XPath location (i.e. place to +-- identify the bad location for valid XML). +data ProblemLocation+data ProblemLocationAttributes+instance Eq ProblemLocation+instance Eq ProblemLocationAttributes+instance Show ProblemLocation+instance Show ProblemLocationAttributes+instance SchemaType ProblemLocation+instance Extension ProblemLocation Xsd.NormalizedString+ +-- | A type defining a content model for describing the nature +-- and possible location of a error within a previous message. +data Reason+instance Eq Reason+instance Show Reason+instance SchemaType Reason+ +-- | Defines a list of machine interpretable error codes. +data ReasonCode+data ReasonCodeAttributes+instance Eq ReasonCode+instance Eq ReasonCodeAttributes+instance Show ReasonCode+instance Show ReasonCodeAttributes+instance SchemaType ReasonCode+instance Extension ReasonCode Scheme+ +-- | A type that allows the specific report and section to be +-- identified. +data ReportIdentification+instance Eq ReportIdentification+instance Show ReportIdentification+instance SchemaType ReportIdentification+instance Extension ReportIdentification ReportSectionIdentification+ +-- | A type that allows the specific report and section to be +-- identified. +data ReportSectionIdentification+instance Eq ReportSectionIdentification+instance Show ReportSectionIdentification+instance SchemaType ReportSectionIdentification+ +-- | A type that can be used to hold an identifier for a report +-- instance. +data ReportId+data ReportIdAttributes+instance Eq ReportId+instance Eq ReportIdAttributes+instance Show ReportId+instance Show ReportIdAttributes+instance SchemaType ReportId+instance Extension ReportId Scheme+ +-- | A type defining the content model for a message allowing +-- one party to query the status of one event (trade or +-- post-trade event) previously sent to another party. +data RequestEventStatus+instance Eq RequestEventStatus+instance Show RequestEventStatus+instance SchemaType RequestEventStatus+instance Extension RequestEventStatus NonCorrectableRequestMessage+instance Extension RequestEventStatus RequestMessage+instance Extension RequestEventStatus Message+instance Extension RequestEventStatus Document+ +-- | A type that can be used to identify the type of business +-- process in a request. Examples include Allocation, +-- Clearing, Confirmation, etc. +data BusinessProcess+data BusinessProcessAttributes+instance Eq BusinessProcess+instance Eq BusinessProcessAttributes+instance Show BusinessProcess+instance Show BusinessProcessAttributes+instance SchemaType BusinessProcess+instance Extension BusinessProcess Scheme+ +-- | A type defining the basic content of a message that +-- requests the receiver to perform some business operation +-- determined by the message type and its content. +data RequestMessage+instance Eq RequestMessage+instance Show RequestMessage+instance SchemaType RequestMessage+instance Extension RequestMessage Message+ +-- | A type refining the generic message header content to make +-- it specific to request messages. +data RequestMessageHeader+instance Eq RequestMessageHeader+instance Show RequestMessageHeader+instance SchemaType RequestMessageHeader+instance Extension RequestMessageHeader MessageHeader+ +-- | A message to request that a message be retransmitted. The +-- original message will typically be a component of a group +-- of messages, such as a portfolio or a report in multiple +-- parts. +data RequestRetransmission+instance Eq RequestRetransmission+instance Show RequestRetransmission+instance SchemaType RequestRetransmission+instance Extension RequestRetransmission NonCorrectableRequestMessage+instance Extension RequestRetransmission RequestMessage+instance Extension RequestRetransmission Message+instance Extension RequestRetransmission Document+ +-- | A type refining the generic message content model to make +-- it specific to response messages. +data ResponseMessage+instance Eq ResponseMessage+instance Show ResponseMessage+instance SchemaType ResponseMessage+instance Extension ResponseMessage Message+ +-- | A type refining the generic message header to make it +-- specific to response messages. +data ResponseMessageHeader+instance Eq ResponseMessageHeader+instance Show ResponseMessageHeader+instance SchemaType ResponseMessageHeader+instance Extension ResponseMessageHeader MessageHeader+ + + + + + + + + +-- | Event Status messages. + +elementRequestEventStatus :: XMLParser RequestEventStatus+elementToXMLRequestEventStatus :: RequestEventStatus -> [Content ()]+ +elementRequestRetransmission :: XMLParser RequestRetransmission+elementToXMLRequestRetransmission :: RequestRetransmission -> [Content ()]+ +-- | A type defining the content model for a message that allows +-- a service to send a notification message to a user of the +-- service. +data ServiceNotification+instance Eq ServiceNotification+instance Show ServiceNotification+instance SchemaType ServiceNotification+instance Extension ServiceNotification NotificationMessage+instance Extension ServiceNotification Message+instance Extension ServiceNotification Document+ +-- | A type defining the content model for report on the status +-- of the processing by a service. In the future we may wish +-- to provide some kind of scope or other qualification for +-- the event, e.g. the currencies, products, or books to which +-- it applies. +data ServiceProcessingStatus+instance Eq ServiceProcessingStatus+instance Show ServiceProcessingStatus+instance SchemaType ServiceProcessingStatus+ +-- | A type that can be used to describe the availability or +-- other state of a service, e.g. Available, Unavaialble. +data ServiceStatus+data ServiceStatusAttributes+instance Eq ServiceStatus+instance Eq ServiceStatusAttributes+instance Show ServiceStatus+instance Show ServiceStatusAttributes+instance SchemaType ServiceStatus+instance Extension ServiceStatus Scheme+ +-- | A type that can be used to describe the processing phase of +-- a service. For example, EndOfDay, Intraday. +data ServiceProcessingCycle+data ServiceProcessingCycleAttributes+instance Eq ServiceProcessingCycle+instance Eq ServiceProcessingCycleAttributes+instance Show ServiceProcessingCycle+instance Show ServiceProcessingCycleAttributes+instance SchemaType ServiceProcessingCycle+instance Extension ServiceProcessingCycle Scheme+ +-- | A type that can be used to describe what stage of +-- processing a service is in. For example, Netting or +-- Valuation. +data ServiceProcessingStep+data ServiceProcessingStepAttributes+instance Eq ServiceProcessingStep+instance Eq ServiceProcessingStepAttributes+instance Show ServiceProcessingStep+instance Show ServiceProcessingStepAttributes+instance SchemaType ServiceProcessingStep+instance Extension ServiceProcessingStep Scheme+ +-- | A type that can be used to describe a stage or step in +-- processing provided by a service, for example processing +-- completed. +data ServiceProcessingEvent+data ServiceProcessingEventAttributes+instance Eq ServiceProcessingEvent+instance Eq ServiceProcessingEventAttributes+instance Show ServiceProcessingEvent+instance Show ServiceProcessingEventAttributes+instance SchemaType ServiceProcessingEvent+instance Extension ServiceProcessingEvent Scheme+ +-- | A type defining the content model for a human-readable +-- notification to the users of a service. +data ServiceAdvisory+instance Eq ServiceAdvisory+instance Show ServiceAdvisory+instance SchemaType ServiceAdvisory+ +-- | A type that can be used to describe the category of an +-- advisory message, e.g.. Availability, Rules, Products, +-- etc., etc.. +data ServiceAdvisoryCategory+data ServiceAdvisoryCategoryAttributes+instance Eq ServiceAdvisoryCategory+instance Eq ServiceAdvisoryCategoryAttributes+instance Show ServiceAdvisoryCategory+instance Show ServiceAdvisoryCategoryAttributes+instance SchemaType ServiceAdvisoryCategory+instance Extension ServiceAdvisoryCategory Scheme+ +data VerificationStatusNotification+instance Eq VerificationStatusNotification+instance Show VerificationStatusNotification+instance SchemaType VerificationStatusNotification+instance Extension VerificationStatusNotification NonCorrectableRequestMessage+instance Extension VerificationStatusNotification RequestMessage+instance Extension VerificationStatusNotification Message+instance Extension VerificationStatusNotification Document+ +-- | The verification status of the position as reported by the +-- sender (Verified, Disputed). +data VerificationStatus+data VerificationStatusAttributes+instance Eq VerificationStatus+instance Eq VerificationStatusAttributes+instance Show VerificationStatus+instance Show VerificationStatusAttributes+instance SchemaType VerificationStatus+instance Extension VerificationStatus Scheme+ +elementEventStatusResponse :: XMLParser EventStatusResponse+elementToXMLEventStatusResponse :: EventStatusResponse -> [Content ()]+ +elementEventStatusException :: XMLParser Exception+elementToXMLEventStatusException :: Exception -> [Content ()]+ +-- | The root element used for rejected message exceptions +elementMessageRejected :: XMLParser Exception+elementToXMLMessageRejected :: Exception -> [Content ()]+ +elementServiceNotification :: XMLParser ServiceNotification+elementToXMLServiceNotification :: ServiceNotification -> [Content ()]+ +elementServiceNotificationException :: XMLParser Exception+elementToXMLServiceNotificationException :: Exception -> [Content ()]+ +elementVerificationStatusNotification :: XMLParser VerificationStatusNotification+elementToXMLVerificationStatusNotification :: VerificationStatusNotification -> [Content ()]+ +elementVerificationStatusException :: XMLParser Exception+elementToXMLVerificationStatusException :: Exception -> [Content ()]+ +elementVerificationStatusAcknowledgement :: XMLParser Acknowledgement+elementToXMLVerificationStatusAcknowledgement :: Acknowledgement -> [Content ()]
+ Data/FpML/V53/Notification/CreditEvent.hs view
@@ -0,0 +1,356 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Notification.CreditEvent+ ( module Data.FpML.V53.Notification.CreditEvent+ , module Data.FpML.V53.Msg+ ) 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.Msg+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +data AffectedTransactions = AffectedTransactions+ { affectTrans_choice0 :: (Maybe (OneOf2 Trade PartyTradeIdentifiers))+ -- ^ Choice between:+ -- + -- (1) An element that allows the full details of the trade to + -- be used as a mechanism for identifying the trade for + -- which the post-trade event pertains+ -- + -- (2) A container since an individual trade can be referenced + -- by two or more different partyTradeIdentifier elements + -- - each allocated by a different party.+ }+ deriving (Eq,Show)+instance SchemaType AffectedTransactions where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return AffectedTransactions+ `apply` optional (oneOf' [ ("Trade", fmap OneOf2 (parseSchemaType "trade"))+ , ("PartyTradeIdentifiers", fmap TwoOf2 (parseSchemaType "tradeReference"))+ ])+ schemaTypeToXML s x@AffectedTransactions{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "trade")+ (schemaTypeToXML "tradeReference")+ ) $ affectTrans_choice0 x+ ]+ +data BankruptcyEvent = BankruptcyEvent+ deriving (Eq,Show)+instance SchemaType BankruptcyEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return BankruptcyEvent+ schemaTypeToXML s x@BankruptcyEvent{} =+ toXMLElement s []+ []+instance Extension BankruptcyEvent CreditEvent where+ supertype (BankruptcyEvent) =+ CreditEvent+ +data CreditEvent = CreditEvent+ deriving (Eq,Show)+instance SchemaType CreditEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CreditEvent+ schemaTypeToXML s x@CreditEvent{} =+ toXMLElement s []+ []+ +-- | An event type that records the occurrence of a credit event +-- notice.+data CreditEventNoticeDocument = CreditEventNoticeDocument+ { creditEventNoticeDocum_affectedTransactions :: Maybe AffectedTransactions+ -- ^ Trades affected by this event.+ , creditEventNoticeDocum_referenceEntity :: Maybe LegalEntity+ , creditEventNoticeDocum_creditEvent :: Maybe CreditEvent+ , creditEventNoticeDocum_publiclyAvailableInformation :: [Resource]+ -- ^ A public information source, e.g. a particular newspaper or + -- electronic news service, that may publish relevant + -- information used in the determination of whether or not a + -- credit event has occurred.+ , creditEventNoticeDocum_notifyingPartyReference :: Maybe PartyReference+ , creditEventNoticeDocum_notifiedPartyReference :: Maybe PartyReference+ , creditEventNoticeDocum_creditEventNoticeDate :: Maybe Xsd.Date+ , creditEventNoticeDocum_creditEventDate :: Maybe Xsd.Date+ }+ deriving (Eq,Show)+instance SchemaType CreditEventNoticeDocument where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CreditEventNoticeDocument+ `apply` optional (parseSchemaType "affectedTransactions")+ `apply` optional (parseSchemaType "referenceEntity")+ `apply` optional (elementCreditEvent)+ `apply` many (parseSchemaType "publiclyAvailableInformation")+ `apply` optional (parseSchemaType "notifyingPartyReference")+ `apply` optional (parseSchemaType "notifiedPartyReference")+ `apply` optional (parseSchemaType "creditEventNoticeDate")+ `apply` optional (parseSchemaType "creditEventDate")+ schemaTypeToXML s x@CreditEventNoticeDocument{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "affectedTransactions") $ creditEventNoticeDocum_affectedTransactions x+ , maybe [] (schemaTypeToXML "referenceEntity") $ creditEventNoticeDocum_referenceEntity x+ , maybe [] (elementToXMLCreditEvent) $ creditEventNoticeDocum_creditEvent x+ , concatMap (schemaTypeToXML "publiclyAvailableInformation") $ creditEventNoticeDocum_publiclyAvailableInformation x+ , maybe [] (schemaTypeToXML "notifyingPartyReference") $ creditEventNoticeDocum_notifyingPartyReference x+ , maybe [] (schemaTypeToXML "notifiedPartyReference") $ creditEventNoticeDocum_notifiedPartyReference x+ , maybe [] (schemaTypeToXML "creditEventNoticeDate") $ creditEventNoticeDocum_creditEventNoticeDate x+ , maybe [] (schemaTypeToXML "creditEventDate") $ creditEventNoticeDocum_creditEventDate x+ ]+ +-- | A message type defining the ISDA defined Credit Event +-- Notice. ISDA defines it as an irrevocable notice from a +-- Notifying Party to the other party that describes a Credit +-- Event that occurred. A Credit Event Notice must contain +-- detail of the facts relevant to the determination that a +-- Credit Event has occurred.+data CreditEventNotification = CreditEventNotification+ { creditEventNotif_fpmlVersion :: Xsd.XsdString+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , creditEventNotif_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , creditEventNotif_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , creditEventNotif_header :: Maybe RequestMessageHeader+ , creditEventNotif_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , creditEventNotif_isCorrection :: Maybe Xsd.Boolean+ -- ^ Indicates if this message corrects an earlier request.+ , creditEventNotif_parentCorrelationId :: Maybe CorrelationId+ -- ^ An optional identifier used to correlate between related + -- processes+ , creditEventNotif_correlationId :: [CorrelationId]+ -- ^ A qualified identifier used to correlate between messages+ , creditEventNotif_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric value that can be used to order messages with the + -- same correlation identifier from the same sender.+ , creditEventNotif_onBehalfOf :: [OnBehalfOf]+ -- ^ Indicates which party (or parties) (and accounts) a trade + -- or event is being processed for. Normally there will only + -- be a maximum of 2 parties, but in the case of a novation + -- there could be a transferor, transferee, remaining party, + -- and other remaining party. Except for this case, there + -- should be no more than two onABehalfOf references in a + -- message.+ , creditEventNotif_creditEventNotice :: Maybe CreditEventNoticeDocument+ , creditEventNotif_party :: [Party]+ }+ deriving (Eq,Show)+instance SchemaType CreditEventNotification 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 (CreditEventNotification 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 "creditEventNotice")+ `apply` many (parseSchemaType "party")+ schemaTypeToXML s x@CreditEventNotification{} =+ toXMLElement s [ toXMLAttribute "fpmlVersion" $ creditEventNotif_fpmlVersion x+ , maybe [] (toXMLAttribute "expectedBuild") $ creditEventNotif_expectedBuild x+ , maybe [] (toXMLAttribute "actualBuild") $ creditEventNotif_actualBuild x+ ]+ [ maybe [] (schemaTypeToXML "header") $ creditEventNotif_header x+ , concatMap (schemaTypeToXML "validation") $ creditEventNotif_validation x+ , maybe [] (schemaTypeToXML "isCorrection") $ creditEventNotif_isCorrection x+ , maybe [] (schemaTypeToXML "parentCorrelationId") $ creditEventNotif_parentCorrelationId x+ , concatMap (schemaTypeToXML "correlationId") $ creditEventNotif_correlationId x+ , maybe [] (schemaTypeToXML "sequenceNumber") $ creditEventNotif_sequenceNumber x+ , concatMap (schemaTypeToXML "onBehalfOf") $ creditEventNotif_onBehalfOf x+ , maybe [] (schemaTypeToXML "creditEventNotice") $ creditEventNotif_creditEventNotice x+ , concatMap (schemaTypeToXML "party") $ creditEventNotif_party x+ ]+instance Extension CreditEventNotification CorrectableRequestMessage where+ supertype v = CorrectableRequestMessage_CreditEventNotification v+instance Extension CreditEventNotification RequestMessage where+ supertype = (supertype :: CorrectableRequestMessage -> RequestMessage)+ . (supertype :: CreditEventNotification -> CorrectableRequestMessage)+ +instance Extension CreditEventNotification Message where+ supertype = (supertype :: RequestMessage -> Message)+ . (supertype :: CorrectableRequestMessage -> RequestMessage)+ . (supertype :: CreditEventNotification -> CorrectableRequestMessage)+ +instance Extension CreditEventNotification Document where+ supertype = (supertype :: Message -> Document)+ . (supertype :: RequestMessage -> Message)+ . (supertype :: CorrectableRequestMessage -> RequestMessage)+ . (supertype :: CreditEventNotification -> CorrectableRequestMessage)+ + +data FailureToPayEvent = FailureToPayEvent+ deriving (Eq,Show)+instance SchemaType FailureToPayEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FailureToPayEvent+ schemaTypeToXML s x@FailureToPayEvent{} =+ toXMLElement s []+ []+instance Extension FailureToPayEvent CreditEvent where+ supertype (FailureToPayEvent) =+ CreditEvent+ +data ObligationAccelerationEvent = ObligationAccelerationEvent+ deriving (Eq,Show)+instance SchemaType ObligationAccelerationEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ObligationAccelerationEvent+ schemaTypeToXML s x@ObligationAccelerationEvent{} =+ toXMLElement s []+ []+instance Extension ObligationAccelerationEvent CreditEvent where+ supertype (ObligationAccelerationEvent) =+ CreditEvent+ +data ObligationDefaultEvent = ObligationDefaultEvent+ deriving (Eq,Show)+instance SchemaType ObligationDefaultEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ObligationDefaultEvent+ schemaTypeToXML s x@ObligationDefaultEvent{} =+ toXMLElement s []+ []+instance Extension ObligationDefaultEvent CreditEvent where+ supertype (ObligationDefaultEvent) =+ CreditEvent+ +data RepudiationMoratoriumEvent = RepudiationMoratoriumEvent+ deriving (Eq,Show)+instance SchemaType RepudiationMoratoriumEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return RepudiationMoratoriumEvent+ schemaTypeToXML s x@RepudiationMoratoriumEvent{} =+ toXMLElement s []+ []+instance Extension RepudiationMoratoriumEvent CreditEvent where+ supertype (RepudiationMoratoriumEvent) =+ CreditEvent+ +data RestructuringEvent = RestructuringEvent+ { restrEvent_partialExerciseAmount :: Maybe Money+ }+ deriving (Eq,Show)+instance SchemaType RestructuringEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return RestructuringEvent+ `apply` optional (parseSchemaType "partialExerciseAmount")+ schemaTypeToXML s x@RestructuringEvent{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "partialExerciseAmount") $ restrEvent_partialExerciseAmount x+ ]+instance Extension RestructuringEvent CreditEvent where+ supertype (RestructuringEvent e0) =+ CreditEvent+ +elementBankruptcy :: XMLParser BankruptcyEvent+elementBankruptcy = parseSchemaType "bankruptcy"+elementToXMLBankruptcy :: BankruptcyEvent -> [Content ()]+elementToXMLBankruptcy = schemaTypeToXML "bankruptcy"+ +elementCreditEvent :: XMLParser CreditEvent+elementCreditEvent = fmap supertype elementRestructuring+ `onFail`+ fmap supertype elementRepudiationMoratorium+ `onFail`+ fmap supertype elementObligationDefault+ `onFail`+ fmap supertype elementObligationAcceleration+ `onFail`+ fmap supertype elementFailureToPay+ `onFail`+ fmap supertype elementBankruptcy+ `onFail` fail "Parse failed when expecting an element in the substitution group for\n\+\ <creditEvent>,\n\+\ namely one of:\n\+\<restructuring>, <repudiationMoratorium>, <obligationDefault>, <obligationAcceleration>, <failureToPay>, <bankruptcy>"+elementToXMLCreditEvent :: CreditEvent -> [Content ()]+elementToXMLCreditEvent = schemaTypeToXML "creditEvent"+ +-- | A global element used to hold CENs.+elementCreditEventNotice :: XMLParser CreditEventNoticeDocument+elementCreditEventNotice = parseSchemaType "creditEventNotice"+elementToXMLCreditEventNotice :: CreditEventNoticeDocument -> [Content ()]+elementToXMLCreditEventNotice = schemaTypeToXML "creditEventNotice"+ +elementFailureToPay :: XMLParser FailureToPayEvent+elementFailureToPay = parseSchemaType "failureToPay"+elementToXMLFailureToPay :: FailureToPayEvent -> [Content ()]+elementToXMLFailureToPay = schemaTypeToXML "failureToPay"+ +elementObligationAcceleration :: XMLParser ObligationAccelerationEvent+elementObligationAcceleration = parseSchemaType "obligationAcceleration"+elementToXMLObligationAcceleration :: ObligationAccelerationEvent -> [Content ()]+elementToXMLObligationAcceleration = schemaTypeToXML "obligationAcceleration"+ +elementObligationDefault :: XMLParser ObligationDefaultEvent+elementObligationDefault = parseSchemaType "obligationDefault"+elementToXMLObligationDefault :: ObligationDefaultEvent -> [Content ()]+elementToXMLObligationDefault = schemaTypeToXML "obligationDefault"+ +elementRepudiationMoratorium :: XMLParser RepudiationMoratoriumEvent+elementRepudiationMoratorium = parseSchemaType "repudiationMoratorium"+elementToXMLRepudiationMoratorium :: RepudiationMoratoriumEvent -> [Content ()]+elementToXMLRepudiationMoratorium = schemaTypeToXML "repudiationMoratorium"+ +elementRestructuring :: XMLParser RestructuringEvent+elementRestructuring = parseSchemaType "restructuring"+elementToXMLRestructuring :: RestructuringEvent -> [Content ()]+elementToXMLRestructuring = schemaTypeToXML "restructuring"+ +-- | Credit Event Notification message.+ +-- | A message defining the ISDA defined Credit Event Notice. +-- ISDA defines it as an irrevocable notice from a Notifying +-- Party to the other party that describes a Credit Event that +-- occurred. A Credit Event Notice must contain detail of the +-- facts relevant to the determination that a Credit Event has +-- occurred.+elementCreditEventNotification :: XMLParser CreditEventNotification+elementCreditEventNotification = parseSchemaType "creditEventNotification"+elementToXMLCreditEventNotification :: CreditEventNotification -> [Content ()]+elementToXMLCreditEventNotification = schemaTypeToXML "creditEventNotification"+ +elementCreditEventAcknowledgement :: XMLParser Acknowledgement+elementCreditEventAcknowledgement = parseSchemaType "creditEventAcknowledgement"+elementToXMLCreditEventAcknowledgement :: Acknowledgement -> [Content ()]+elementToXMLCreditEventAcknowledgement = schemaTypeToXML "creditEventAcknowledgement"+ +elementCreditEventException :: XMLParser Exception+elementCreditEventException = parseSchemaType "creditEventException"+elementToXMLCreditEventException :: Exception -> [Content ()]+elementToXMLCreditEventException = schemaTypeToXML "creditEventException"
+ Data/FpML/V53/Notification/CreditEvent.hs-boot view
@@ -0,0 +1,120 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Notification.CreditEvent+ ( module Data.FpML.V53.Notification.CreditEvent+ , module Data.FpML.V53.Msg+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Msg+ +data AffectedTransactions+instance Eq AffectedTransactions+instance Show AffectedTransactions+instance SchemaType AffectedTransactions+ +data BankruptcyEvent+instance Eq BankruptcyEvent+instance Show BankruptcyEvent+instance SchemaType BankruptcyEvent+instance Extension BankruptcyEvent CreditEvent+ +data CreditEvent+instance Eq CreditEvent+instance Show CreditEvent+instance SchemaType CreditEvent+ +-- | An event type that records the occurrence of a credit event +-- notice. +data CreditEventNoticeDocument+instance Eq CreditEventNoticeDocument+instance Show CreditEventNoticeDocument+instance SchemaType CreditEventNoticeDocument+ +-- | A message type defining the ISDA defined Credit Event +-- Notice. ISDA defines it as an irrevocable notice from a +-- Notifying Party to the other party that describes a Credit +-- Event that occurred. A Credit Event Notice must contain +-- detail of the facts relevant to the determination that a +-- Credit Event has occurred. +data CreditEventNotification+instance Eq CreditEventNotification+instance Show CreditEventNotification+instance SchemaType CreditEventNotification+instance Extension CreditEventNotification CorrectableRequestMessage+instance Extension CreditEventNotification RequestMessage+instance Extension CreditEventNotification Message+instance Extension CreditEventNotification Document+ +data FailureToPayEvent+instance Eq FailureToPayEvent+instance Show FailureToPayEvent+instance SchemaType FailureToPayEvent+instance Extension FailureToPayEvent CreditEvent+ +data ObligationAccelerationEvent+instance Eq ObligationAccelerationEvent+instance Show ObligationAccelerationEvent+instance SchemaType ObligationAccelerationEvent+instance Extension ObligationAccelerationEvent CreditEvent+ +data ObligationDefaultEvent+instance Eq ObligationDefaultEvent+instance Show ObligationDefaultEvent+instance SchemaType ObligationDefaultEvent+instance Extension ObligationDefaultEvent CreditEvent+ +data RepudiationMoratoriumEvent+instance Eq RepudiationMoratoriumEvent+instance Show RepudiationMoratoriumEvent+instance SchemaType RepudiationMoratoriumEvent+instance Extension RepudiationMoratoriumEvent CreditEvent+ +data RestructuringEvent+instance Eq RestructuringEvent+instance Show RestructuringEvent+instance SchemaType RestructuringEvent+instance Extension RestructuringEvent CreditEvent+ +elementBankruptcy :: XMLParser BankruptcyEvent+elementToXMLBankruptcy :: BankruptcyEvent -> [Content ()]+ +elementCreditEvent :: XMLParser CreditEvent+ +-- | A global element used to hold CENs. +elementCreditEventNotice :: XMLParser CreditEventNoticeDocument+elementToXMLCreditEventNotice :: CreditEventNoticeDocument -> [Content ()]+ +elementFailureToPay :: XMLParser FailureToPayEvent+elementToXMLFailureToPay :: FailureToPayEvent -> [Content ()]+ +elementObligationAcceleration :: XMLParser ObligationAccelerationEvent+elementToXMLObligationAcceleration :: ObligationAccelerationEvent -> [Content ()]+ +elementObligationDefault :: XMLParser ObligationDefaultEvent+elementToXMLObligationDefault :: ObligationDefaultEvent -> [Content ()]+ +elementRepudiationMoratorium :: XMLParser RepudiationMoratoriumEvent+elementToXMLRepudiationMoratorium :: RepudiationMoratoriumEvent -> [Content ()]+ +elementRestructuring :: XMLParser RestructuringEvent+elementToXMLRestructuring :: RestructuringEvent -> [Content ()]+ +-- | Credit Event Notification message. + +-- | A message defining the ISDA defined Credit Event Notice. +-- ISDA defines it as an irrevocable notice from a Notifying +-- Party to the other party that describes a Credit Event that +-- occurred. A Credit Event Notice must contain detail of the +-- facts relevant to the determination that a Credit Event has +-- occurred. +elementCreditEventNotification :: XMLParser CreditEventNotification+elementToXMLCreditEventNotification :: CreditEventNotification -> [Content ()]+ +elementCreditEventAcknowledgement :: XMLParser Acknowledgement+elementToXMLCreditEventAcknowledgement :: Acknowledgement -> [Content ()]+ +elementCreditEventException :: XMLParser Exception+elementToXMLCreditEventException :: Exception -> [Content ()]
+ Data/FpML/V53/Option/Bond.hs view
@@ -0,0 +1,327 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Option.Bond+ ( module Data.FpML.V53.Option.Bond+ , module Data.FpML.V53.Shared.Option+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import Text.XML.HaXml.OneOfN+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import Data.FpML.V53.Shared.Option+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | A Bond Option+data BondOption = BondOption+ { bondOption_ID :: Maybe Xsd.ID+ , bondOption_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , bondOption_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , bondOption_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , bondOption_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , bondOption_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , bondOption_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , bondOption_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , bondOption_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , bondOption_optionType :: OptionTypeEnum+ -- ^ The type of option transaction. From a usage standpoint, + -- put/call is the default option type, while payer/receiver + -- indicator is used for options index credit default swaps, + -- consistently with the industry practice. Straddle is used + -- for the case of straddle strategy, that combine a call and + -- a put with the same strike.+ , bondOption_premium :: Premium+ -- ^ The option premium payable by the buyer to the seller.+ , bondOption_exercise :: Exercise+ -- ^ An placeholder for the actual option exercise definitions.+ , bondOption_exerciseProcedure :: Maybe ExerciseProcedure+ -- ^ A set of parameters defining procedures associated with the + -- exercise.+ , bondOption_feature :: Maybe OptionFeature+ -- ^ An Option feature such as quanto, asian, barrier, knock.+ , bondOption_choice13 :: (Maybe (OneOf2 NotionalAmountReference Money))+ -- ^ A choice between an explicit representation of the notional + -- amount, or a reference to a notional amount defined + -- elsewhere in this document.+ -- + -- Choice between:+ -- + -- (1) notionalReference+ -- + -- (2) notionalAmount+ , bondOption_optionEntitlement :: Maybe PositiveDecimal+ -- ^ The number of units of underlyer per option comprised in + -- the option transaction.+ , bondOption_entitlementCurrency :: Maybe Currency+ -- ^ TODO+ , bondOption_numberOfOptions :: Maybe PositiveDecimal+ -- ^ The number of options comprised in the option transaction.+ , bondOption_settlementType :: Maybe SettlementTypeEnum+ , bondOption_settlementDate :: Maybe AdjustableOrRelativeDate+ , bondOption_choice19 :: (Maybe (OneOf2 Money Currency))+ -- ^ Choice between:+ -- + -- (1) Settlement Amount+ -- + -- (2) Settlement Currency for use where the Settlement Amount + -- cannot be known in advance+ , bondOption_strike :: BondOptionStrike+ -- ^ Strike of the the Bond Option.+ , bondOption_choice21 :: OneOf2 Bond ConvertibleBond+ -- ^ Choice between:+ -- + -- (1) Identifies the underlying asset when it is a series or + -- a class of bonds.+ -- + -- (2) Identifies the underlying asset when it is a + -- convertible bond.+ }+ deriving (Eq,Show)+instance SchemaType BondOption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (BondOption a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` optional (parseSchemaType "buyerPartyReference")+ `apply` optional (parseSchemaType "buyerAccountReference")+ `apply` optional (parseSchemaType "sellerPartyReference")+ `apply` optional (parseSchemaType "sellerAccountReference")+ `apply` parseSchemaType "optionType"+ `apply` parseSchemaType "premium"+ `apply` elementExercise+ `apply` optional (parseSchemaType "exerciseProcedure")+ `apply` optional (parseSchemaType "feature")+ `apply` optional (oneOf' [ ("NotionalAmountReference", fmap OneOf2 (parseSchemaType "notionalReference"))+ , ("Money", fmap TwoOf2 (parseSchemaType "notionalAmount"))+ ])+ `apply` optional (parseSchemaType "optionEntitlement")+ `apply` optional (parseSchemaType "entitlementCurrency")+ `apply` optional (parseSchemaType "numberOfOptions")+ `apply` optional (parseSchemaType "settlementType")+ `apply` optional (parseSchemaType "settlementDate")+ `apply` optional (oneOf' [ ("Money", fmap OneOf2 (parseSchemaType "settlementAmount"))+ , ("Currency", fmap TwoOf2 (parseSchemaType "settlementCurrency"))+ ])+ `apply` parseSchemaType "strike"+ `apply` oneOf' [ ("Bond", fmap OneOf2 (elementBond))+ , ("ConvertibleBond", fmap TwoOf2 (elementConvertibleBond))+ ]+ schemaTypeToXML s x@BondOption{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ bondOption_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ bondOption_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ bondOption_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ bondOption_productType x+ , concatMap (schemaTypeToXML "productId") $ bondOption_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ bondOption_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ bondOption_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ bondOption_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ bondOption_sellerAccountReference x+ , schemaTypeToXML "optionType" $ bondOption_optionType x+ , schemaTypeToXML "premium" $ bondOption_premium x+ , elementToXMLExercise $ bondOption_exercise x+ , maybe [] (schemaTypeToXML "exerciseProcedure") $ bondOption_exerciseProcedure x+ , maybe [] (schemaTypeToXML "feature") $ bondOption_feature x+ , maybe [] (foldOneOf2 (schemaTypeToXML "notionalReference")+ (schemaTypeToXML "notionalAmount")+ ) $ bondOption_choice13 x+ , maybe [] (schemaTypeToXML "optionEntitlement") $ bondOption_optionEntitlement x+ , maybe [] (schemaTypeToXML "entitlementCurrency") $ bondOption_entitlementCurrency x+ , maybe [] (schemaTypeToXML "numberOfOptions") $ bondOption_numberOfOptions x+ , maybe [] (schemaTypeToXML "settlementType") $ bondOption_settlementType x+ , maybe [] (schemaTypeToXML "settlementDate") $ bondOption_settlementDate x+ , maybe [] (foldOneOf2 (schemaTypeToXML "settlementAmount")+ (schemaTypeToXML "settlementCurrency")+ ) $ bondOption_choice19 x+ , schemaTypeToXML "strike" $ bondOption_strike x+ , foldOneOf2 (elementToXMLBond)+ (elementToXMLConvertibleBond)+ $ bondOption_choice21 x+ ]+instance Extension BondOption OptionBaseExtended where+ supertype v = OptionBaseExtended_BondOption v+instance Extension BondOption OptionBase where+ supertype = (supertype :: OptionBaseExtended -> OptionBase)+ . (supertype :: BondOption -> OptionBaseExtended)+ +instance Extension BondOption Option where+ supertype = (supertype :: OptionBase -> Option)+ . (supertype :: OptionBaseExtended -> OptionBase)+ . (supertype :: BondOption -> OptionBaseExtended)+ +instance Extension BondOption Product where+ supertype = (supertype :: Option -> Product)+ . (supertype :: OptionBase -> Option)+ . (supertype :: OptionBaseExtended -> OptionBase)+ . (supertype :: BondOption -> OptionBaseExtended)+ + +-- | A complex type to specify the strike of a bond or +-- convertible bond option.+data BondOptionStrike = BondOptionStrike+ { bondOptionStrike_choice0 :: (Maybe (OneOf2 ReferenceSwapCurve OptionStrike))+ -- ^ Choice between:+ -- + -- (1) The strike of an option when expressed by reference to + -- a swap curve. (Typically the case for a convertible + -- bond option.)+ -- + -- (2) price+ }+ deriving (Eq,Show)+instance SchemaType BondOptionStrike where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return BondOptionStrike+ `apply` optional (oneOf' [ ("ReferenceSwapCurve", fmap OneOf2 (parseSchemaType "referenceSwapCurve"))+ , ("OptionStrike", fmap TwoOf2 (parseSchemaType "price"))+ ])+ schemaTypeToXML s x@BondOptionStrike{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "referenceSwapCurve")+ (schemaTypeToXML "price")+ ) $ bondOptionStrike_choice0 x+ ]+ +-- | A complex type to specify the amount to be paid by the +-- buyer of the option if the option is exercised prior to the +-- Early Call Date (Typically applicable to the convertible +-- bond options).+data MakeWholeAmount = MakeWholeAmount+ { makeWholeAmount_floatingRateIndex :: FloatingRateIndex+ , makeWholeAmount_indexTenor :: Maybe Period+ -- ^ The ISDA Designated Maturity, i.e. the tenor of the + -- floating rate.+ , makeWholeAmount_spread :: Maybe Xsd.Decimal+ -- ^ Spread in basis points over the floating rate index.+ , makeWholeAmount_side :: Maybe QuotationSideEnum+ -- ^ The side (bid/mid/ask) of the measure.+ , makeWholeAmount_interpolationMethod :: Maybe InterpolationMethod+ -- ^ The type of interpolation method that the calculation agent + -- reserves the right to use.+ , makeWholeAmount_earlyCallDate :: Maybe IdentifiedDate+ -- ^ Date prior to which the option buyer will have to pay a + -- Make Whole Amount to the option seller if he/she exercises + -- the option.+ }+ deriving (Eq,Show)+instance SchemaType MakeWholeAmount where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return MakeWholeAmount+ `apply` parseSchemaType "floatingRateIndex"+ `apply` optional (parseSchemaType "indexTenor")+ `apply` optional (parseSchemaType "spread")+ `apply` optional (parseSchemaType "side")+ `apply` optional (parseSchemaType "interpolationMethod")+ `apply` optional (parseSchemaType "earlyCallDate")+ schemaTypeToXML s x@MakeWholeAmount{} =+ toXMLElement s []+ [ schemaTypeToXML "floatingRateIndex" $ makeWholeAmount_floatingRateIndex x+ , maybe [] (schemaTypeToXML "indexTenor") $ makeWholeAmount_indexTenor x+ , maybe [] (schemaTypeToXML "spread") $ makeWholeAmount_spread x+ , maybe [] (schemaTypeToXML "side") $ makeWholeAmount_side x+ , maybe [] (schemaTypeToXML "interpolationMethod") $ makeWholeAmount_interpolationMethod x+ , maybe [] (schemaTypeToXML "earlyCallDate") $ makeWholeAmount_earlyCallDate x+ ]+instance Extension MakeWholeAmount SwapCurveValuation where+ supertype (MakeWholeAmount e0 e1 e2 e3 e4 e5) =+ SwapCurveValuation e0 e1 e2 e3+ +-- | A complex type used to specify the option and convertible +-- bond option strike when expressed in reference to a swap +-- curve.+data ReferenceSwapCurve = ReferenceSwapCurve+ { refSwapCurve_swapUnwindValue :: Maybe SwapCurveValuation+ , refSwapCurve_makeWholeAmount :: Maybe MakeWholeAmount+ -- ^ Amount to be paid by the buyer of the option if the option + -- is exercised prior to the Early Call Date. (The market + -- practice in the convertible bond option space being that + -- the buyer should be penalized if he/she exercises the + -- option early on.)+ }+ deriving (Eq,Show)+instance SchemaType ReferenceSwapCurve where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReferenceSwapCurve+ `apply` optional (parseSchemaType "swapUnwindValue")+ `apply` optional (parseSchemaType "makeWholeAmount")+ schemaTypeToXML s x@ReferenceSwapCurve{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "swapUnwindValue") $ refSwapCurve_swapUnwindValue x+ , maybe [] (schemaTypeToXML "makeWholeAmount") $ refSwapCurve_makeWholeAmount x+ ]+ +-- | A complex type to specify a valuation swap curve, which is +-- used as part of the strike construct for the bond and +-- convertible bond options.+data SwapCurveValuation = SwapCurveValuation+ { swapCurveVal_floatingRateIndex :: FloatingRateIndex+ , swapCurveVal_indexTenor :: Maybe Period+ -- ^ The ISDA Designated Maturity, i.e. the tenor of the + -- floating rate.+ , swapCurveVal_spread :: Maybe Xsd.Decimal+ -- ^ Spread in basis points over the floating rate index.+ , swapCurveVal_side :: Maybe QuotationSideEnum+ -- ^ The side (bid/mid/ask) of the measure.+ }+ deriving (Eq,Show)+instance SchemaType SwapCurveValuation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SwapCurveValuation+ `apply` parseSchemaType "floatingRateIndex"+ `apply` optional (parseSchemaType "indexTenor")+ `apply` optional (parseSchemaType "spread")+ `apply` optional (parseSchemaType "side")+ schemaTypeToXML s x@SwapCurveValuation{} =+ toXMLElement s []+ [ schemaTypeToXML "floatingRateIndex" $ swapCurveVal_floatingRateIndex x+ , maybe [] (schemaTypeToXML "indexTenor") $ swapCurveVal_indexTenor x+ , maybe [] (schemaTypeToXML "spread") $ swapCurveVal_spread x+ , maybe [] (schemaTypeToXML "side") $ swapCurveVal_side x+ ]+ +-- | A component describing a Bond Option product.+elementBondOption :: XMLParser BondOption+elementBondOption = parseSchemaType "bondOption"+elementToXMLBondOption :: BondOption -> [Content ()]+elementToXMLBondOption = schemaTypeToXML "bondOption"
+ Data/FpML/V53/Option/Bond.hs-boot view
@@ -0,0 +1,58 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Option.Bond+ ( module Data.FpML.V53.Option.Bond+ , module Data.FpML.V53.Shared.Option+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Shared.Option+ +-- | A Bond Option +data BondOption+instance Eq BondOption+instance Show BondOption+instance SchemaType BondOption+instance Extension BondOption OptionBaseExtended+instance Extension BondOption OptionBase+instance Extension BondOption Option+instance Extension BondOption Product+ +-- | A complex type to specify the strike of a bond or +-- convertible bond option. +data BondOptionStrike+instance Eq BondOptionStrike+instance Show BondOptionStrike+instance SchemaType BondOptionStrike+ +-- | A complex type to specify the amount to be paid by the +-- buyer of the option if the option is exercised prior to the +-- Early Call Date (Typically applicable to the convertible +-- bond options). +data MakeWholeAmount+instance Eq MakeWholeAmount+instance Show MakeWholeAmount+instance SchemaType MakeWholeAmount+instance Extension MakeWholeAmount SwapCurveValuation+ +-- | A complex type used to specify the option and convertible +-- bond option strike when expressed in reference to a swap +-- curve. +data ReferenceSwapCurve+instance Eq ReferenceSwapCurve+instance Show ReferenceSwapCurve+instance SchemaType ReferenceSwapCurve+ +-- | A complex type to specify a valuation swap curve, which is +-- used as part of the strike construct for the bond and +-- convertible bond options. +data SwapCurveValuation+instance Eq SwapCurveValuation+instance Show SwapCurveValuation+instance SchemaType SwapCurveValuation+ +-- | A component describing a Bond Option product. +elementBondOption :: XMLParser BondOption+elementToXMLBondOption :: BondOption -> [Content ()]
+ Data/FpML/V53/Processes/Recordkeeping.hs view
@@ -0,0 +1,343 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+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+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +data NonpublicExecutionReport = NonpublicExecutionReport+ { nonpubExecutReport_fpmlVersion :: Xsd.XsdString+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , nonpubExecutReport_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , nonpubExecutReport_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , nonpubExecutReport_header :: Maybe RequestMessageHeader+ , nonpubExecutReport_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , nonpubExecutReport_isCorrection :: Maybe Xsd.Boolean+ -- ^ Indicates if this message corrects an earlier request.+ , nonpubExecutReport_parentCorrelationId :: Maybe CorrelationId+ -- ^ An optional identifier used to correlate between related + -- processes+ , nonpubExecutReport_correlationId :: [CorrelationId]+ -- ^ A qualified identifier used to correlate between messages+ , nonpubExecutReport_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric value that can be used to order messages with the + -- same correlation identifier from the same sender.+ , nonpubExecutReport_onBehalfOf :: [OnBehalfOf]+ -- ^ Indicates which party (or parties) (and accounts) a trade + -- or event is being processed for. Normally there will only + -- be a maximum of 2 parties, but in the case of a novation + -- there could be a transferor, transferee, remaining party, + -- and other remaining party. Except for this case, there + -- should be no more than two onABehalfOf references in a + -- message.+ , nonpubExecutReport_asOfDate :: Maybe IdentifiedDate+ -- ^ The date for which this document reports positions and + -- valuations.+ , nonpubExecutReport_asOfTime :: Maybe Xsd.Time+ -- ^ The time for which this report was generated (i.e., the + -- cut-off time of the report).+ , nonpubExecutReport_portfolioReference :: Maybe PortfolioReferenceBase+ , nonpubExecutReport_choice10 :: (Maybe (OneOf10 ((Maybe (OriginatingEvent)),(Maybe (Trade))) TradeAmendmentContent TradeNotionalChange ((Maybe (TerminatingEvent)),(Maybe (TradeNotionalChange))) TradeNovationContent OptionExercise [OptionExpiry] DeClear Withdrawal AdditionalEvent))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * originatingEvent+ -- + -- * trade+ -- + -- (2) amendment+ -- + -- (3) increase+ -- + -- (4) Sequence of:+ -- + -- * terminatingEvent+ -- + -- * termination+ -- + -- (5) novation+ -- + -- (6) optionExercise+ -- + -- (7) optionExpiry+ -- + -- (8) deClear+ -- + -- (9) withdrawal+ -- + -- (10) The additionalEvent element is an + -- extension/substitution point to customize FpML and add + -- additional events.+ , nonpubExecutReport_quote :: [BasicQuotation]+ -- ^ Pricing information for the trade.+ , nonpubExecutReport_party :: [Party]+ , nonpubExecutReport_account :: [Account]+ -- ^ Optional account information used to precisely define the + -- origination and destination of financial instruments.+ }+ 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+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , nonpubExecutReportRetrac_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , nonpubExecutReportRetrac_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , nonpubExecutReportRetrac_header :: Maybe RequestMessageHeader+ , nonpubExecutReportRetrac_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , nonpubExecutReportRetrac_parentCorrelationId :: Maybe CorrelationId+ -- ^ An optional identifier used to correlate between related + -- processes+ , nonpubExecutReportRetrac_correlationId :: [CorrelationId]+ -- ^ A qualified identifier used to correlate between messages+ , nonpubExecutReportRetrac_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric value that can be used to order messages with the + -- same correlation identifier from the same sender.+ , nonpubExecutReportRetrac_onBehalfOf :: [OnBehalfOf]+ -- ^ Indicates which party (or parties) (and accounts) a trade + -- or event is being processed for. Normally there will only + -- be a maximum of 2 parties, but in the case of a novation + -- there could be a transferor, transferee, remaining party, + -- and other remaining party. Except for this case, there + -- should be no more than two onABehalfOf references in a + -- message.+ , nonpubExecutReportRetrac_choice6 :: OneOf2 ((Maybe (OneOf10 ((Maybe (OriginatingEvent)),(Maybe (Trade))) TradeAmendmentContent TradeNotionalChange ((Maybe (TerminatingEvent)),(Maybe (TradeNotionalChange))) TradeNovationContent OptionExercise [OptionExpiry] DeClear Withdrawal AdditionalEvent))) PartyTradeIdentifier+ -- ^ Choice between:+ -- + -- (1) unknown+ -- + -- (2) tradeIdentifier+ , nonpubExecutReportRetrac_party :: [Party]+ , nonpubExecutReportRetrac_account :: [Account]+ -- ^ Optional account information used to precisely define the + -- origination and destination of financial instruments.+ }+ 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"
+ Data/FpML/V53/Processes/Recordkeeping.hs-boot view
@@ -0,0 +1,41 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+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 qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Events.Business+ +data NonpublicExecutionReport+instance Eq NonpublicExecutionReport+instance Show NonpublicExecutionReport+instance SchemaType NonpublicExecutionReport+instance Extension NonpublicExecutionReport CorrectableRequestMessage+instance Extension NonpublicExecutionReport RequestMessage+instance Extension NonpublicExecutionReport Message+instance Extension NonpublicExecutionReport Document+ +data NonpublicExecutionReportRetracted+instance Eq NonpublicExecutionReportRetracted+instance Show NonpublicExecutionReportRetracted+instance SchemaType NonpublicExecutionReportRetracted+instance Extension NonpublicExecutionReportRetracted NonCorrectableRequestMessage+instance Extension NonpublicExecutionReportRetracted RequestMessage+instance Extension NonpublicExecutionReportRetracted Message+instance Extension NonpublicExecutionReportRetracted Document+ +elementNonpublicExecutionReport :: XMLParser NonpublicExecutionReport+elementToXMLNonpublicExecutionReport :: NonpublicExecutionReport -> [Content ()]+ +elementNonpublicExecutionReportRetracted :: XMLParser NonpublicExecutionReportRetracted+elementToXMLNonpublicExecutionReportRetracted :: NonpublicExecutionReportRetracted -> [Content ()]+ +elementNonpublicExecutionReportAcknowledgement :: XMLParser Acknowledgement+elementToXMLNonpublicExecutionReportAcknowledgement :: Acknowledgement -> [Content ()]+ +elementNonpublicExecutionReportException :: XMLParser Exception+elementToXMLNonpublicExecutionReportException :: Exception -> [Content ()]
+ Data/FpML/V53/Reporting/Valuation.hs view
@@ -0,0 +1,508 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Reporting.Valuation+ ( module Data.FpML.V53.Reporting.Valuation+ , module Data.FpML.V53.Events.Business+ , module Data.FpML.V53.Valuation+ ) 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+import Data.FpML.V53.Valuation+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | A type used to describe the scope/contents of a report.+data ReportContents = ReportContents+ { reportConten_partyReference :: Maybe PartyReference+ -- ^ The party for which this report was generated.+ , reportConten_accountReference :: Maybe AccountReference+ -- ^ The account for which this report was generated.+ , reportConten_category :: [TradeCategory]+ -- ^ Used to categorize trades into user-defined categories, + -- such as house trades vs. customer trades.+ , reportConten_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , reportConten_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , reportConten_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , reportConten_queryPortfolio :: Maybe QueryPortfolio+ -- ^ The desired query portfolio.+ }+ deriving (Eq,Show)+instance SchemaType ReportContents where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReportContents+ `apply` optional (parseSchemaType "partyReference")+ `apply` optional (parseSchemaType "accountReference")+ `apply` many (parseSchemaType "category")+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` optional (parseSchemaType "queryPortfolio")+ schemaTypeToXML s x@ReportContents{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "partyReference") $ reportConten_partyReference x+ , maybe [] (schemaTypeToXML "accountReference") $ reportConten_accountReference x+ , concatMap (schemaTypeToXML "category") $ reportConten_category x+ , maybe [] (schemaTypeToXML "primaryAssetClass") $ reportConten_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ reportConten_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ reportConten_productType x+ , maybe [] (schemaTypeToXML "queryPortfolio") $ reportConten_queryPortfolio x+ ]+ +-- | A type used in valuation enquiry messages which relates a +-- portfolio to its trades and current value.+data PortfolioValuationItem = PortfolioValuationItem+ { portfValItem_portfolio :: Maybe Portfolio+ -- ^ Global portfolio element used as a basis for a substitution + -- group.+ , portfValItem_tradeValuationItem :: [TradeValuationItem]+ -- ^ Zero or more trade valuation items.+ , portfValItem_valuationSet :: Maybe ValuationSet+ }+ deriving (Eq,Show)+instance SchemaType PortfolioValuationItem where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PortfolioValuationItem+ `apply` optional (elementPortfolio)+ `apply` many (parseSchemaType "tradeValuationItem")+ `apply` optional (elementValuationSet)+ schemaTypeToXML s x@PortfolioValuationItem{} =+ toXMLElement s []+ [ maybe [] (elementToXMLPortfolio) $ portfValItem_portfolio x+ , concatMap (schemaTypeToXML "tradeValuationItem") $ portfValItem_tradeValuationItem x+ , maybe [] (elementToXMLValuationSet) $ portfValItem_valuationSet x+ ]+ +-- | A type defining the content model for a message allowing +-- one party a report containing valuations of one or many +-- existing trades.+data RequestValuationReport = RequestValuationReport+ { reqValReport_fpmlVersion :: Xsd.XsdString+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , reqValReport_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , reqValReport_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , reqValReport_header :: Maybe RequestMessageHeader+ , reqValReport_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , reqValReport_isCorrection :: Maybe Xsd.Boolean+ -- ^ Indicates if this message corrects an earlier request.+ , reqValReport_parentCorrelationId :: Maybe CorrelationId+ -- ^ An optional identifier used to correlate between related + -- processes+ , reqValReport_correlationId :: [CorrelationId]+ -- ^ A qualified identifier used to correlate between messages+ , reqValReport_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric value that can be used to order messages with the + -- same correlation identifier from the same sender.+ , reqValReport_onBehalfOf :: [OnBehalfOf]+ -- ^ Indicates which party (or parties) (and accounts) a trade + -- or event is being processed for. Normally there will only + -- be a maximum of 2 parties, but in the case of a novation + -- there could be a transferor, transferee, remaining party, + -- and other remaining party. Except for this case, there + -- should be no more than two onABehalfOf references in a + -- message.+ , reqValReport_reportContents :: Maybe ReportContents+ -- ^ The specific characteristics to be included in the report.+ , reqValReport_asOfDate :: Maybe IdentifiedDate+ -- ^ The date for which this report is requested.+ , reqValReport_party :: [Party]+ , reqValReport_account :: [Account]+ -- ^ Optional account information used to precisely define the + -- origination and destination of financial instruments.+ , reqValReport_market :: Maybe Market+ -- ^ This is a global element used for creating global types. It + -- holds Market information, e.g. curves, surfaces, quotes, + -- etc.+ , reqValReport_portfolioValuationItem :: [PortfolioValuationItem]+ -- ^ An instance of a unique portfolio valuation.+ , reqValReport_tradeValuationItem :: [TradeValuationItem]+ -- ^ An instance of a unique trade valuation.+ }+ deriving (Eq,Show)+instance SchemaType RequestValuationReport 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 (RequestValuationReport 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 "reportContents")+ `apply` optional (parseSchemaType "asOfDate")+ `apply` many (parseSchemaType "party")+ `apply` many (parseSchemaType "account")+ `apply` optional (elementMarket)+ `apply` many (parseSchemaType "portfolioValuationItem")+ `apply` many (parseSchemaType "tradeValuationItem")+ schemaTypeToXML s x@RequestValuationReport{} =+ toXMLElement s [ toXMLAttribute "fpmlVersion" $ reqValReport_fpmlVersion x+ , maybe [] (toXMLAttribute "expectedBuild") $ reqValReport_expectedBuild x+ , maybe [] (toXMLAttribute "actualBuild") $ reqValReport_actualBuild x+ ]+ [ maybe [] (schemaTypeToXML "header") $ reqValReport_header x+ , concatMap (schemaTypeToXML "validation") $ reqValReport_validation x+ , maybe [] (schemaTypeToXML "isCorrection") $ reqValReport_isCorrection x+ , maybe [] (schemaTypeToXML "parentCorrelationId") $ reqValReport_parentCorrelationId x+ , concatMap (schemaTypeToXML "correlationId") $ reqValReport_correlationId x+ , maybe [] (schemaTypeToXML "sequenceNumber") $ reqValReport_sequenceNumber x+ , concatMap (schemaTypeToXML "onBehalfOf") $ reqValReport_onBehalfOf x+ , maybe [] (schemaTypeToXML "reportContents") $ reqValReport_reportContents x+ , maybe [] (schemaTypeToXML "asOfDate") $ reqValReport_asOfDate x+ , concatMap (schemaTypeToXML "party") $ reqValReport_party x+ , concatMap (schemaTypeToXML "account") $ reqValReport_account x+ , maybe [] (elementToXMLMarket) $ reqValReport_market x+ , concatMap (schemaTypeToXML "portfolioValuationItem") $ reqValReport_portfolioValuationItem x+ , concatMap (schemaTypeToXML "tradeValuationItem") $ reqValReport_tradeValuationItem x+ ]+instance Extension RequestValuationReport CorrectableRequestMessage where+ supertype v = CorrectableRequestMessage_RequestValuationReport v+instance Extension RequestValuationReport RequestMessage where+ supertype = (supertype :: CorrectableRequestMessage -> RequestMessage)+ . (supertype :: RequestValuationReport -> CorrectableRequestMessage)+ +instance Extension RequestValuationReport Message where+ supertype = (supertype :: RequestMessage -> Message)+ . (supertype :: CorrectableRequestMessage -> RequestMessage)+ . (supertype :: RequestValuationReport -> CorrectableRequestMessage)+ +instance Extension RequestValuationReport Document where+ supertype = (supertype :: Message -> Document)+ . (supertype :: RequestMessage -> Message)+ . (supertype :: CorrectableRequestMessage -> RequestMessage)+ . (supertype :: RequestValuationReport -> CorrectableRequestMessage)+ + +-- | A type used in trade valuation enquiry messages which +-- relates a trade identifier to its current value.+data TradeValuationItem = TradeValuationItem+ { tradeValItem_choice0 :: (Maybe (OneOf2 [PartyTradeIdentifier] Trade))+ -- ^ Choice between:+ -- + -- (1) One or more trade identifiers needed to uniquely + -- identify a trade.+ -- + -- (2) Fully-described trades whose values are reported.+ , tradeValItem_valuationSet :: Maybe ValuationSet+ }+ deriving (Eq,Show)+instance SchemaType TradeValuationItem where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return TradeValuationItem+ `apply` optional (oneOf' [ ("[PartyTradeIdentifier]", fmap OneOf2 (many1 (parseSchemaType "partyTradeIdentifier")))+ , ("Trade", fmap TwoOf2 (parseSchemaType "trade"))+ ])+ `apply` optional (elementValuationSet)+ schemaTypeToXML s x@TradeValuationItem{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (concatMap (schemaTypeToXML "partyTradeIdentifier"))+ (schemaTypeToXML "trade")+ ) $ tradeValItem_choice0 x+ , maybe [] (elementToXMLValuationSet) $ tradeValItem_valuationSet x+ ]+ +-- | A type defining the content model for a message normally +-- generated in response to a RequestValuationReport request.+data ValuationReport = ValuationReport+ { valReport_fpmlVersion :: Xsd.XsdString+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , valReport_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , valReport_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , valReport_header :: Maybe NotificationMessageHeader+ , valReport_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , valReport_parentCorrelationId :: Maybe CorrelationId+ -- ^ An optional identifier used to correlate between related + -- processes+ , valReport_correlationId :: [CorrelationId]+ -- ^ A qualified identifier used to correlate between messages+ , valReport_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric value that can be used to order messages with the + -- same correlation identifier from the same sender.+ , valReport_onBehalfOf :: [OnBehalfOf]+ -- ^ Indicates which party (or parties) (and accounts) a trade + -- or event is being processed for. Normally there will only + -- be a maximum of 2 parties, but in the case of a novation + -- there could be a transferor, transferee, remaining party, + -- and other remaining party. Except for this case, there + -- should be no more than two onABehalfOf references in a + -- message.+ , valReport_reportIdentification :: Maybe ReportIdentification+ -- ^ Identifiers for the report instance and section.+ , valReport_reportContents :: Maybe ReportContents+ -- ^ The specific characteristics included in the report.+ , valReport_asOfDate :: Maybe IdentifiedDate+ -- ^ The date for which this request was generated.+ , valReport_party :: [Party]+ , valReport_account :: [Account]+ -- ^ Optional account information used to precisely define the + -- origination and destination of financial instruments.+ , valReport_market :: Maybe Market+ -- ^ This is a global element used for creating global types. It + -- holds Market information, e.g. curves, surfaces, quotes, + -- etc.+ , valReport_portfolioValuationItem :: [PortfolioValuationItem]+ -- ^ An instance of a unique portfolio valuation.+ , valReport_tradeValuationItem :: [TradeValuationItem]+ -- ^ A collection of data values describing the state of the + -- given trade.+ }+ deriving (Eq,Show)+instance SchemaType ValuationReport 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 (ValuationReport 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` optional (parseSchemaType "reportIdentification")+ `apply` optional (parseSchemaType "reportContents")+ `apply` optional (parseSchemaType "asOfDate")+ `apply` many (parseSchemaType "party")+ `apply` many (parseSchemaType "account")+ `apply` optional (elementMarket)+ `apply` many (parseSchemaType "portfolioValuationItem")+ `apply` many (parseSchemaType "tradeValuationItem")+ schemaTypeToXML s x@ValuationReport{} =+ toXMLElement s [ toXMLAttribute "fpmlVersion" $ valReport_fpmlVersion x+ , maybe [] (toXMLAttribute "expectedBuild") $ valReport_expectedBuild x+ , maybe [] (toXMLAttribute "actualBuild") $ valReport_actualBuild x+ ]+ [ maybe [] (schemaTypeToXML "header") $ valReport_header x+ , concatMap (schemaTypeToXML "validation") $ valReport_validation x+ , maybe [] (schemaTypeToXML "parentCorrelationId") $ valReport_parentCorrelationId x+ , concatMap (schemaTypeToXML "correlationId") $ valReport_correlationId x+ , maybe [] (schemaTypeToXML "sequenceNumber") $ valReport_sequenceNumber x+ , concatMap (schemaTypeToXML "onBehalfOf") $ valReport_onBehalfOf x+ , maybe [] (schemaTypeToXML "reportIdentification") $ valReport_reportIdentification x+ , maybe [] (schemaTypeToXML "reportContents") $ valReport_reportContents x+ , maybe [] (schemaTypeToXML "asOfDate") $ valReport_asOfDate x+ , concatMap (schemaTypeToXML "party") $ valReport_party x+ , concatMap (schemaTypeToXML "account") $ valReport_account x+ , maybe [] (elementToXMLMarket) $ valReport_market x+ , concatMap (schemaTypeToXML "portfolioValuationItem") $ valReport_portfolioValuationItem x+ , concatMap (schemaTypeToXML "tradeValuationItem") $ valReport_tradeValuationItem x+ ]+instance Extension ValuationReport NotificationMessage where+ supertype v = NotificationMessage_ValuationReport v+instance Extension ValuationReport Message where+ supertype = (supertype :: NotificationMessage -> Message)+ . (supertype :: ValuationReport -> NotificationMessage)+ +instance Extension ValuationReport Document where+ supertype = (supertype :: Message -> Document)+ . (supertype :: NotificationMessage -> Message)+ . (supertype :: ValuationReport -> NotificationMessage)+ + +-- | A type defining the content model for a message that +-- retracts a valuation report. This says that the most +-- recently supplied valuation is erroneous and a previous +-- value should be used.+data ValuationReportRetracted = ValuationReportRetracted+ { valReportRetrac_fpmlVersion :: Xsd.XsdString+ -- ^ Indicate which version of the FpML Schema an FpML message + -- adheres to.+ , valReportRetrac_expectedBuild :: Maybe Xsd.PositiveInteger+ -- ^ This optional attribute can be supplied by a message + -- creator in an FpML instance to specify which build number + -- of the schema was used to define the message when it was + -- generated.+ , valReportRetrac_actualBuild :: Maybe Xsd.PositiveInteger+ -- ^ The specific build number of this schema version. This + -- attribute is not included in an instance document. Instead, + -- it is supplied by the XML parser when the document is + -- validated against the FpML schema and indicates the build + -- number of the schema file. Every time FpML publishes a + -- change to the schema, validation rules, or examples within + -- a version (e.g., version 4.2) the actual build number is + -- incremented. If no changes have been made between releases + -- within a version (i.e. from Trial Recommendation to + -- Recommendation) the actual build number stays the same.+ , valReportRetrac_header :: Maybe NotificationMessageHeader+ , valReportRetrac_validation :: [Validation]+ -- ^ A list of validation sets the sender asserts the document + -- is valid with respect to.+ , valReportRetrac_parentCorrelationId :: Maybe CorrelationId+ -- ^ An optional identifier used to correlate between related + -- processes+ , valReportRetrac_correlationId :: [CorrelationId]+ -- ^ A qualified identifier used to correlate between messages+ , valReportRetrac_sequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A numeric value that can be used to order messages with the + -- same correlation identifier from the same sender.+ , valReportRetrac_onBehalfOf :: [OnBehalfOf]+ -- ^ Indicates which party (or parties) (and accounts) a trade + -- or event is being processed for. Normally there will only + -- be a maximum of 2 parties, but in the case of a novation + -- there could be a transferor, transferee, remaining party, + -- and other remaining party. Except for this case, there + -- should be no more than two onABehalfOf references in a + -- message.+ , valReportRetrac_reportIdentification :: Maybe ReportIdentification+ -- ^ Identifiers for the report instance and section.+ , valReportRetrac_reportContents :: Maybe ReportContents+ -- ^ The specific characteristics included in the report.+ , valReportRetrac_asOfDate :: Maybe IdentifiedDate+ -- ^ The date for which this request was generated.+ , valReportRetrac_partyTradeIdentifier :: [PartyTradeIdentifier]+ -- ^ One or more trade identifiers needed to uniquely identify a + -- trade.+ , valReportRetrac_party :: [Party]+ , valReportRetrac_account :: [Account]+ -- ^ Optional account information used to precisely define the + -- origination and destination of financial instruments.+ }+ deriving (Eq,Show)+instance SchemaType ValuationReportRetracted 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 (ValuationReportRetracted 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` optional (parseSchemaType "reportIdentification")+ `apply` optional (parseSchemaType "reportContents")+ `apply` optional (parseSchemaType "asOfDate")+ `apply` many (parseSchemaType "partyTradeIdentifier")+ `apply` many (parseSchemaType "party")+ `apply` many (parseSchemaType "account")+ schemaTypeToXML s x@ValuationReportRetracted{} =+ toXMLElement s [ toXMLAttribute "fpmlVersion" $ valReportRetrac_fpmlVersion x+ , maybe [] (toXMLAttribute "expectedBuild") $ valReportRetrac_expectedBuild x+ , maybe [] (toXMLAttribute "actualBuild") $ valReportRetrac_actualBuild x+ ]+ [ maybe [] (schemaTypeToXML "header") $ valReportRetrac_header x+ , concatMap (schemaTypeToXML "validation") $ valReportRetrac_validation x+ , maybe [] (schemaTypeToXML "parentCorrelationId") $ valReportRetrac_parentCorrelationId x+ , concatMap (schemaTypeToXML "correlationId") $ valReportRetrac_correlationId x+ , maybe [] (schemaTypeToXML "sequenceNumber") $ valReportRetrac_sequenceNumber x+ , concatMap (schemaTypeToXML "onBehalfOf") $ valReportRetrac_onBehalfOf x+ , maybe [] (schemaTypeToXML "reportIdentification") $ valReportRetrac_reportIdentification x+ , maybe [] (schemaTypeToXML "reportContents") $ valReportRetrac_reportContents x+ , maybe [] (schemaTypeToXML "asOfDate") $ valReportRetrac_asOfDate x+ , concatMap (schemaTypeToXML "partyTradeIdentifier") $ valReportRetrac_partyTradeIdentifier x+ , concatMap (schemaTypeToXML "party") $ valReportRetrac_party x+ , concatMap (schemaTypeToXML "account") $ valReportRetrac_account x+ ]+instance Extension ValuationReportRetracted NotificationMessage where+ supertype v = NotificationMessage_ValuationReportRetracted v+instance Extension ValuationReportRetracted Message where+ supertype = (supertype :: NotificationMessage -> Message)+ . (supertype :: ValuationReportRetracted -> NotificationMessage)+ +instance Extension ValuationReportRetracted Document where+ supertype = (supertype :: Message -> Document)+ . (supertype :: NotificationMessage -> Message)+ . (supertype :: ValuationReportRetracted -> NotificationMessage)+ + +-- | Global portfolio element used as a basis for a substitution +-- group.+elementPortfolio :: XMLParser Portfolio+elementPortfolio = parseSchemaType "portfolio"+elementToXMLPortfolio :: Portfolio -> [Content ()]+elementToXMLPortfolio = schemaTypeToXML "portfolio"+ +-- | Global element used to substitute for "portfolio".+elementQueryPortfolio :: XMLParser QueryPortfolio+elementQueryPortfolio = parseSchemaType "queryPortfolio"+elementToXMLQueryPortfolio :: QueryPortfolio -> [Content ()]+elementToXMLQueryPortfolio = schemaTypeToXML "queryPortfolio"+ +-- | Reporting messages.+ +elementRequestValuationReport :: XMLParser RequestValuationReport+elementRequestValuationReport = parseSchemaType "requestValuationReport"+elementToXMLRequestValuationReport :: RequestValuationReport -> [Content ()]+elementToXMLRequestValuationReport = schemaTypeToXML "requestValuationReport"+ +elementValuationReport :: XMLParser ValuationReport+elementValuationReport = parseSchemaType "valuationReport"+elementToXMLValuationReport :: ValuationReport -> [Content ()]+elementToXMLValuationReport = schemaTypeToXML "valuationReport"+ +elementValuationReportRetracted :: XMLParser ValuationReportRetracted+elementValuationReportRetracted = parseSchemaType "valuationReportRetracted"+elementToXMLValuationReportRetracted :: ValuationReportRetracted -> [Content ()]+elementToXMLValuationReportRetracted = schemaTypeToXML "valuationReportRetracted"+ +elementValuationReportAcknowledgement :: XMLParser Acknowledgement+elementValuationReportAcknowledgement = parseSchemaType "valuationReportAcknowledgement"+elementToXMLValuationReportAcknowledgement :: Acknowledgement -> [Content ()]+elementToXMLValuationReportAcknowledgement = schemaTypeToXML "valuationReportAcknowledgement"+ +elementValuationReportException :: XMLParser Exception+elementValuationReportException = parseSchemaType "valuationReportException"+elementToXMLValuationReportException :: Exception -> [Content ()]+elementToXMLValuationReportException = schemaTypeToXML "valuationReportException"
+ Data/FpML/V53/Reporting/Valuation.hs-boot view
@@ -0,0 +1,93 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Reporting.Valuation+ ( module Data.FpML.V53.Reporting.Valuation+ , module Data.FpML.V53.Events.Business+ , module Data.FpML.V53.Valuation+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Events.Business+import {-# SOURCE #-} Data.FpML.V53.Valuation+ +-- | A type used to describe the scope/contents of a report. +data ReportContents+instance Eq ReportContents+instance Show ReportContents+instance SchemaType ReportContents+ +-- | A type used in valuation enquiry messages which relates a +-- portfolio to its trades and current value. +data PortfolioValuationItem+instance Eq PortfolioValuationItem+instance Show PortfolioValuationItem+instance SchemaType PortfolioValuationItem+ +-- | A type defining the content model for a message allowing +-- one party a report containing valuations of one or many +-- existing trades. +data RequestValuationReport+instance Eq RequestValuationReport+instance Show RequestValuationReport+instance SchemaType RequestValuationReport+instance Extension RequestValuationReport CorrectableRequestMessage+instance Extension RequestValuationReport RequestMessage+instance Extension RequestValuationReport Message+instance Extension RequestValuationReport Document+ +-- | A type used in trade valuation enquiry messages which +-- relates a trade identifier to its current value. +data TradeValuationItem+instance Eq TradeValuationItem+instance Show TradeValuationItem+instance SchemaType TradeValuationItem+ +-- | A type defining the content model for a message normally +-- generated in response to a RequestValuationReport request. +data ValuationReport+instance Eq ValuationReport+instance Show ValuationReport+instance SchemaType ValuationReport+instance Extension ValuationReport NotificationMessage+instance Extension ValuationReport Message+instance Extension ValuationReport Document+ +-- | A type defining the content model for a message that +-- retracts a valuation report. This says that the most +-- recently supplied valuation is erroneous and a previous +-- value should be used. +data ValuationReportRetracted+instance Eq ValuationReportRetracted+instance Show ValuationReportRetracted+instance SchemaType ValuationReportRetracted+instance Extension ValuationReportRetracted NotificationMessage+instance Extension ValuationReportRetracted Message+instance Extension ValuationReportRetracted Document+ +-- | Global portfolio element used as a basis for a substitution +-- group. +elementPortfolio :: XMLParser Portfolio+elementToXMLPortfolio :: Portfolio -> [Content ()]+ +-- | Global element used to substitute for "portfolio". +elementQueryPortfolio :: XMLParser QueryPortfolio+elementToXMLQueryPortfolio :: QueryPortfolio -> [Content ()]+ +-- | Reporting messages. + +elementRequestValuationReport :: XMLParser RequestValuationReport+elementToXMLRequestValuationReport :: RequestValuationReport -> [Content ()]+ +elementValuationReport :: XMLParser ValuationReport+elementToXMLValuationReport :: ValuationReport -> [Content ()]+ +elementValuationReportRetracted :: XMLParser ValuationReportRetracted+elementToXMLValuationReportRetracted :: ValuationReportRetracted -> [Content ()]+ +elementValuationReportAcknowledgement :: XMLParser Acknowledgement+elementToXMLValuationReportAcknowledgement :: Acknowledgement -> [Content ()]+ +elementValuationReportException :: XMLParser Exception+elementToXMLValuationReportException :: Exception -> [Content ()]
+ Data/FpML/V53/Riskdef.hs view
@@ -0,0 +1,1045 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Riskdef+ ( module Data.FpML.V53.Riskdef+ , module Data.FpML.V53.Doc+ , module Data.FpML.V53.Asset+ , module Data.FpML.V53.Mktenv+ ) 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.Doc+import Data.FpML.V53.Asset+ +-- Some hs-boot imports are required, for fwd-declaring types.+import {-# SOURCE #-} Data.FpML.V53.Mktenv ( elementYieldCurve, elementToXMLYieldCurve )+import {-# SOURCE #-} Data.FpML.V53.Mktenv ( elementVolatilityRepresentation, elementToXMLVolatilityRepresentation )+import {-# SOURCE #-} Data.FpML.V53.Mktenv ( elementFxCurve, elementToXMLFxCurve )+import {-# SOURCE #-} Data.FpML.V53.Mktenv ( elementCreditCurve, elementToXMLCreditCurve )+import {-# SOURCE #-} Data.FpML.V53.Mktenv ( elementYieldCurveValuation, elementToXMLYieldCurveValuation )+import {-# SOURCE #-} Data.FpML.V53.Mktenv ( elementVolatilityMatrixValuation, elementToXMLVolatilityMatrixValuation )+import {-# SOURCE #-} Data.FpML.V53.Mktenv ( elementFxCurveValuation, elementToXMLFxCurveValuation )+import {-# SOURCE #-} Data.FpML.V53.Mktenv ( elementCreditCurveValuation, elementToXMLCreditCurveValuation )+ +-- | Reference to an underlying asset, term point or pricing +-- structure (yield curve).+data AssetOrTermPointOrPricingStructureReference = AssetOrTermPointOrPricingStructureReference+ { aotpopsr_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType AssetOrTermPointOrPricingStructureReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (AssetOrTermPointOrPricingStructureReference a0)+ schemaTypeToXML s x@AssetOrTermPointOrPricingStructureReference{} =+ toXMLElement s [ toXMLAttribute "href" $ aotpopsr_href x+ ]+ []+instance Extension AssetOrTermPointOrPricingStructureReference Reference where+ supertype v = Reference_AssetOrTermPointOrPricingStructureReference v+ +-- | A structure that holds a set of measures about an asset.+data BasicAssetValuation = BasicAssetValuation+ { basicAssetVal_ID :: Maybe Xsd.ID+ , basicAssetVal_definitionRef :: Maybe Xsd.IDREF+ -- ^ An optional reference to the scenario that this valuation + -- applies to.+ , basicAssetVal_objectReference :: Maybe AnyAssetReference+ -- ^ A reference to the asset or pricing structure that this + -- values.+ , basicAssetVal_valuationScenarioReference :: Maybe ValuationScenarioReference+ -- ^ A reference to the valuation scenario used to calculate + -- this valuation. If the Valuation occurs within a + -- ValuationSet, this value is optional and is defaulted from + -- the ValuationSet. If this value occurs in both places, the + -- lower level value (i.e. the one here) overrides that in the + -- higher (i.e. ValuationSet).+ , basicAssetVal_quote :: [BasicQuotation]+ -- ^ One or more numerical measures relating to the asset, + -- possibly together with sensitivities of that measure to + -- pricing inputs+ }+ deriving (Eq,Show)+instance SchemaType BasicAssetValuation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ a1 <- optional $ getAttribute "definitionRef" e pos+ commit $ interior e $ return (BasicAssetValuation a0 a1)+ `apply` optional (parseSchemaType "objectReference")+ `apply` optional (parseSchemaType "valuationScenarioReference")+ `apply` many (parseSchemaType "quote")+ schemaTypeToXML s x@BasicAssetValuation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ basicAssetVal_ID x+ , maybe [] (toXMLAttribute "definitionRef") $ basicAssetVal_definitionRef x+ ]+ [ maybe [] (schemaTypeToXML "objectReference") $ basicAssetVal_objectReference x+ , maybe [] (schemaTypeToXML "valuationScenarioReference") $ basicAssetVal_valuationScenarioReference x+ , concatMap (schemaTypeToXML "quote") $ basicAssetVal_quote x+ ]+instance Extension BasicAssetValuation Valuation where+ supertype (BasicAssetValuation a0 a1 e0 e1 e2) =+ Valuation a0 a1 e0 e1+ +-- | The type defining a denominator term of the formula. Its +-- value is (sum of weighted partials) ^ power.+data DenominatorTerm = DenominatorTerm+ { denomTerm_weightedPartial :: Maybe WeightedPartialDerivative+ -- ^ A partial derivative multiplied by a weighting factor.+ , denomTerm_power :: Maybe Xsd.PositiveInteger+ -- ^ The power to which this term is raised.+ }+ deriving (Eq,Show)+instance SchemaType DenominatorTerm where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DenominatorTerm+ `apply` optional (parseSchemaType "weightedPartial")+ `apply` optional (parseSchemaType "power")+ schemaTypeToXML s x@DenominatorTerm{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "weightedPartial") $ denomTerm_weightedPartial x+ , maybe [] (schemaTypeToXML "power") $ denomTerm_power x+ ]+ +-- | The method by which a derivative is computed.+data DerivativeCalculationMethod = DerivativeCalculationMethod Scheme DerivativeCalculationMethodAttributes deriving (Eq,Show)+data DerivativeCalculationMethodAttributes = DerivativeCalculationMethodAttributes+ { dcma_derivativeCalculationMethodScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType DerivativeCalculationMethod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "derivativeCalculationMethodScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ DerivativeCalculationMethod v (DerivativeCalculationMethodAttributes a0)+ schemaTypeToXML s (DerivativeCalculationMethod bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "derivativeCalculationMethodScheme") $ dcma_derivativeCalculationMethodScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension DerivativeCalculationMethod Scheme where+ supertype (DerivativeCalculationMethod s _) = s+ +-- | A description of how a numerical derivative is computed.+data DerivativeCalculationProcedure = DerivativeCalculationProcedure+ { derivCalcProced_method :: Maybe DerivativeCalculationMethod+ -- ^ The method by which a derivative is computed, e.g. + -- analytic, numerical model, perturbation, etc.+ , derivCalcProced_choice1 :: (Maybe (OneOf3 ((Maybe (Xsd.Decimal)),(Maybe (Xsd.Boolean)),(Maybe (PerturbationType))) Xsd.XsdString PricingStructureReference))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The size and direction of the perturbation used to + -- compute the derivative, e.g. 0.0001 = 1 bp.+ -- + -- * The value is calculated by perturbing by the + -- perturbationAmount and then the negative of the + -- perturbationAmount and then averaging the two + -- values (i.e. the value is half of the difference + -- between perturbing up and perturbing down).+ -- + -- * The type of perturbation, if any, used to compute + -- the derivative (Absolute vs Relative).+ -- + -- (2) The formula used to compute the derivative (perhaps + -- could be updated to use the Formula type in EQS.).+ -- + -- (3) A reference to the replacement version of the market + -- input, e.g. a bumped yield curve.+ }+ deriving (Eq,Show)+instance SchemaType DerivativeCalculationProcedure where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DerivativeCalculationProcedure+ `apply` optional (parseSchemaType "method")+ `apply` optional (oneOf' [ ("Maybe Xsd.Decimal Maybe Xsd.Boolean Maybe PerturbationType", fmap OneOf3 (return (,,) `apply` optional (parseSchemaType "perturbationAmount")+ `apply` optional (parseSchemaType "averaged")+ `apply` optional (parseSchemaType "perturbationType")))+ , ("Xsd.XsdString", fmap TwoOf3 (parseSchemaType "derivativeFormula"))+ , ("PricingStructureReference", fmap ThreeOf3 (parseSchemaType "replacementMarketInput"))+ ])+ schemaTypeToXML s x@DerivativeCalculationProcedure{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "method") $ derivCalcProced_method x+ , maybe [] (foldOneOf3 (\ (a,b,c) -> concat [ maybe [] (schemaTypeToXML "perturbationAmount") a+ , maybe [] (schemaTypeToXML "averaged") b+ , maybe [] (schemaTypeToXML "perturbationType") c+ ])+ (schemaTypeToXML "derivativeFormula")+ (schemaTypeToXML "replacementMarketInput")+ ) $ derivCalcProced_choice1 x+ ]+ +-- | A formula for computing a complex derivative from partial +-- derivatives. Its value is the sum of the terms divided by +-- the product of the denominator terms.+data DerivativeFormula = DerivativeFormula+ { derivFormula_term :: Maybe FormulaTerm+ -- ^ A term of the formula. Its value is the product of the its + -- coefficient and the referenced partial derivatives.+ , derivFormula_denominatorTerm :: Maybe DenominatorTerm+ -- ^ A denominator term of the formula. Its value is (sum of + -- weighted partials) ^ power.+ }+ deriving (Eq,Show)+instance SchemaType DerivativeFormula where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DerivativeFormula+ `apply` optional (parseSchemaType "term")+ `apply` optional (parseSchemaType "denominatorTerm")+ schemaTypeToXML s x@DerivativeFormula{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "term") $ derivFormula_term x+ , maybe [] (schemaTypeToXML "denominatorTerm") $ derivFormula_denominatorTerm x+ ]+ +-- | A type defining a term of the formula. Its value is the +-- product of the its coefficient and the referenced partial +-- derivatives.+data FormulaTerm = FormulaTerm+ { formulaTerm_coefficient :: Maybe Xsd.Decimal+ -- ^ The coefficient by which this term is multiplied, typically + -- 1 or -1.+ , formulaTerm_partialDerivativeReference :: [PricingParameterDerivativeReference]+ -- ^ A reference to the partial derivative.+ }+ deriving (Eq,Show)+instance SchemaType FormulaTerm where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FormulaTerm+ `apply` optional (parseSchemaType "coefficient")+ `apply` many (parseSchemaType "partialDerivativeReference")+ schemaTypeToXML s x@FormulaTerm{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "coefficient") $ formulaTerm_coefficient x+ , concatMap (schemaTypeToXML "partialDerivativeReference") $ formulaTerm_partialDerivativeReference x+ ]+ +-- | A generic (user defined) dimension, e.g. for use in a +-- correlation surface. e.g. a currency, stock, etc. This +-- would take values like USD, GBP, JPY, or IBM, MSFT, etc.+data GenericDimension = GenericDimension Xsd.XsdString GenericDimensionAttributes deriving (Eq,Show)+data GenericDimensionAttributes = GenericDimensionAttributes+ { genericDimensAttrib_name :: Xsd.NormalizedString+ -- ^ The name of the dimension. E.g.: "Currency", "Stock", + -- "Issuer", etc.+ , genericDimensAttrib_href :: Maybe Xsd.IDREF+ -- ^ A reference to an instrument (e.g. currency) that this + -- value represents.+ }+ deriving (Eq,Show)+instance SchemaType GenericDimension where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- getAttribute "name" e pos+ a1 <- optional $ getAttribute "href" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ GenericDimension v (GenericDimensionAttributes a0 a1)+ schemaTypeToXML s (GenericDimension bt at) =+ addXMLAttributes [ toXMLAttribute "name" $ genericDimensAttrib_name at+ , maybe [] (toXMLAttribute "href") $ genericDimensAttrib_href at+ ]+ $ schemaTypeToXML s bt+instance Extension GenericDimension Xsd.XsdString where+ supertype (GenericDimension s _) = s+ +-- | A collection of instruments usable for quotation purposes. +-- In future releases, quotable derivative assets may be added +-- after the underlying asset.+data InstrumentSet = InstrumentSet+ { instrSet_choice0 :: (Maybe (OneOf2 Asset Asset))+ -- ^ Choice between:+ -- + -- (1) Define the underlying asset, either a listed security + -- or other instrument.+ -- + -- (2) Defines the underlying asset when it is a curve + -- instrument.+ }+ deriving (Eq,Show)+instance SchemaType InstrumentSet where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return InstrumentSet+ `apply` optional (oneOf' [ ("Asset", fmap OneOf2 (elementUnderlyingAsset))+ , ("Asset", fmap TwoOf2 (elementCurveInstrument))+ ])+ schemaTypeToXML s x@InstrumentSet{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (elementToXMLUnderlyingAsset)+ (elementToXMLCurveInstrument)+ ) $ instrSet_choice0 x+ ]+ +-- | A collection of pricing inputs.+data Market = Market+ { market_ID :: Maybe Xsd.ID+ , market_name :: Maybe Xsd.XsdString+ -- ^ The name of the market, e.g. the USDLIBOR market. Used for + -- description and understandability.+ , market_benchmarkQuotes :: Maybe QuotedAssetSet+ -- ^ A collection of benchmark instruments and quotes used as + -- inputs to the pricing models.+ , market_pricingStructure :: [PricingStructure]+ , market_pricingStructureValuation :: [PricingStructureValuation]+ , market_benchmarkPricingMethod :: [PricingMethod]+ -- ^ The pricing structure used to quote a benchmark instrument.+ }+ deriving (Eq,Show)+instance SchemaType Market where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Market a0)+ `apply` optional (parseSchemaType "name")+ `apply` optional (parseSchemaType "benchmarkQuotes")+ `apply` many (elementPricingStructure)+ `apply` many (elementPricingStructureValuation)+ `apply` many (parseSchemaType "benchmarkPricingMethod")+ schemaTypeToXML s x@Market{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ market_ID x+ ]+ [ maybe [] (schemaTypeToXML "name") $ market_name x+ , maybe [] (schemaTypeToXML "benchmarkQuotes") $ market_benchmarkQuotes x+ , concatMap (elementToXMLPricingStructure) $ market_pricingStructure x+ , concatMap (elementToXMLPricingStructureValuation) $ market_pricingStructureValuation x+ , concatMap (schemaTypeToXML "benchmarkPricingMethod") $ market_benchmarkPricingMethod x+ ]+ +-- | Reference to a market structure.+data MarketReference = MarketReference+ { marketRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType MarketReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (MarketReference a0)+ schemaTypeToXML s x@MarketReference{} =+ toXMLElement s [ toXMLAttribute "href" $ marketRef_href x+ ]+ []+instance Extension MarketReference Reference where+ supertype v = Reference_MarketReference v+ +-- | The type of perturbation applied to compute a derivative +-- perturbatively.+data PerturbationType = PerturbationType Scheme PerturbationTypeAttributes deriving (Eq,Show)+data PerturbationTypeAttributes = PerturbationTypeAttributes+ { perturTypeAttrib_perturbationTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType PerturbationType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "perturbationTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ PerturbationType v (PerturbationTypeAttributes a0)+ schemaTypeToXML s (PerturbationType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "perturbationTypeScheme") $ perturTypeAttrib_perturbationTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension PerturbationType Scheme where+ supertype (PerturbationType s _) = s+ +-- | A unique identifier for the position. The id attribute is +-- defined for intradocument referencing.+data PositionId = PositionId Scheme PositionIdAttributes deriving (Eq,Show)+data PositionIdAttributes = PositionIdAttributes+ { positIdAttrib_positionIdScheme :: Maybe Xsd.AnyURI+ , positIdAttrib_ID :: Maybe Xsd.ID+ }+ deriving (Eq,Show)+instance SchemaType PositionId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "positionIdScheme" e pos+ a1 <- optional $ getAttribute "id" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ PositionId v (PositionIdAttributes a0 a1)+ schemaTypeToXML s (PositionId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "positionIdScheme") $ positIdAttrib_positionIdScheme at+ , maybe [] (toXMLAttribute "id") $ positIdAttrib_ID at+ ]+ $ schemaTypeToXML s bt+instance Extension PositionId Scheme where+ supertype (PositionId s _) = s+ +-- | The substitution of a pricing input (e.g. curve) for +-- another, used in generating prices and risks for valuation +-- scenarios.+data PricingInputReplacement = PricingInputReplacement+ { pricingInputReplac_originalInputReference :: Maybe PricingStructureReference+ -- ^ A reference to the original value of the pricing input.+ , pricingInputReplac_replacementInputReference :: Maybe PricingStructureReference+ -- ^ A reference to the substitution to do.+ }+ deriving (Eq,Show)+instance SchemaType PricingInputReplacement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PricingInputReplacement+ `apply` optional (parseSchemaType "originalInputReference")+ `apply` optional (parseSchemaType "replacementInputReference")+ schemaTypeToXML s x@PricingInputReplacement{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "originalInputReference") $ pricingInputReplac_originalInputReference x+ , maybe [] (schemaTypeToXML "replacementInputReference") $ pricingInputReplac_replacementInputReference x+ ]+ +-- | The type of pricing structure represented.+data PricingInputType = PricingInputType Scheme PricingInputTypeAttributes deriving (Eq,Show)+data PricingInputTypeAttributes = PricingInputTypeAttributes+ { pricingInputTypeAttrib_pricingInputTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType PricingInputType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "pricingInputTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ PricingInputType v (PricingInputTypeAttributes a0)+ schemaTypeToXML s (PricingInputType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "pricingInputTypeScheme") $ pricingInputTypeAttrib_pricingInputTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension PricingInputType Scheme where+ supertype (PricingInputType s _) = s+ +-- | A set of index values that identify a pricing data point. +-- For example: (strike = 17%, expiration = 6M, term = 1Y.+data PricingDataPointCoordinate = PricingDataPointCoordinate+ { pricingDataPointCoord_ID :: Maybe Xsd.ID+ , pricingDataPointCoord_choice0 :: (Maybe (OneOf4 TimeDimension TimeDimension Xsd.Decimal GenericDimension))+ -- ^ Choice between:+ -- + -- (1) A time dimension that represents the term of a + -- financial instrument, e.g. of a zero-coupon bond on a + -- curve, or of an underlying caplet or swap for an + -- option.+ -- + -- (2) A time dimension that represents the time to expiration + -- of an option.+ -- + -- (3) A numerical dimension that represents the strike rate + -- or price of an option.+ -- + -- (4) generic+ }+ deriving (Eq,Show)+instance SchemaType PricingDataPointCoordinate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PricingDataPointCoordinate a0)+ `apply` optional (oneOf' [ ("TimeDimension", fmap OneOf4 (parseSchemaType "term"))+ , ("TimeDimension", fmap TwoOf4 (parseSchemaType "expiration"))+ , ("Xsd.Decimal", fmap ThreeOf4 (parseSchemaType "strike"))+ , ("GenericDimension", fmap FourOf4 (parseSchemaType "generic"))+ ])+ schemaTypeToXML s x@PricingDataPointCoordinate{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ pricingDataPointCoord_ID x+ ]+ [ maybe [] (foldOneOf4 (schemaTypeToXML "term")+ (schemaTypeToXML "expiration")+ (schemaTypeToXML "strike")+ (schemaTypeToXML "generic")+ ) $ pricingDataPointCoord_choice0 x+ ]+ +-- | Reference to a Pricing Data Point Coordinate.+data PricingDataPointCoordinateReference = PricingDataPointCoordinateReference+ { pdpcr_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType PricingDataPointCoordinateReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (PricingDataPointCoordinateReference a0)+ schemaTypeToXML s x@PricingDataPointCoordinateReference{} =+ toXMLElement s [ toXMLAttribute "href" $ pdpcr_href x+ ]+ []+instance Extension PricingDataPointCoordinateReference Reference where+ supertype v = Reference_PricingDataPointCoordinateReference v+ +-- | For an asset (e.g. a reference/benchmark asset), the +-- pricing structure used to price it. Used, for example, to +-- specify that the rateIndex "USD-LIBOR-Telerate" with term = +-- 6M is priced using the "USD-LIBOR-Close" curve.+data PricingMethod = PricingMethod+ { pricingMethod_assetReference :: Maybe AnyAssetReference+ -- ^ The asset whose price is required.+ , pricingMethod_pricingInputReference :: Maybe PricingStructureReference+ -- ^ A reference to the pricing input used to value the asset.+ }+ deriving (Eq,Show)+instance SchemaType PricingMethod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PricingMethod+ `apply` optional (parseSchemaType "assetReference")+ `apply` optional (parseSchemaType "pricingInputReference")+ schemaTypeToXML s x@PricingMethod{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "assetReference") $ pricingMethod_assetReference x+ , maybe [] (schemaTypeToXML "pricingInputReference") $ pricingMethod_pricingInputReference x+ ]+ +-- | A definition of the mathematical derivative with respect to +-- a specific pricing parameter.+data PricingParameterDerivative = PricingParameterDerivative+ { pricingParamDeriv_ID :: Maybe Xsd.ID+ , pricingParamDeriv_description :: Maybe Xsd.XsdString+ -- ^ A description, if needed, of how the derivative is + -- computed.+ , pricingParamDeriv_choice1 :: (Maybe (OneOf2 AssetOrTermPointOrPricingStructureReference [ValuationReference]))+ -- ^ Choice between:+ -- + -- (1) A reference to the pricing input parameter to which the + -- sensitivity is computed. If it is omitted, the + -- derivative definition is generic, and applies to any + -- input point in the valuation set.+ -- + -- (2) Reference(s) to the pricing input dates that are + -- shifted when the sensitivity is computed. Depending on + -- the time advance method used, this list could vary. + -- Used for describing time-advance derivatives (theta, + -- carry, etc.)+ , pricingParamDeriv_calculationProcedure :: Maybe DerivativeCalculationProcedure+ -- ^ The method by which a derivative is computed, e.g. + -- analytic, numerical model, perturbation, etc., and the + -- corresponding parameters+ }+ deriving (Eq,Show)+instance SchemaType PricingParameterDerivative where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PricingParameterDerivative a0)+ `apply` optional (parseSchemaType "description")+ `apply` optional (oneOf' [ ("AssetOrTermPointOrPricingStructureReference", fmap OneOf2 (parseSchemaType "parameterReference"))+ , ("[ValuationReference]", fmap TwoOf2 (many1 (parseSchemaType "inputDateReference")))+ ])+ `apply` optional (parseSchemaType "calculationProcedure")+ schemaTypeToXML s x@PricingParameterDerivative{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ pricingParamDeriv_ID x+ ]+ [ maybe [] (schemaTypeToXML "description") $ pricingParamDeriv_description x+ , maybe [] (foldOneOf2 (schemaTypeToXML "parameterReference")+ (concatMap (schemaTypeToXML "inputDateReference"))+ ) $ pricingParamDeriv_choice1 x+ , maybe [] (schemaTypeToXML "calculationProcedure") $ pricingParamDeriv_calculationProcedure x+ ]+ +-- | Reference to a partial derivative.+data PricingParameterDerivativeReference = PricingParameterDerivativeReference+ { ppdr_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType PricingParameterDerivativeReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (PricingParameterDerivativeReference a0)+ schemaTypeToXML s x@PricingParameterDerivativeReference{} =+ toXMLElement s [ toXMLAttribute "href" $ ppdr_href x+ ]+ []+instance Extension PricingParameterDerivativeReference Reference where+ supertype v = Reference_PricingParameterDerivativeReference v+ +-- | A definition of a shift with respect to a specific pricing +-- parameter.+data PricingParameterShift = PricingParameterShift+ { pricingParamShift_ID :: Maybe Xsd.ID+ , pricingParamShift_parameterReference :: Maybe AssetOrTermPointOrPricingStructureReference+ , pricingParamShift_shift :: Maybe Xsd.Decimal+ -- ^ The size of the denominator, e.g. 0.0001 = 1 bp.+ , pricingParamShift_shiftUnits :: Maybe PriceQuoteUnits+ -- ^ The units of the denominator, e.g. currency. If not + -- present, use the units of the PricingInputReference.+ }+ deriving (Eq,Show)+instance SchemaType PricingParameterShift where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PricingParameterShift a0)+ `apply` optional (parseSchemaType "parameterReference")+ `apply` optional (parseSchemaType "shift")+ `apply` optional (parseSchemaType "shiftUnits")+ schemaTypeToXML s x@PricingParameterShift{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ pricingParamShift_ID x+ ]+ [ maybe [] (schemaTypeToXML "parameterReference") $ pricingParamShift_parameterReference x+ , maybe [] (schemaTypeToXML "shift") $ pricingParamShift_shift x+ , maybe [] (schemaTypeToXML "shiftUnits") $ pricingParamShift_shiftUnits x+ ]+ +-- | An abstract pricing structure valuation base type. Used as +-- a base for values of pricing structures such as yield +-- curves and volatility matrices. Derived from the +-- "Valuation" type.+data PricingStructureValuation = PricingStructureValuation+ { pricingStructVal_ID :: Maybe Xsd.ID+ , pricingStructVal_definitionRef :: Maybe Xsd.IDREF+ -- ^ An optional reference to the scenario that this valuation + -- applies to.+ , pricingStructVal_objectReference :: Maybe AnyAssetReference+ -- ^ A reference to the asset or pricing structure that this + -- values.+ , pricingStructVal_valuationScenarioReference :: Maybe ValuationScenarioReference+ -- ^ A reference to the valuation scenario used to calculate + -- this valuation. If the Valuation occurs within a + -- ValuationSet, this value is optional and is defaulted from + -- the ValuationSet. If this value occurs in both places, the + -- lower level value (i.e. the one here) overrides that in the + -- higher (i.e. ValuationSet).+ , pricingStructVal_baseDate :: Maybe IdentifiedDate+ -- ^ The base date for which the structure applies, i.e. the + -- curve date. Normally this will align with the valuation + -- date.+ , pricingStructVal_spotDate :: Maybe IdentifiedDate+ -- ^ The spot settlement date for which the structure applies, + -- normally 0-2 days after the base date. The difference + -- between the baseDate and the spotDate is termed the + -- settlement lag, and is sometimes called "days to spot".+ , pricingStructVal_inputDataDate :: Maybe IdentifiedDate+ -- ^ The date from which the input data used to construct the + -- pricing input was obtained. Often the same as the baseDate, + -- but sometimes the pricing input may be "rolled forward", in + -- which input data from one date is used to generate a curve + -- for a later date.+ , pricingStructVal_endDate :: Maybe IdentifiedDate+ -- ^ The last date for which data is supplied in this pricing + -- input.+ , pricingStructVal_buildDateTime :: Maybe Xsd.DateTime+ -- ^ The date and time when the pricing input was generated.+ }+ deriving (Eq,Show)+instance SchemaType PricingStructureValuation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ a1 <- optional $ getAttribute "definitionRef" e pos+ commit $ interior e $ return (PricingStructureValuation a0 a1)+ `apply` optional (parseSchemaType "objectReference")+ `apply` optional (parseSchemaType "valuationScenarioReference")+ `apply` optional (parseSchemaType "baseDate")+ `apply` optional (parseSchemaType "spotDate")+ `apply` optional (parseSchemaType "inputDataDate")+ `apply` optional (parseSchemaType "endDate")+ `apply` optional (parseSchemaType "buildDateTime")+ schemaTypeToXML s x@PricingStructureValuation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ pricingStructVal_ID x+ , maybe [] (toXMLAttribute "definitionRef") $ pricingStructVal_definitionRef x+ ]+ [ maybe [] (schemaTypeToXML "objectReference") $ pricingStructVal_objectReference x+ , maybe [] (schemaTypeToXML "valuationScenarioReference") $ pricingStructVal_valuationScenarioReference x+ , maybe [] (schemaTypeToXML "baseDate") $ pricingStructVal_baseDate x+ , maybe [] (schemaTypeToXML "spotDate") $ pricingStructVal_spotDate x+ , maybe [] (schemaTypeToXML "inputDataDate") $ pricingStructVal_inputDataDate x+ , maybe [] (schemaTypeToXML "endDate") $ pricingStructVal_endDate x+ , maybe [] (schemaTypeToXML "buildDateTime") $ pricingStructVal_buildDateTime x+ ]+instance Extension PricingStructureValuation Valuation where+ supertype (PricingStructureValuation a0 a1 e0 e1 e2 e3 e4 e5 e6) =+ Valuation a0 a1 e0 e1+ +-- | A collection of quoted assets.+data QuotedAssetSet = QuotedAssetSet+ { quotedAssetSet_instrumentSet :: Maybe InstrumentSet+ -- ^ A collection of instruments used as a basis for quotation.+ , quotedAssetSet_assetQuote :: [BasicAssetValuation]+ -- ^ A collection of valuations (quotes) for the assets needed + -- in the set. Normally these quotes will be for the + -- underlying assets listed above, but they don't necesarily + -- have to be.+ }+ deriving (Eq,Show)+instance SchemaType QuotedAssetSet where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return QuotedAssetSet+ `apply` optional (parseSchemaType "instrumentSet")+ `apply` many (parseSchemaType "assetQuote")+ schemaTypeToXML s x@QuotedAssetSet{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "instrumentSet") $ quotedAssetSet_instrumentSet x+ , concatMap (schemaTypeToXML "assetQuote") $ quotedAssetSet_assetQuote x+ ]+ +-- | A set of characteristics describing a sensitivity.+data SensitivityDefinition = SensitivityDefinition+ { sensitDefin_ID :: Maybe Xsd.ID+ , sensitDefin_name :: Maybe Xsd.XsdString+ -- ^ The name of the derivative, e.g. first derivative, Hessian, + -- etc. Typically not required, but may be used to explain + -- more complex derivative calculations.+ , sensitDefin_valuationScenarioReference :: Maybe ValuationScenarioReference+ -- ^ Reference to the valuation scenario to which this + -- sensitivity definition applies. If the + -- SensitivityDefinition occurs within a + -- SensitivitySetDefinition, this is not required and normally + -- not used. In this case, if it is supplied it overrides the + -- valuationScenarioReference in the SensitivitySetDefinition.+ , sensitDefin_choice2 :: OneOf2 ([PricingParameterDerivative],(Maybe (DerivativeFormula))) (OneOf2 TimeDimension ((Maybe (OneOf2 PricingDataPointCoordinate PricingDataPointCoordinateReference))))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * A partial derivative of the measure with respect to + -- an input.+ -- + -- * A formula defining how to compute the derivative + -- from the partial derivatives. If absent, the + -- derivative is just the product of the partial + -- derivatives. Normally only required for more + -- higher-order derivatives, e.g. Hessians.+ -- + -- (2) unknown+ }+ deriving (Eq,Show)+instance SchemaType SensitivityDefinition where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (SensitivityDefinition a0)+ `apply` optional (parseSchemaType "name")+ `apply` optional (parseSchemaType "valuationScenarioReference")+ `apply` oneOf' [ ("[PricingParameterDerivative] Maybe DerivativeFormula", fmap OneOf2 (return (,) `apply` many (parseSchemaType "partialDerivative")+ `apply` optional (parseSchemaType "formula")))+ , ("OneOf2 TimeDimension ((Maybe (OneOf2 PricingDataPointCoordinate PricingDataPointCoordinateReference)))", fmap TwoOf2 (oneOf' [ ("TimeDimension", fmap OneOf2 (parseSchemaType "term"))+ , ("(Maybe (OneOf2 PricingDataPointCoordinate PricingDataPointCoordinateReference))", fmap TwoOf2 (optional (oneOf' [ ("PricingDataPointCoordinate", fmap OneOf2 (parseSchemaType "coordinate"))+ , ("PricingDataPointCoordinateReference", fmap TwoOf2 (parseSchemaType "coordinateReference"))+ ])))+ ]))+ ]+ schemaTypeToXML s x@SensitivityDefinition{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ sensitDefin_ID x+ ]+ [ maybe [] (schemaTypeToXML "name") $ sensitDefin_name x+ , maybe [] (schemaTypeToXML "valuationScenarioReference") $ sensitDefin_valuationScenarioReference x+ , foldOneOf2 (\ (a,b) -> concat [ concatMap (schemaTypeToXML "partialDerivative") a+ , maybe [] (schemaTypeToXML "formula") b+ ])+ (foldOneOf2 (schemaTypeToXML "term")+ (maybe [] (foldOneOf2 (schemaTypeToXML "coordinate")+ (schemaTypeToXML "coordinateReference")+ ))+ )+ $ sensitDefin_choice2 x+ ]+ +-- | A sensitivity report definition, consisting of a collection +-- of sensitivity definitions.+data SensitivitySetDefinition = SensitivitySetDefinition+ { sensitSetDefin_ID :: Maybe Xsd.ID+ , sensitSetDefin_name :: Maybe Xsd.XsdString+ -- ^ The name of the sensitivity set definition, e.g. "USDLIBOR + -- curve sensitivities".+ , sensitSetDefin_sensitivityCharacteristics :: Maybe QuotationCharacteristics+ -- ^ The default characteristics of the quotation, e.g. type, + -- units, etc.+ , sensitSetDefin_valuationScenarioReference :: Maybe ValuationScenarioReference+ -- ^ Reference to the valuation scenario to which this + -- sensitivity definition applies, e.g. a reference to the EOD + -- valuation scenario. If not supplied, this sensitivity set + -- definition is generic to a variety of valuation scenarios.+ , sensitSetDefin_pricingInputType :: Maybe PricingInputType+ -- ^ The type of the pricing input to which the sensitivity is + -- shown, e.g. a yield curve or volatility matrix.+ , sensitSetDefin_pricingInputReference :: Maybe PricingStructureReference+ -- ^ A reference to the pricing input to which the sensitivity + -- is shown, e.g. a reference to a USDLIBOR yield curve.+ , sensitSetDefin_scale :: Maybe Xsd.Decimal+ -- ^ The size of the denominator, e.g. 0.0001 = 1 bp. For + -- derivatives with respect to time, the default period is 1 + -- day.+ , sensitSetDefin_sensitivityDefinition :: [SensitivityDefinition]+ -- ^ A set of sensitivity definitions. Either one per point + -- reported, or one generic definition that applies to all + -- points.+ , sensitSetDefin_calculationProcedure :: Maybe DerivativeCalculationProcedure+ -- ^ The method by which each derivative is computed, e.g. + -- analytic, numerical model, perturbation, etc., and the + -- corresponding parameters (eg. shift amounts).+ }+ deriving (Eq,Show)+instance SchemaType SensitivitySetDefinition where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (SensitivitySetDefinition a0)+ `apply` optional (parseSchemaType "name")+ `apply` optional (parseSchemaType "sensitivityCharacteristics")+ `apply` optional (parseSchemaType "valuationScenarioReference")+ `apply` optional (parseSchemaType "pricingInputType")+ `apply` optional (parseSchemaType "pricingInputReference")+ `apply` optional (parseSchemaType "scale")+ `apply` many (parseSchemaType "sensitivityDefinition")+ `apply` optional (parseSchemaType "calculationProcedure")+ schemaTypeToXML s x@SensitivitySetDefinition{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ sensitSetDefin_ID x+ ]+ [ maybe [] (schemaTypeToXML "name") $ sensitSetDefin_name x+ , maybe [] (schemaTypeToXML "sensitivityCharacteristics") $ sensitSetDefin_sensitivityCharacteristics x+ , maybe [] (schemaTypeToXML "valuationScenarioReference") $ sensitSetDefin_valuationScenarioReference x+ , maybe [] (schemaTypeToXML "pricingInputType") $ sensitSetDefin_pricingInputType x+ , maybe [] (schemaTypeToXML "pricingInputReference") $ sensitSetDefin_pricingInputReference x+ , maybe [] (schemaTypeToXML "scale") $ sensitSetDefin_scale x+ , concatMap (schemaTypeToXML "sensitivityDefinition") $ sensitSetDefin_sensitivityDefinition x+ , maybe [] (schemaTypeToXML "calculationProcedure") $ sensitSetDefin_calculationProcedure x+ ]+ +-- | A reference to a sensitivity set definition.+data SensitivitySetDefinitionReference = SensitivitySetDefinitionReference+ { sensitSetDefinRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType SensitivitySetDefinitionReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (SensitivitySetDefinitionReference a0)+ schemaTypeToXML s x@SensitivitySetDefinitionReference{} =+ toXMLElement s [ toXMLAttribute "href" $ sensitSetDefinRef_href x+ ]+ []+instance Extension SensitivitySetDefinitionReference Reference where+ supertype v = Reference_SensitivitySetDefinitionReference v+ +-- | The time dimensions of a term-structure. The user must +-- supply either a tenor or a date or both.+data TimeDimension = TimeDimension+ { timeDimens_choice0 :: (Maybe (OneOf1 ((Maybe (Xsd.Date)),(Maybe (Period)))))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The absolute date corresponding to this term point, + -- for example January 3, 2005.+ -- + -- * The amount of time from the base date of the + -- pricing input to the specified term point, e.g. 6M + -- or 5Y.+ }+ deriving (Eq,Show)+instance SchemaType TimeDimension where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return TimeDimension+ `apply` optional (oneOf' [ ("Maybe Xsd.Date Maybe Period", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "date")+ `apply` optional (parseSchemaType "tenor")))+ ])+ schemaTypeToXML s x@TimeDimension{} =+ toXMLElement s []+ [ maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "date") a+ , maybe [] (schemaTypeToXML "tenor") b+ ])+ ) $ timeDimens_choice0 x+ ]+ +-- | A valuation of an valuable object - an asset or a pricing +-- input. This is an abstract type, used as a base for values +-- of pricing structures such as yield curves as well as asset +-- values.+data Valuation = Valuation+ { valuation_ID :: Maybe Xsd.ID+ , valuation_definitionRef :: Maybe Xsd.IDREF+ -- ^ An optional reference to the scenario that this valuation + -- applies to.+ , valuation_objectReference :: Maybe AnyAssetReference+ -- ^ A reference to the asset or pricing structure that this + -- values.+ , valuation_scenarioReference :: Maybe ValuationScenarioReference+ -- ^ A reference to the valuation scenario used to calculate + -- this valuation. If the Valuation occurs within a + -- ValuationSet, this value is optional and is defaulted from + -- the ValuationSet. If this value occurs in both places, the + -- lower level value (i.e. the one here) overrides that in the + -- higher (i.e. ValuationSet).+ }+ deriving (Eq,Show)+instance SchemaType Valuation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ a1 <- optional $ getAttribute "definitionRef" e pos+ commit $ interior e $ return (Valuation a0 a1)+ `apply` optional (parseSchemaType "objectReference")+ `apply` optional (parseSchemaType "valuationScenarioReference")+ schemaTypeToXML s x@Valuation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ valuation_ID x+ , maybe [] (toXMLAttribute "definitionRef") $ valuation_definitionRef x+ ]+ [ maybe [] (schemaTypeToXML "objectReference") $ valuation_objectReference x+ , maybe [] (schemaTypeToXML "valuationScenarioReference") $ valuation_scenarioReference x+ ]+ +-- | Reference to a Valuation or any derived structure such as +-- PricingStructureValuation.+data ValuationReference = ValuationReference+ { valRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType ValuationReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (ValuationReference a0)+ schemaTypeToXML s x@ValuationReference{} =+ toXMLElement s [ toXMLAttribute "href" $ valRef_href x+ ]+ []+instance Extension ValuationReference Reference where+ supertype v = Reference_ValuationReference v+ +-- | A set of rules for generating a valuation.+data ValuationScenario = ValuationScenario+ { valScenar_ID :: Maybe Xsd.ID+ , valScenar_name :: Maybe Xsd.XsdString+ -- ^ The (optional) name for this valuation scenario, used for + -- understandability. For example "EOD Valuations".+ , valScenar_valuationDate :: Maybe IdentifiedDate+ -- ^ The date for which the assets are valued.+ , valScenar_marketReference :: Maybe MarketReference+ -- ^ A reference to the market environment used to price the + -- asset.+ , valScenar_shift :: [PricingParameterShift]+ -- ^ A collection of shifts to be applied to market inputs prior + -- to computation of the derivative.+ , valScenar_replacement :: [PricingInputReplacement]+ -- ^ A collection of shifts to be applied to market inputs prior + -- to computation of the derivative.+ }+ deriving (Eq,Show)+instance SchemaType ValuationScenario where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ValuationScenario a0)+ `apply` optional (parseSchemaType "name")+ `apply` optional (parseSchemaType "valuationDate")+ `apply` optional (parseSchemaType "marketReference")+ `apply` many (parseSchemaType "shift")+ `apply` many (parseSchemaType "replacement")+ schemaTypeToXML s x@ValuationScenario{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ valScenar_ID x+ ]+ [ maybe [] (schemaTypeToXML "name") $ valScenar_name x+ , maybe [] (schemaTypeToXML "valuationDate") $ valScenar_valuationDate x+ , maybe [] (schemaTypeToXML "marketReference") $ valScenar_marketReference x+ , concatMap (schemaTypeToXML "shift") $ valScenar_shift x+ , concatMap (schemaTypeToXML "replacement") $ valScenar_replacement x+ ]+ +-- | Reference to a valuation scenario.+data ValuationScenarioReference = ValuationScenarioReference+ { valScenarRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType ValuationScenarioReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (ValuationScenarioReference a0)+ schemaTypeToXML s x@ValuationScenarioReference{} =+ toXMLElement s [ toXMLAttribute "href" $ valScenarRef_href x+ ]+ []+instance Extension ValuationScenarioReference Reference where+ supertype v = Reference_ValuationScenarioReference v+ +-- | A partial derivative multiplied by a weighting factor.+data WeightedPartialDerivative = WeightedPartialDerivative+ { weightPartialDeriv_partialDerivativeReference :: Maybe PricingParameterDerivativeReference+ -- ^ A reference to a partial derivative defined in the + -- ComputedDerivative.model, i.e. defined as part of this + -- sensitivity definition.+ , weightPartialDeriv_weight :: Maybe Xsd.Decimal+ -- ^ The weight factor to be applied to the partial derivative, + -- e.g. 1 or -1, or some other scaling value.+ }+ deriving (Eq,Show)+instance SchemaType WeightedPartialDerivative where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return WeightedPartialDerivative+ `apply` optional (parseSchemaType "partialDerivativeReference")+ `apply` optional (parseSchemaType "weight")+ schemaTypeToXML s x@WeightedPartialDerivative{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "partialDerivativeReference") $ weightPartialDeriv_partialDerivativeReference x+ , maybe [] (schemaTypeToXML "weight") $ weightPartialDeriv_weight x+ ]+ +-- | This is a global element used for creating global types. It +-- holds Market information, e.g. curves, surfaces, quotes, +-- etc.+elementMarket :: XMLParser Market+elementMarket = parseSchemaType "market"+elementToXMLMarket :: Market -> [Content ()]+elementToXMLMarket = schemaTypeToXML "market"+ +elementPricingStructure :: XMLParser PricingStructure+elementPricingStructure = fmap supertype elementYieldCurve -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementVolatilityRepresentation -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementFxCurve -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementCreditCurve -- FIXME: element is forward-declared+ `onFail` fail "Parse failed when expecting an element in the substitution group for\n\+\ <pricingStructure>,\n\+\ namely one of:\n\+\<yieldCurve>, <volatilityRepresentation>, <fxCurve>, <creditCurve>"+elementToXMLPricingStructure :: PricingStructure -> [Content ()]+elementToXMLPricingStructure = schemaTypeToXML "pricingStructure"+ +elementPricingStructureValuation :: XMLParser PricingStructureValuation+elementPricingStructureValuation = fmap supertype elementYieldCurveValuation -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementVolatilityMatrixValuation -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementFxCurveValuation -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementCreditCurveValuation -- FIXME: element is forward-declared+ `onFail` fail "Parse failed when expecting an element in the substitution group for\n\+\ <pricingStructureValuation>,\n\+\ namely one of:\n\+\<yieldCurveValuation>, <volatilityMatrixValuation>, <fxCurveValuation>, <creditCurveValuation>"+elementToXMLPricingStructureValuation :: PricingStructureValuation -> [Content ()]+elementToXMLPricingStructureValuation = schemaTypeToXML "pricingStructureValuation"+ + + + + + + + + +
+ Data/FpML/V53/Riskdef.hs-boot view
@@ -0,0 +1,287 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Riskdef+ ( module Data.FpML.V53.Riskdef+ , module Data.FpML.V53.Doc+ , module Data.FpML.V53.Asset+-- , module Data.FpML.V53.Mktenv+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Doc+import {-# SOURCE #-} Data.FpML.V53.Asset+--import {-# SOURCE #-} Data.FpML.V53.Mktenv+ +-- | Reference to an underlying asset, term point or pricing +-- structure (yield curve). +data AssetOrTermPointOrPricingStructureReference+instance Eq AssetOrTermPointOrPricingStructureReference+instance Show AssetOrTermPointOrPricingStructureReference+instance SchemaType AssetOrTermPointOrPricingStructureReference+instance Extension AssetOrTermPointOrPricingStructureReference Reference+ +-- | A structure that holds a set of measures about an asset. +data BasicAssetValuation+instance Eq BasicAssetValuation+instance Show BasicAssetValuation+instance SchemaType BasicAssetValuation+instance Extension BasicAssetValuation Valuation+ +-- | The type defining a denominator term of the formula. Its +-- value is (sum of weighted partials) ^ power. +data DenominatorTerm+instance Eq DenominatorTerm+instance Show DenominatorTerm+instance SchemaType DenominatorTerm+ +-- | The method by which a derivative is computed. +data DerivativeCalculationMethod+data DerivativeCalculationMethodAttributes+instance Eq DerivativeCalculationMethod+instance Eq DerivativeCalculationMethodAttributes+instance Show DerivativeCalculationMethod+instance Show DerivativeCalculationMethodAttributes+instance SchemaType DerivativeCalculationMethod+instance Extension DerivativeCalculationMethod Scheme+ +-- | A description of how a numerical derivative is computed. +data DerivativeCalculationProcedure+instance Eq DerivativeCalculationProcedure+instance Show DerivativeCalculationProcedure+instance SchemaType DerivativeCalculationProcedure+ +-- | A formula for computing a complex derivative from partial +-- derivatives. Its value is the sum of the terms divided by +-- the product of the denominator terms. +data DerivativeFormula+instance Eq DerivativeFormula+instance Show DerivativeFormula+instance SchemaType DerivativeFormula+ +-- | A type defining a term of the formula. Its value is the +-- product of the its coefficient and the referenced partial +-- derivatives. +data FormulaTerm+instance Eq FormulaTerm+instance Show FormulaTerm+instance SchemaType FormulaTerm+ +-- | A generic (user defined) dimension, e.g. for use in a +-- correlation surface. e.g. a currency, stock, etc. This +-- would take values like USD, GBP, JPY, or IBM, MSFT, etc. +data GenericDimension+data GenericDimensionAttributes+instance Eq GenericDimension+instance Eq GenericDimensionAttributes+instance Show GenericDimension+instance Show GenericDimensionAttributes+instance SchemaType GenericDimension+instance Extension GenericDimension Xsd.XsdString+ +-- | A collection of instruments usable for quotation purposes. +-- In future releases, quotable derivative assets may be added +-- after the underlying asset. +data InstrumentSet+instance Eq InstrumentSet+instance Show InstrumentSet+instance SchemaType InstrumentSet+ +-- | A collection of pricing inputs. +data Market+instance Eq Market+instance Show Market+instance SchemaType Market+ +-- | Reference to a market structure. +data MarketReference+instance Eq MarketReference+instance Show MarketReference+instance SchemaType MarketReference+instance Extension MarketReference Reference+ +-- | The type of perturbation applied to compute a derivative +-- perturbatively. +data PerturbationType+data PerturbationTypeAttributes+instance Eq PerturbationType+instance Eq PerturbationTypeAttributes+instance Show PerturbationType+instance Show PerturbationTypeAttributes+instance SchemaType PerturbationType+instance Extension PerturbationType Scheme+ +-- | A unique identifier for the position. The id attribute is +-- defined for intradocument referencing. +data PositionId+data PositionIdAttributes+instance Eq PositionId+instance Eq PositionIdAttributes+instance Show PositionId+instance Show PositionIdAttributes+instance SchemaType PositionId+instance Extension PositionId Scheme+ +-- | The substitution of a pricing input (e.g. curve) for +-- another, used in generating prices and risks for valuation +-- scenarios. +data PricingInputReplacement+instance Eq PricingInputReplacement+instance Show PricingInputReplacement+instance SchemaType PricingInputReplacement+ +-- | The type of pricing structure represented. +data PricingInputType+data PricingInputTypeAttributes+instance Eq PricingInputType+instance Eq PricingInputTypeAttributes+instance Show PricingInputType+instance Show PricingInputTypeAttributes+instance SchemaType PricingInputType+instance Extension PricingInputType Scheme+ +-- | A set of index values that identify a pricing data point. +-- For example: (strike = 17%, expiration = 6M, term = 1Y. +data PricingDataPointCoordinate+instance Eq PricingDataPointCoordinate+instance Show PricingDataPointCoordinate+instance SchemaType PricingDataPointCoordinate+ +-- | Reference to a Pricing Data Point Coordinate. +data PricingDataPointCoordinateReference+instance Eq PricingDataPointCoordinateReference+instance Show PricingDataPointCoordinateReference+instance SchemaType PricingDataPointCoordinateReference+instance Extension PricingDataPointCoordinateReference Reference+ +-- | For an asset (e.g. a reference/benchmark asset), the +-- pricing structure used to price it. Used, for example, to +-- specify that the rateIndex "USD-LIBOR-Telerate" with term = +-- 6M is priced using the "USD-LIBOR-Close" curve. +data PricingMethod+instance Eq PricingMethod+instance Show PricingMethod+instance SchemaType PricingMethod+ +-- | A definition of the mathematical derivative with respect to +-- a specific pricing parameter. +data PricingParameterDerivative+instance Eq PricingParameterDerivative+instance Show PricingParameterDerivative+instance SchemaType PricingParameterDerivative+ +-- | Reference to a partial derivative. +data PricingParameterDerivativeReference+instance Eq PricingParameterDerivativeReference+instance Show PricingParameterDerivativeReference+instance SchemaType PricingParameterDerivativeReference+instance Extension PricingParameterDerivativeReference Reference+ +-- | A definition of a shift with respect to a specific pricing +-- parameter. +data PricingParameterShift+instance Eq PricingParameterShift+instance Show PricingParameterShift+instance SchemaType PricingParameterShift+ +-- | An abstract pricing structure valuation base type. Used as +-- a base for values of pricing structures such as yield +-- curves and volatility matrices. Derived from the +-- "Valuation" type. +data PricingStructureValuation+instance Eq PricingStructureValuation+instance Show PricingStructureValuation+instance SchemaType PricingStructureValuation+instance Extension PricingStructureValuation Valuation+ +-- | A collection of quoted assets. +data QuotedAssetSet+instance Eq QuotedAssetSet+instance Show QuotedAssetSet+instance SchemaType QuotedAssetSet+ +-- | A set of characteristics describing a sensitivity. +data SensitivityDefinition+instance Eq SensitivityDefinition+instance Show SensitivityDefinition+instance SchemaType SensitivityDefinition+ +-- | A sensitivity report definition, consisting of a collection +-- of sensitivity definitions. +data SensitivitySetDefinition+instance Eq SensitivitySetDefinition+instance Show SensitivitySetDefinition+instance SchemaType SensitivitySetDefinition+ +-- | A reference to a sensitivity set definition. +data SensitivitySetDefinitionReference+instance Eq SensitivitySetDefinitionReference+instance Show SensitivitySetDefinitionReference+instance SchemaType SensitivitySetDefinitionReference+instance Extension SensitivitySetDefinitionReference Reference+ +-- | The time dimensions of a term-structure. The user must +-- supply either a tenor or a date or both. +data TimeDimension+instance Eq TimeDimension+instance Show TimeDimension+instance SchemaType TimeDimension+ +-- | A valuation of an valuable object - an asset or a pricing +-- input. This is an abstract type, used as a base for values +-- of pricing structures such as yield curves as well as asset +-- values. +data Valuation+instance Eq Valuation+instance Show Valuation+instance SchemaType Valuation+ +-- | Reference to a Valuation or any derived structure such as +-- PricingStructureValuation. +data ValuationReference+instance Eq ValuationReference+instance Show ValuationReference+instance SchemaType ValuationReference+instance Extension ValuationReference Reference+ +-- | A set of rules for generating a valuation. +data ValuationScenario+instance Eq ValuationScenario+instance Show ValuationScenario+instance SchemaType ValuationScenario+ +-- | Reference to a valuation scenario. +data ValuationScenarioReference+instance Eq ValuationScenarioReference+instance Show ValuationScenarioReference+instance SchemaType ValuationScenarioReference+instance Extension ValuationScenarioReference Reference+ +-- | A partial derivative multiplied by a weighting factor. +data WeightedPartialDerivative+instance Eq WeightedPartialDerivative+instance Show WeightedPartialDerivative+instance SchemaType WeightedPartialDerivative+ +-- | This is a global element used for creating global types. It +-- holds Market information, e.g. curves, surfaces, quotes, +-- etc. +elementMarket :: XMLParser Market+elementToXMLMarket :: Market -> [Content ()]+ +elementPricingStructure :: XMLParser PricingStructure+elementToXMLPricingStructure :: PricingStructure -> [Content ()]+ +elementPricingStructureValuation :: XMLParser PricingStructureValuation+elementToXMLPricingStructureValuation :: PricingStructureValuation -> [Content ()]+ + + + + + + + + +
@@ -0,0 +1,7912 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Shared+ ( module Data.FpML.V53.Shared+ , module Data.FpML.V53.Enum+ ) 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.Enum+ +-- Some hs-boot imports are required, for fwd-declaring types.+import {-# SOURCE #-} Data.FpML.V53.FX ( FxEuropeanExercise )+import {-# SOURCE #-} Data.FpML.V53.FX ( FxDigitalAmericanExercise )+import {-# SOURCE #-} Data.FpML.V53.Com ( CommodityPhysicalEuropeanExercise )+import {-# SOURCE #-} Data.FpML.V53.Com ( CommodityPhysicalAmericanExercise )+import {-# SOURCE #-} Data.FpML.V53.Com ( CommodityEuropeanExercise )+import {-# SOURCE #-} Data.FpML.V53.Com ( CommodityAmericanExercise )+import {-# SOURCE #-} Data.FpML.V53.Eqd ( EquityEuropeanExercise )+import {-# SOURCE #-} Data.FpML.V53.IRD ( InterestRateStream )+import {-# SOURCE #-} Data.FpML.V53.FX ( FxSwapLeg )+import {-# SOURCE #-} Data.FpML.V53.Shared.EQ ( DirectionalLeg )+import {-# SOURCE #-} Data.FpML.V53.Com ( CommoditySwapLeg )+import {-# SOURCE #-} Data.FpML.V53.Com ( CommodityForwardLeg )+import {-# SOURCE #-} Data.FpML.V53.CD ( FeeLeg )+import {-# SOURCE #-} Data.FpML.V53.Asset ( PendingPayment )+import {-# SOURCE #-} Data.FpML.V53.Shared.Option ( FeaturePayment )+import {-# SOURCE #-} Data.FpML.V53.IRD ( PaymentCalculationPeriod )+import {-# SOURCE #-} Data.FpML.V53.Shared.EQ ( ReturnSwapAdditionalPayment )+import {-# SOURCE #-} Data.FpML.V53.Shared.EQ ( EquityPremium )+import {-# SOURCE #-} Data.FpML.V53.Doc ( PaymentDetail )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Dividend ( FixedPaymentAmount )+import {-# SOURCE #-} Data.FpML.V53.CD ( SinglePayment )+import {-# SOURCE #-} Data.FpML.V53.CD ( PeriodicPayment )+import {-# SOURCE #-} Data.FpML.V53.CD ( InitialPayment )+import {-# SOURCE #-} Data.FpML.V53.Eqd ( PrePayment )+import {-# SOURCE #-} Data.FpML.V53.Mktenv ( YieldCurve )+import {-# SOURCE #-} Data.FpML.V53.Mktenv ( VolatilityRepresentation )+import {-# SOURCE #-} Data.FpML.V53.Mktenv ( FxCurve )+import {-# SOURCE #-} Data.FpML.V53.Mktenv ( CreditCurve )+import {-# SOURCE #-} Data.FpML.V53.Standard ( StandardProduct )+import {-# SOURCE #-} Data.FpML.V53.Shared.Option ( Option )+import {-# SOURCE #-} Data.FpML.V53.IRD ( Swaption )+import {-# SOURCE #-} Data.FpML.V53.IRD ( Swap )+import {-# SOURCE #-} Data.FpML.V53.IRD ( Fra )+import {-# SOURCE #-} Data.FpML.V53.IRD ( CapFloor )+import {-# SOURCE #-} Data.FpML.V53.IRD ( BulletPayment )+import {-# SOURCE #-} Data.FpML.V53.Generic ( GenericProduct )+import {-# SOURCE #-} Data.FpML.V53.FX ( TermDeposit )+import {-# SOURCE #-} Data.FpML.V53.FX ( FxSwap )+import {-# SOURCE #-} Data.FpML.V53.FX ( FxSingleLeg )+import {-# SOURCE #-} Data.FpML.V53.Shared.EQ ( ReturnSwapBase )+import {-# SOURCE #-} Data.FpML.V53.Shared.EQ ( NettedSwapBase )+import {-# SOURCE #-} Data.FpML.V53.Doc ( Strategy )+import {-# SOURCE #-} Data.FpML.V53.Doc ( InstrumentTradeDetails )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Dividend ( DividendSwapTransactionSupplement )+import {-# SOURCE #-} Data.FpML.V53.Com ( CommoditySwaption )+import {-# SOURCE #-} Data.FpML.V53.Com ( CommoditySwap )+import {-# SOURCE #-} Data.FpML.V53.Com ( CommodityOption )+import {-# SOURCE #-} Data.FpML.V53.Com ( CommodityForward )+import {-# SOURCE #-} Data.FpML.V53.CD ( CreditDefaultSwap )+import {-# SOURCE #-} Data.FpML.V53.Eqd ( EquityDerivativeBase )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Variance ( VarianceSwapTransactionSupplement )+import {-# SOURCE #-} Data.FpML.V53.Asset ( AssetReference )+import {-# SOURCE #-} Data.FpML.V53.Asset ( AnyAssetReference )+import {-# SOURCE #-} Data.FpML.V53.Shared.Option ( CreditEventsReference )+import {-# SOURCE #-} Data.FpML.V53.IRD ( ValuationDatesReference )+import {-# SOURCE #-} Data.FpML.V53.IRD ( ResetDatesReference )+import {-# SOURCE #-} Data.FpML.V53.IRD ( RelevantUnderlyingDateReference )+import {-# SOURCE #-} Data.FpML.V53.IRD ( PaymentDatesReference )+import {-# SOURCE #-} Data.FpML.V53.IRD ( InterestRateStreamReference )+import {-# SOURCE #-} Data.FpML.V53.IRD ( CalculationPeriodDatesReference )+import {-# SOURCE #-} Data.FpML.V53.FX ( MoneyReference )+import {-# SOURCE #-} Data.FpML.V53.Shared.EQ ( InterestLegCalculationPeriodDatesReference )+import {-# SOURCE #-} Data.FpML.V53.Shared.EQ ( FloatingRateCalculationReference )+import {-# SOURCE #-} Data.FpML.V53.Com ( SettlementPeriodsReference )+import {-# SOURCE #-} Data.FpML.V53.Com ( QuantityReference )+import {-# SOURCE #-} Data.FpML.V53.Com ( QuantityScheduleReference )+import {-# SOURCE #-} Data.FpML.V53.Com ( LagReference )+import {-# SOURCE #-} Data.FpML.V53.Com ( CalculationPeriodsScheduleReference )+import {-# SOURCE #-} Data.FpML.V53.Com ( CalculationPeriodsReference )+import {-# SOURCE #-} Data.FpML.V53.Com ( CalculationPeriodsDatesReference )+import {-# SOURCE #-} Data.FpML.V53.CD ( SettlementTermsReference )+import {-# SOURCE #-} Data.FpML.V53.CD ( ProtectionTermsReference )+import {-# SOURCE #-} Data.FpML.V53.CD ( FixedRateReference )+import {-# SOURCE #-} Data.FpML.V53.Riskdef ( ValuationScenarioReference )+import {-# SOURCE #-} Data.FpML.V53.Riskdef ( ValuationReference )+import {-# SOURCE #-} Data.FpML.V53.Riskdef ( SensitivitySetDefinitionReference )+import {-# SOURCE #-} Data.FpML.V53.Riskdef ( PricingParameterDerivativeReference )+import {-# SOURCE #-} Data.FpML.V53.Riskdef ( PricingDataPointCoordinateReference )+import {-# SOURCE #-} Data.FpML.V53.Riskdef ( MarketReference )+import {-# SOURCE #-} Data.FpML.V53.Riskdef ( AssetOrTermPointOrPricingStructureReference )+import {-# SOURCE #-} Data.FpML.V53.Standard ( elementStandardProduct, elementToXMLStandardProduct )+import {-# SOURCE #-} Data.FpML.V53.IRD ( elementSwaption, elementToXMLSwaption )+import {-# SOURCE #-} Data.FpML.V53.IRD ( elementSwap, elementToXMLSwap )+import {-# SOURCE #-} Data.FpML.V53.IRD ( elementFra, elementToXMLFra )+import {-# SOURCE #-} Data.FpML.V53.IRD ( elementCapFloor, elementToXMLCapFloor )+import {-# SOURCE #-} Data.FpML.V53.IRD ( elementBulletPayment, elementToXMLBulletPayment )+import {-# SOURCE #-} Data.FpML.V53.Generic ( elementNonSchemaProduct, elementToXMLNonSchemaProduct )+import {-# SOURCE #-} Data.FpML.V53.Generic ( elementGenericProduct, elementToXMLGenericProduct )+import {-# SOURCE #-} Data.FpML.V53.FX ( elementTermDeposit, elementToXMLTermDeposit )+import {-# SOURCE #-} Data.FpML.V53.FX ( elementFxDigitalOption, elementToXMLFxDigitalOption )+import {-# SOURCE #-} Data.FpML.V53.FX ( elementFxOption, elementToXMLFxOption )+import {-# SOURCE #-} Data.FpML.V53.FX ( elementFxSwap, elementToXMLFxSwap )+import {-# SOURCE #-} Data.FpML.V53.FX ( elementFxSingleLeg, elementToXMLFxSingleLeg )+import {-# SOURCE #-} Data.FpML.V53.Shared.EQ ( elementReturnSwap, elementToXMLReturnSwap )+import {-# SOURCE #-} Data.FpML.V53.Doc ( elementStrategy, elementToXMLStrategy )+import {-# SOURCE #-} Data.FpML.V53.Doc ( elementInstrumentTradeDetails, elementToXMLInstrumentTradeDetails )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Dividend ( elementDividendSwapTransactionSupplement, elementToXMLDividendSwapTransactionSupplement )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Correlation ( elementCorrelationSwap, elementToXMLCorrelationSwap )+import {-# SOURCE #-} Data.FpML.V53.Com ( elementCommoditySwaption, elementToXMLCommoditySwaption )+import {-# SOURCE #-} Data.FpML.V53.Com ( elementCommoditySwap, elementToXMLCommoditySwap )+import {-# SOURCE #-} Data.FpML.V53.Com ( elementCommodityOption, elementToXMLCommodityOption )+import {-# SOURCE #-} Data.FpML.V53.Com ( elementCommodityForward, elementToXMLCommodityForward )+import {-# SOURCE #-} Data.FpML.V53.CD ( elementCreditDefaultSwapOption, elementToXMLCreditDefaultSwapOption )+import {-# SOURCE #-} Data.FpML.V53.CD ( elementCreditDefaultSwap, elementToXMLCreditDefaultSwap )+import {-# SOURCE #-} Data.FpML.V53.Option.Bond ( elementBondOption, elementToXMLBondOption )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Return ( elementEquitySwapTransactionSupplement, elementToXMLEquitySwapTransactionSupplement )+import {-# SOURCE #-} Data.FpML.V53.Eqd ( elementEquityOptionTransactionSupplement, elementToXMLEquityOptionTransactionSupplement )+import {-# SOURCE #-} Data.FpML.V53.Eqd ( elementEquityOption, elementToXMLEquityOption )+import {-# SOURCE #-} Data.FpML.V53.Eqd ( elementEquityForward, elementToXMLEquityForward )+import {-# SOURCE #-} Data.FpML.V53.Eqd ( elementBrokerEquityOption, elementToXMLBrokerEquityOption )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Variance ( elementVarianceSwapTransactionSupplement, elementToXMLVarianceSwapTransactionSupplement )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Variance ( elementVarianceSwap, elementToXMLVarianceSwap )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Variance ( elementVarianceOptionTransactionSupplement, elementToXMLVarianceOptionTransactionSupplement )+ +-- | A type defining a number specified as a decimal between -1 +-- and 1 inclusive.+newtype CorrelationValue = CorrelationValue Xsd.Decimal deriving (Eq,Show)+instance Restricts CorrelationValue Xsd.Decimal where+ restricts (CorrelationValue x) = x+instance SchemaType CorrelationValue where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s (CorrelationValue x) = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType CorrelationValue where+ acceptingParser = fmap CorrelationValue acceptingParser+ -- XXX should enforce the restrictions somehow?+ -- The restrictions are:+ -- (RangeR (Occurs (Just (-1)) (Just 1)))+ simpleTypeText (CorrelationValue x) = simpleTypeText x+ +-- | A type defining a time specified in hh:mm:ss format where +-- the second component must be '00', e.g. 11am would be +-- represented as 11:00:00.+newtype HourMinuteTime = HourMinuteTime Xsd.Time deriving (Eq,Show)+instance Restricts HourMinuteTime Xsd.Time where+ restricts (HourMinuteTime x) = x+instance SchemaType HourMinuteTime where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s (HourMinuteTime x) = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType HourMinuteTime where+ acceptingParser = fmap HourMinuteTime acceptingParser+ -- XXX should enforce the restrictions somehow?+ -- The restrictions are:+ -- (Pattern [0-2][0-9]:[0-5][0-9]:00)+ simpleTypeText (HourMinuteTime x) = simpleTypeText x+ +-- | A type defining a number specified as non negative decimal +-- greater than 0 inclusive.+newtype NonNegativeDecimal = NonNegativeDecimal Xsd.Decimal deriving (Eq,Show)+instance Restricts NonNegativeDecimal Xsd.Decimal where+ restricts (NonNegativeDecimal x) = x+instance SchemaType NonNegativeDecimal where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s (NonNegativeDecimal x) = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType NonNegativeDecimal where+ acceptingParser = fmap NonNegativeDecimal acceptingParser+ -- XXX should enforce the restrictions somehow?+ -- The restrictions are:+ -- (RangeR (Occurs (Just 0) Nothing))+ simpleTypeText (NonNegativeDecimal x) = simpleTypeText x+ +-- | A type defining a number specified as positive decimal +-- greater than 0 exclusive.+newtype PositiveDecimal = PositiveDecimal Xsd.Decimal deriving (Eq,Show)+instance Restricts PositiveDecimal Xsd.Decimal where+ restricts (PositiveDecimal x) = x+instance SchemaType PositiveDecimal where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s (PositiveDecimal x) = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType PositiveDecimal where+ acceptingParser = fmap PositiveDecimal acceptingParser+ -- XXX should enforce the restrictions somehow?+ -- The restrictions are:+ -- (RangeR (Occurs (Just 1) Nothing))+ simpleTypeText (PositiveDecimal x) = simpleTypeText x+ +-- | A type defining a percentage specified as decimal from 0 to +-- 1. A percentage of 5% would be represented as 0.05.+newtype RestrictedPercentage = RestrictedPercentage Xsd.Decimal deriving (Eq,Show)+instance Restricts RestrictedPercentage Xsd.Decimal where+ restricts (RestrictedPercentage x) = x+instance SchemaType RestrictedPercentage where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s (RestrictedPercentage x) = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType RestrictedPercentage where+ acceptingParser = fmap RestrictedPercentage acceptingParser+ -- XXX should enforce the restrictions somehow?+ -- The restrictions are:+ -- (RangeR (Occurs (Just 0) (Just 1)))+ simpleTypeText (RestrictedPercentage x) = simpleTypeText x+ +-- | The base class for all types which define coding schemes.+newtype Scheme = Scheme Xsd.NormalizedString deriving (Eq,Show)+instance Restricts Scheme Xsd.NormalizedString where+ restricts (Scheme x) = x+instance SchemaType Scheme where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s (Scheme x) = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType Scheme where+ acceptingParser = fmap Scheme acceptingParser+ -- XXX should enforce the restrictions somehow?+ -- The restrictions are:+ -- (StrLength (Occurs Nothing (Just 255)))+ simpleTypeText (Scheme x) = simpleTypeText x+ +-- | A type defining a token of length between 1 and 60 +-- characters inclusive.+newtype Token60 = Token60 Xsd.Token deriving (Eq,Show)+instance Restricts Token60 Xsd.Token where+ restricts (Token60 x) = x+instance SchemaType Token60 where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s (Token60 x) = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType Token60 where+ acceptingParser = fmap Token60 acceptingParser+ -- XXX should enforce the restrictions somehow?+ -- The restrictions are:+ -- (StrLength (Occurs (Just 1) (Just 60)))+ simpleTypeText (Token60 x) = simpleTypeText x+ +-- | A generic account that represents any party's account at +-- another party. Parties may be identified by the account at +-- another party.+data Account = Account+ { account_ID :: Xsd.ID+ -- ^ The unique identifier for the account within the document.+ , account_id :: Maybe AccountId+ -- ^ An account identifier. For example an Account number.+ , account_name :: Maybe AccountName+ -- ^ The name by which the account is known.+ , account_beneficiary :: Maybe PartyReference+ -- ^ A reference to the party beneficiary of the account.+ , account_servicingParty :: Maybe PartyReference+ -- ^ A reference to the party that services/supports the + -- account.+ }+ deriving (Eq,Show)+instance SchemaType Account where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "id" e pos+ commit $ interior e $ return (Account a0)+ `apply` optional (parseSchemaType "accountId")+ `apply` optional (parseSchemaType "accountName")+ `apply` optional (parseSchemaType "accountBeneficiary")+ `apply` optional (parseSchemaType "servicingParty")+ schemaTypeToXML s x@Account{} =+ toXMLElement s [ toXMLAttribute "id" $ account_ID x+ ]+ [ maybe [] (schemaTypeToXML "accountId") $ account_id x+ , maybe [] (schemaTypeToXML "accountName") $ account_name x+ , maybe [] (schemaTypeToXML "accountBeneficiary") $ account_beneficiary x+ , maybe [] (schemaTypeToXML "servicingParty") $ account_servicingParty x+ ]+ +-- | The data type used for account identifiers.+data AccountId = AccountId Scheme AccountIdAttributes deriving (Eq,Show)+data AccountIdAttributes = AccountIdAttributes+ { accountIdAttrib_accountIdScheme :: Maybe Xsd.AnyURI+ -- ^ The identifier scheme used with this accountId. A unique + -- URI to determine the authoritative issuer of these + -- identifiers.+ }+ deriving (Eq,Show)+instance SchemaType AccountId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "accountIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ AccountId v (AccountIdAttributes a0)+ schemaTypeToXML s (AccountId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "accountIdScheme") $ accountIdAttrib_accountIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension AccountId Scheme where+ supertype (AccountId s _) = s+ +-- | The data type used for the name of the account.+data AccountName = AccountName Scheme AccountNameAttributes deriving (Eq,Show)+data AccountNameAttributes = AccountNameAttributes+ { accountNameAttrib_accountNameScheme :: Maybe Xsd.AnyURI+ -- ^ The identifier scheme used with this accountName. A unique + -- URI to determine the source of the account name.+ }+ deriving (Eq,Show)+instance SchemaType AccountName where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "accountNameScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ AccountName v (AccountNameAttributes a0)+ schemaTypeToXML s (AccountName bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "accountNameScheme") $ accountNameAttrib_accountNameScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension AccountName Scheme where+ supertype (AccountName s _) = s+ +-- | Reference to an account.+data AccountReference = AccountReference+ { accountRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType AccountReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (AccountReference a0)+ schemaTypeToXML s x@AccountReference{} =+ toXMLElement s [ toXMLAttribute "href" $ accountRef_href x+ ]+ []+instance Extension AccountReference Reference where+ supertype v = Reference_AccountReference v+ +-- | A type that represents a physical postal address.+data Address = Address+ { address_streetAddress :: Maybe StreetAddress+ -- ^ The set of street and building number information that + -- identifies a postal address within a city.+ , address_city :: Maybe Xsd.XsdString+ -- ^ The city component of a postal address.+ , address_state :: Maybe Xsd.XsdString+ -- ^ A country subdivision used in postal addresses in some + -- countries. For example, US states, Canadian provinces, + -- Swiss cantons.+ , address_country :: Maybe CountryCode+ -- ^ The ISO 3166 standard code for the country within which the + -- postal address is located.+ , address_postalCode :: Maybe Xsd.XsdString+ -- ^ The code, required for computerised mail sorting systems, + -- that is allocated to a physical address by a national + -- postal authority.+ }+ deriving (Eq,Show)+instance SchemaType Address where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Address+ `apply` optional (parseSchemaType "streetAddress")+ `apply` optional (parseSchemaType "city")+ `apply` optional (parseSchemaType "state")+ `apply` optional (parseSchemaType "country")+ `apply` optional (parseSchemaType "postalCode")+ schemaTypeToXML s x@Address{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "streetAddress") $ address_streetAddress x+ , maybe [] (schemaTypeToXML "city") $ address_city x+ , maybe [] (schemaTypeToXML "state") $ address_state x+ , maybe [] (schemaTypeToXML "country") $ address_country x+ , maybe [] (schemaTypeToXML "postalCode") $ address_postalCode x+ ]+ +-- | A type that represents information about a unit within an +-- organization.+data BusinessUnit = BusinessUnit+ { businessUnit_ID :: Maybe Xsd.ID+ , businessUnit_name :: Maybe Xsd.XsdString+ -- ^ A name used to describe the organization unit+ , businessUnit_id :: Maybe Unit+ -- ^ An identifier used to uniquely identify organization unit+ , businessUnit_contactInfo :: Maybe ContactInformation+ -- ^ Information on how to contact the unit using various means.+ , businessUnit_country :: Maybe CountryCode+ -- ^ The ISO 3166 standard code for the country where the + -- individual works.+ }+ deriving (Eq,Show)+instance SchemaType BusinessUnit where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (BusinessUnit a0)+ `apply` optional (parseSchemaType "name")+ `apply` optional (parseSchemaType "businessUnitId")+ `apply` optional (parseSchemaType "contactInfo")+ `apply` optional (parseSchemaType "country")+ schemaTypeToXML s x@BusinessUnit{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ businessUnit_ID x+ ]+ [ maybe [] (schemaTypeToXML "name") $ businessUnit_name x+ , maybe [] (schemaTypeToXML "businessUnitId") $ businessUnit_id x+ , maybe [] (schemaTypeToXML "contactInfo") $ businessUnit_contactInfo x+ , maybe [] (schemaTypeToXML "country") $ businessUnit_country x+ ]+ +-- | A type that represents information about a person connected +-- with a trade or business process.+data Person = Person+ { person_ID :: Maybe Xsd.ID+ , person_honorific :: Maybe Xsd.NormalizedString+ -- ^ An honorific title, such as Mr., Ms., Dr. etc.+ , person_firstName :: Maybe Xsd.NormalizedString+ -- ^ Given name, such as John or Mary.+ , person_choice2 :: (Maybe (OneOf2 [Xsd.NormalizedString] [Initial]))+ -- ^ Choice between:+ -- + -- (1) middleName+ -- + -- (2) initial+ , person_surname :: Maybe Xsd.NormalizedString+ -- ^ Family name, such as Smith or Jones.+ , person_suffix :: Maybe Xsd.NormalizedString+ -- ^ Name suffix, such as Jr., III, etc.+ , person_id :: [PersonId]+ -- ^ An identifier assigned by a system for uniquely identifying + -- the individual+ , person_businessUnitReference :: Maybe BusinessUnitReference+ -- ^ The unit for which the indvidual works.+ , person_contactInfo :: Maybe ContactInformation+ -- ^ Information on how to contact the individual using various + -- means.+ , person_country :: Maybe CountryCode+ -- ^ The ISO 3166 standard code for the country where the + -- individual works.+ }+ deriving (Eq,Show)+instance SchemaType Person where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Person a0)+ `apply` optional (parseSchemaType "honorific")+ `apply` optional (parseSchemaType "firstName")+ `apply` optional (oneOf' [ ("[Xsd.NormalizedString]", fmap OneOf2 (many1 (parseSchemaType "middleName")))+ , ("[Initial]", fmap TwoOf2 (many1 (parseSchemaType "initial")))+ ])+ `apply` optional (parseSchemaType "surname")+ `apply` optional (parseSchemaType "suffix")+ `apply` many (parseSchemaType "personId")+ `apply` optional (parseSchemaType "businessUnitReference")+ `apply` optional (parseSchemaType "contactInfo")+ `apply` optional (parseSchemaType "country")+ schemaTypeToXML s x@Person{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ person_ID x+ ]+ [ maybe [] (schemaTypeToXML "honorific") $ person_honorific x+ , maybe [] (schemaTypeToXML "firstName") $ person_firstName x+ , maybe [] (foldOneOf2 (concatMap (schemaTypeToXML "middleName"))+ (concatMap (schemaTypeToXML "initial"))+ ) $ person_choice2 x+ , maybe [] (schemaTypeToXML "surname") $ person_surname x+ , maybe [] (schemaTypeToXML "suffix") $ person_suffix x+ , concatMap (schemaTypeToXML "personId") $ person_id x+ , maybe [] (schemaTypeToXML "businessUnitReference") $ person_businessUnitReference x+ , maybe [] (schemaTypeToXML "contactInfo") $ person_contactInfo x+ , maybe [] (schemaTypeToXML "country") $ person_country x+ ]+ +newtype Initial = Initial Xsd.NormalizedString deriving (Eq,Show)+instance Restricts Initial Xsd.NormalizedString where+ restricts (Initial x) = x+instance SchemaType Initial where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s (Initial x) = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType Initial where+ acceptingParser = fmap Initial acceptingParser+ -- XXX should enforce the restrictions somehow?+ -- The restrictions are:+ -- (StrLength (Occurs (Just 1) (Just 1)))+ simpleTypeText (Initial x) = simpleTypeText x+ +-- | An identifier used to identify an individual person.+data PersonId = PersonId Scheme PersonIdAttributes deriving (Eq,Show)+data PersonIdAttributes = PersonIdAttributes+ { personIdAttrib_personIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType PersonId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "personIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ PersonId v (PersonIdAttributes a0)+ schemaTypeToXML s (PersonId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "personIdScheme") $ personIdAttrib_personIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension PersonId Scheme where+ supertype (PersonId s _) = s+ +-- | A type used to record information about a unit, +-- subdivision, desk, or other similar business entity.+data Unit = Unit Scheme UnitAttributes deriving (Eq,Show)+data UnitAttributes = UnitAttributes+ { unitAttrib_unitScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType Unit where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "unitScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ Unit v (UnitAttributes a0)+ schemaTypeToXML s (Unit bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "unitScheme") $ unitAttrib_unitScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension Unit Scheme where+ supertype (Unit s _) = s+ +-- | A type that represents how to contact an individual or +-- organization.+data ContactInformation = ContactInformation+ { contactInfo_telephone :: [TelephoneNumber]+ -- ^ A telephonic contact.+ , contactInfo_email :: [Xsd.NormalizedString]+ -- ^ An address on an electronic mail or messaging sysem .+ , contactInfo_address :: Maybe Address+ -- ^ A postal or street address.+ }+ deriving (Eq,Show)+instance SchemaType ContactInformation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ContactInformation+ `apply` many (parseSchemaType "telephone")+ `apply` many (parseSchemaType "email")+ `apply` optional (parseSchemaType "address")+ schemaTypeToXML s x@ContactInformation{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "telephone") $ contactInfo_telephone x+ , concatMap (schemaTypeToXML "email") $ contactInfo_email x+ , maybe [] (schemaTypeToXML "address") $ contactInfo_address x+ ]+ +-- | A type that represents a telephonic contact.+data TelephoneNumber = TelephoneNumber+ { telephNumber_type :: Maybe TelephoneTypeEnum+ -- ^ The type of telephone number (work, personal, mobile).+ , telephNumber_number :: Maybe Xsd.XsdString+ -- ^ A telephonic contact.+ }+ deriving (Eq,Show)+instance SchemaType TelephoneNumber where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return TelephoneNumber+ `apply` optional (parseSchemaType "type")+ `apply` optional (parseSchemaType "number")+ schemaTypeToXML s x@TelephoneNumber{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "type") $ telephNumber_type x+ , maybe [] (schemaTypeToXML "number") $ telephNumber_number x+ ]+ +-- | A type for defining a date that shall be subject to +-- adjustment if it would otherwise fall on a day that is not +-- a business day in the specified business centers, together +-- with the convention for adjusting the date.+data AdjustableDate = AdjustableDate+ { adjustDate_ID :: Maybe Xsd.ID+ , adjustDate_unadjustedDate :: IdentifiedDate+ -- ^ A date subject to adjustment.+ , adjustDate_dateAdjustments :: Maybe BusinessDayAdjustments+ -- ^ The business day convention and financial business centers + -- used for adjusting the date if it would otherwise fall on a + -- day that is not a business date in the specified business + -- centers.+ , adjustDate_adjustedDate :: Maybe IdentifiedDate+ -- ^ The date once the adjustment has been performed. (Note that + -- this date may change if the business center holidays + -- change).+ }+ deriving (Eq,Show)+instance SchemaType AdjustableDate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (AdjustableDate a0)+ `apply` parseSchemaType "unadjustedDate"+ `apply` optional (parseSchemaType "dateAdjustments")+ `apply` optional (parseSchemaType "adjustedDate")+ schemaTypeToXML s x@AdjustableDate{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ adjustDate_ID x+ ]+ [ schemaTypeToXML "unadjustedDate" $ adjustDate_unadjustedDate x+ , maybe [] (schemaTypeToXML "dateAdjustments") $ adjustDate_dateAdjustments x+ , maybe [] (schemaTypeToXML "adjustedDate") $ adjustDate_adjustedDate x+ ]+ +-- | A type that is different from AdjustableDate in two +-- regards. First, date adjustments can be specified with +-- either a dateAdjustments element or a reference to an +-- existing dateAdjustments element. Second, it does not +-- require the specification of date adjustments.+data AdjustableDate2 = AdjustableDate2+ { adjustDate2_ID :: Maybe Xsd.ID+ , adjustDate2_unadjustedDate :: IdentifiedDate+ -- ^ A date subject to adjustment.+ , adjustDate2_choice1 :: (Maybe (OneOf2 BusinessDayAdjustments BusinessDayAdjustmentsReference))+ -- ^ Choice between:+ -- + -- (1) The business day convention and financial business + -- centers used for adjusting the date if it would + -- otherwise fall on a day that is not a business dat in + -- the specified business centers.+ -- + -- (2) A pointer style reference to date adjustments defined + -- elsewhere in the document.+ , adjustDate2_adjustedDate :: Maybe IdentifiedDate+ -- ^ The date once the adjustment has been performed. (Note that + -- this date may change if the business center holidays + -- change).+ }+ deriving (Eq,Show)+instance SchemaType AdjustableDate2 where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (AdjustableDate2 a0)+ `apply` parseSchemaType "unadjustedDate"+ `apply` optional (oneOf' [ ("BusinessDayAdjustments", fmap OneOf2 (parseSchemaType "dateAdjustments"))+ , ("BusinessDayAdjustmentsReference", fmap TwoOf2 (parseSchemaType "dateAdjustmentsReference"))+ ])+ `apply` optional (parseSchemaType "adjustedDate")+ schemaTypeToXML s x@AdjustableDate2{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ adjustDate2_ID x+ ]+ [ schemaTypeToXML "unadjustedDate" $ adjustDate2_unadjustedDate x+ , maybe [] (foldOneOf2 (schemaTypeToXML "dateAdjustments")+ (schemaTypeToXML "dateAdjustmentsReference")+ ) $ adjustDate2_choice1 x+ , maybe [] (schemaTypeToXML "adjustedDate") $ adjustDate2_adjustedDate x+ ]+ +-- | A type for defining a series of dates that shall be subject +-- to adjustment if they would otherwise fall on a day that is +-- not a business day in the specified business centers, +-- together with the convention for adjusting the dates.+data AdjustableDates = AdjustableDates+ { adjustDates_ID :: Maybe Xsd.ID+ , adjustDates_unadjustedDate :: [IdentifiedDate]+ -- ^ A date subject to adjustment.+ , adjustDates_dateAdjustments :: Maybe BusinessDayAdjustments+ -- ^ The business day convention and financial business centers + -- used for adjusting the date if it would otherwise fall on a + -- day that is not a business dat in the specified business + -- centers.+ , adjustDates_adjustedDate :: [IdentifiedDate]+ -- ^ The date once the adjustment has been performed. (Note that + -- this date may change if the business center holidays + -- change).+ }+ deriving (Eq,Show)+instance SchemaType AdjustableDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (AdjustableDates a0)+ `apply` many (parseSchemaType "unadjustedDate")+ `apply` optional (parseSchemaType "dateAdjustments")+ `apply` many (parseSchemaType "adjustedDate")+ schemaTypeToXML s x@AdjustableDates{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ adjustDates_ID x+ ]+ [ concatMap (schemaTypeToXML "unadjustedDate") $ adjustDates_unadjustedDate x+ , maybe [] (schemaTypeToXML "dateAdjustments") $ adjustDates_dateAdjustments x+ , concatMap (schemaTypeToXML "adjustedDate") $ adjustDates_adjustedDate x+ ]+ +-- | A type for defining a series of dates, either as a list of +-- adjustable dates, or a as a repeating sequence from a base +-- date+data AdjustableDatesOrRelativeDateOffset = AdjustableDatesOrRelativeDateOffset+ { adordo_choice0 :: (Maybe (OneOf2 AdjustableDates RelativeDateOffset))+ -- ^ Choice between:+ -- + -- (1) A series of adjustable dates+ -- + -- (2) A series of dates specified as a repeating sequence + -- from a base date.+ }+ deriving (Eq,Show)+instance SchemaType AdjustableDatesOrRelativeDateOffset where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return AdjustableDatesOrRelativeDateOffset+ `apply` optional (oneOf' [ ("AdjustableDates", fmap OneOf2 (parseSchemaType "adjustableDates"))+ , ("RelativeDateOffset", fmap TwoOf2 (parseSchemaType "relativeDate"))+ ])+ schemaTypeToXML s x@AdjustableDatesOrRelativeDateOffset{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "adjustableDates")+ (schemaTypeToXML "relativeDate")+ ) $ adordo_choice0 x+ ]+ +-- | A type for defining a date that shall be subject to +-- adjustment if it would otherwise fall on a day that is not +-- a business day in the specified business centers, together +-- with the convention for adjusting the date.+data AdjustableOrAdjustedDate = AdjustableOrAdjustedDate+ { adjustOrAdjustDate_ID :: Maybe Xsd.ID+ , adjustOrAdjustDate_choice0 :: OneOf2 (IdentifiedDate,(Maybe (BusinessDayAdjustments)),(Maybe (IdentifiedDate))) IdentifiedDate+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * A date subject to adjustment.+ -- + -- * The business day convention and financial business + -- centers used for adjusting the date if it would + -- otherwise fall on a day that is not a business date + -- in the specified business centers.+ -- + -- * The date once the adjustment has been performed. + -- (Note that this date may change if the business + -- center holidays change).+ -- + -- (2) The date once the adjustment has been performed. (Note + -- that this date may change if the business center + -- holidays change).+ }+ deriving (Eq,Show)+instance SchemaType AdjustableOrAdjustedDate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (AdjustableOrAdjustedDate a0)+ `apply` oneOf' [ ("IdentifiedDate Maybe BusinessDayAdjustments Maybe IdentifiedDate", fmap OneOf2 (return (,,) `apply` parseSchemaType "unadjustedDate"+ `apply` optional (parseSchemaType "dateAdjustments")+ `apply` optional (parseSchemaType "adjustedDate")))+ , ("IdentifiedDate", fmap TwoOf2 (parseSchemaType "adjustedDate"))+ ]+ schemaTypeToXML s x@AdjustableOrAdjustedDate{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ adjustOrAdjustDate_ID x+ ]+ [ foldOneOf2 (\ (a,b,c) -> concat [ schemaTypeToXML "unadjustedDate" a+ , maybe [] (schemaTypeToXML "dateAdjustments") b+ , maybe [] (schemaTypeToXML "adjustedDate") c+ ])+ (schemaTypeToXML "adjustedDate")+ $ adjustOrAdjustDate_choice0 x+ ]+ +-- | A type giving the choice between defining a date as an +-- explicit date together with applicable adjustments or as +-- relative to some other (anchor) date.+data AdjustableOrRelativeDate = AdjustableOrRelativeDate+ { adjustOrRelatDate_ID :: Maybe Xsd.ID+ , adjustOrRelatDate_choice0 :: (Maybe (OneOf2 AdjustableDate RelativeDateOffset))+ -- ^ Choice between:+ -- + -- (1) A date that shall be subject to adjustment if it would + -- otherwise fall on a day that is not a business day in + -- the specified business centers, together with the + -- convention for adjusting the date.+ -- + -- (2) A date specified as some offset to another date (the + -- anchor date).+ }+ deriving (Eq,Show)+instance SchemaType AdjustableOrRelativeDate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (AdjustableOrRelativeDate a0)+ `apply` optional (oneOf' [ ("AdjustableDate", fmap OneOf2 (parseSchemaType "adjustableDate"))+ , ("RelativeDateOffset", fmap TwoOf2 (parseSchemaType "relativeDate"))+ ])+ schemaTypeToXML s x@AdjustableOrRelativeDate{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ adjustOrRelatDate_ID x+ ]+ [ maybe [] (foldOneOf2 (schemaTypeToXML "adjustableDate")+ (schemaTypeToXML "relativeDate")+ ) $ adjustOrRelatDate_choice0 x+ ]+ +-- | A type giving the choice between defining a series of dates +-- as an explicit list of dates together with applicable +-- adjustments or as relative to some other series of (anchor) +-- dates.+data AdjustableOrRelativeDates = AdjustableOrRelativeDates+ { adjustOrRelatDates_ID :: Maybe Xsd.ID+ , adjustOrRelatDates_choice0 :: (Maybe (OneOf2 AdjustableDates RelativeDates))+ -- ^ Choice between:+ -- + -- (1) A series of dates that shall be subject to adjustment + -- if they would otherwise fall on a day that is not a + -- business day in the specified business centers, + -- together with the convention for adjusting the date.+ -- + -- (2) A series of dates specified as some offset to another + -- series of dates (the anchor dates).+ }+ deriving (Eq,Show)+instance SchemaType AdjustableOrRelativeDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (AdjustableOrRelativeDates a0)+ `apply` optional (oneOf' [ ("AdjustableDates", fmap OneOf2 (parseSchemaType "adjustableDates"))+ , ("RelativeDates", fmap TwoOf2 (parseSchemaType "relativeDates"))+ ])+ schemaTypeToXML s x@AdjustableOrRelativeDates{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ adjustOrRelatDates_ID x+ ]+ [ maybe [] (foldOneOf2 (schemaTypeToXML "adjustableDates")+ (schemaTypeToXML "relativeDates")+ ) $ adjustOrRelatDates_choice0 x+ ]+ +data AdjustableRelativeOrPeriodicDates = AdjustableRelativeOrPeriodicDates+ { adjustRelatOrPeriodDates_ID :: Maybe Xsd.ID+ , adjustRelatOrPeriodDates_choice0 :: (Maybe (OneOf3 AdjustableDates RelativeDateSequence PeriodicDates))+ -- ^ Choice between:+ -- + -- (1) A series of dates that shall be subject to adjustment + -- if they would otherwise fall on a day that is not a + -- business day in the specified business centers, + -- together with the convention for adjusting the date.+ -- + -- (2) A series of dates specified as some offset to other + -- dates (the anchor dates) which can+ -- + -- (3) periodicDates+ }+ deriving (Eq,Show)+instance SchemaType AdjustableRelativeOrPeriodicDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (AdjustableRelativeOrPeriodicDates a0)+ `apply` optional (oneOf' [ ("AdjustableDates", fmap OneOf3 (parseSchemaType "adjustableDates"))+ , ("RelativeDateSequence", fmap TwoOf3 (parseSchemaType "relativeDateSequence"))+ , ("PeriodicDates", fmap ThreeOf3 (parseSchemaType "periodicDates"))+ ])+ schemaTypeToXML s x@AdjustableRelativeOrPeriodicDates{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ adjustRelatOrPeriodDates_ID x+ ]+ [ maybe [] (foldOneOf3 (schemaTypeToXML "adjustableDates")+ (schemaTypeToXML "relativeDateSequence")+ (schemaTypeToXML "periodicDates")+ ) $ adjustRelatOrPeriodDates_choice0 x+ ]+ +-- | A type giving the choice between defining a series of dates +-- as an explicit list of dates together with applicable +-- adjustments, or as relative to some other series of +-- (anchor) dates, or as a set of factors to specify periodic +-- occurences.+data AdjustableRelativeOrPeriodicDates2 = AdjustableRelativeOrPeriodicDates2+ { adjustRelatOrPeriodDates2_ID :: Maybe Xsd.ID+ , adjustRelatOrPeriodDates2_choice0 :: (Maybe (OneOf3 AdjustableDates RelativeDates PeriodicDates))+ -- ^ Choice between:+ -- + -- (1) A series of dates that shall be subject to adjustment + -- if they would otherwise fall on a day that is not a + -- business day in the specified business centers, + -- together with the convention for adjusting the date.+ -- + -- (2) A series of dates specified as some offset to another + -- series of dates (the anchor dates).+ -- + -- (3) periodicDates+ }+ deriving (Eq,Show)+instance SchemaType AdjustableRelativeOrPeriodicDates2 where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (AdjustableRelativeOrPeriodicDates2 a0)+ `apply` optional (oneOf' [ ("AdjustableDates", fmap OneOf3 (parseSchemaType "adjustableDates"))+ , ("RelativeDates", fmap TwoOf3 (parseSchemaType "relativeDates"))+ , ("PeriodicDates", fmap ThreeOf3 (parseSchemaType "periodicDates"))+ ])+ schemaTypeToXML s x@AdjustableRelativeOrPeriodicDates2{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ adjustRelatOrPeriodDates2_ID x+ ]+ [ maybe [] (foldOneOf3 (schemaTypeToXML "adjustableDates")+ (schemaTypeToXML "relativeDates")+ (schemaTypeToXML "periodicDates")+ ) $ adjustRelatOrPeriodDates2_choice0 x+ ]+ +-- | A type defining a date (referred to as the derived date) as +-- a relative offset from another date (referred to as the +-- anchor date) plus optional date adjustments.+data AdjustedRelativeDateOffset = AdjustedRelativeDateOffset+ { adjustRelatDateOffset_ID :: Maybe Xsd.ID+ , adjustRelatDateOffset_periodMultiplier :: Xsd.Integer+ -- ^ A time period multiplier, e.g. 1, 2 or 3 etc. A negative + -- value can be used when specifying an offset relative to + -- another date, e.g. -2 days.+ , adjustRelatDateOffset_period :: PeriodEnum+ -- ^ A time period, e.g. a day, week, month or year of the + -- stream. If the periodMultiplier value is 0 (zero) then + -- period must contain the value D (day).+ , adjustRelatDateOffset_dayType :: Maybe DayTypeEnum+ -- ^ In the case of an offset specified as a number of days, + -- this element defines whether consideration is given as to + -- whether a day is a good business day or not. If a day type + -- of business days is specified then non-business days are + -- ignored when calculating the offset. The financial business + -- centers to use for determination of business days are + -- implied by the context in which this element is used. This + -- element must only be included when the offset is specified + -- as a number of days. If the offset is zero days then the + -- dayType element should not be included.+ , adjustRelatDateOffset_businessDayConvention :: Maybe BusinessDayConventionEnum+ -- ^ The convention for adjusting a date if it would otherwise + -- fall on a day that is not a business day.+ , adjustRelatDateOffset_choice4 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to a set of financial + -- business centers defined elsewhere in the document. + -- This set of business centers is used to determine + -- whether a particular day is a business day or not.+ -- + -- (2) businessCenters+ , adjustRelatDateOffset_dateRelativeTo :: Maybe DateReference+ -- ^ Specifies the anchor as an href attribute. The href + -- attribute value is a pointer style reference to the element + -- or component elsewhere in the document where the anchor + -- date is defined.+ , adjustRelatDateOffset_adjustedDate :: Maybe IdentifiedDate+ -- ^ The date once the adjustment has been performed. (Note that + -- this date may change if the business center holidays + -- change).+ , adjustRelatDateOffset_relativeDateAdjustments :: Maybe BusinessDayAdjustments+ -- ^ The business day convention and financial business centers + -- used for adjusting the relative date if it would otherwise + -- fall on a day that is not a business date in the specified + -- business centers.+ }+ deriving (Eq,Show)+instance SchemaType AdjustedRelativeDateOffset where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (AdjustedRelativeDateOffset a0)+ `apply` parseSchemaType "periodMultiplier"+ `apply` parseSchemaType "period"+ `apply` optional (parseSchemaType "dayType")+ `apply` optional (parseSchemaType "businessDayConvention")+ `apply` optional (oneOf' [ ("BusinessCentersReference", fmap OneOf2 (parseSchemaType "businessCentersReference"))+ , ("BusinessCenters", fmap TwoOf2 (parseSchemaType "businessCenters"))+ ])+ `apply` optional (parseSchemaType "dateRelativeTo")+ `apply` optional (parseSchemaType "adjustedDate")+ `apply` optional (parseSchemaType "relativeDateAdjustments")+ schemaTypeToXML s x@AdjustedRelativeDateOffset{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ adjustRelatDateOffset_ID x+ ]+ [ schemaTypeToXML "periodMultiplier" $ adjustRelatDateOffset_periodMultiplier x+ , schemaTypeToXML "period" $ adjustRelatDateOffset_period x+ , maybe [] (schemaTypeToXML "dayType") $ adjustRelatDateOffset_dayType x+ , maybe [] (schemaTypeToXML "businessDayConvention") $ adjustRelatDateOffset_businessDayConvention x+ , maybe [] (foldOneOf2 (schemaTypeToXML "businessCentersReference")+ (schemaTypeToXML "businessCenters")+ ) $ adjustRelatDateOffset_choice4 x+ , maybe [] (schemaTypeToXML "dateRelativeTo") $ adjustRelatDateOffset_dateRelativeTo x+ , maybe [] (schemaTypeToXML "adjustedDate") $ adjustRelatDateOffset_adjustedDate x+ , maybe [] (schemaTypeToXML "relativeDateAdjustments") $ adjustRelatDateOffset_relativeDateAdjustments x+ ]+instance Extension AdjustedRelativeDateOffset RelativeDateOffset where+ supertype (AdjustedRelativeDateOffset a0 e0 e1 e2 e3 e4 e5 e6 e7) =+ RelativeDateOffset a0 e0 e1 e2 e3 e4 e5 e6+instance Extension AdjustedRelativeDateOffset Offset where+ supertype = (supertype :: RelativeDateOffset -> Offset)+ . (supertype :: AdjustedRelativeDateOffset -> RelativeDateOffset)+ +instance Extension AdjustedRelativeDateOffset Period where+ supertype = (supertype :: Offset -> Period)+ . (supertype :: RelativeDateOffset -> Offset)+ . (supertype :: AdjustedRelativeDateOffset -> RelativeDateOffset)+ + +data AgreementType = AgreementType Scheme AgreementTypeAttributes deriving (Eq,Show)+data AgreementTypeAttributes = AgreementTypeAttributes+ { agreemTypeAttrib_agreementTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType AgreementType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "agreementTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ AgreementType v (AgreementTypeAttributes a0)+ schemaTypeToXML s (AgreementType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "agreementTypeScheme") $ agreemTypeAttrib_agreementTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension AgreementType Scheme where+ supertype (AgreementType s _) = s+ +data AgreementVersion = AgreementVersion Scheme AgreementVersionAttributes deriving (Eq,Show)+data AgreementVersionAttributes = AgreementVersionAttributes+ { agreemVersionAttrib_agreementVersionScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType AgreementVersion where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "agreementVersionScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ AgreementVersion v (AgreementVersionAttributes a0)+ schemaTypeToXML s (AgreementVersion bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "agreementVersionScheme") $ agreemVersionAttrib_agreementVersionScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension AgreementVersion Scheme where+ supertype (AgreementVersion s _) = s+ +-- | A type defining the exercise period for an American style +-- option together with any rules governing the notional +-- amount of the underlying which can be exercised on any +-- given exercise date and any associated exercise fees.+data AmericanExercise = AmericanExercise+ { americExerc_ID :: Maybe Xsd.ID+ , americExerc_commencementDate :: Maybe AdjustableOrRelativeDate+ -- ^ The first day of the exercise period for an American style + -- option.+ , americExerc_expirationDate :: Maybe AdjustableOrRelativeDate+ -- ^ The last day within an exercise period for an American + -- style option. For a European style option it is the only + -- day within the exercise period.+ , americExerc_relevantUnderlyingDate :: Maybe AdjustableOrRelativeDates+ -- ^ The date on the underlying set by the exercise of an + -- option. What this date is depends on the option (e.g. in a + -- swaption it is the swap effective date, in an + -- extendible/cancelable provision it is the swap termination + -- date).+ , americExerc_earliestExerciseTime :: Maybe BusinessCenterTime+ -- ^ The earliest time at which notice of exercise can be given + -- by the buyer to the seller (or seller's agent) i) on the + -- expriation date, in the case of a European style option, + -- (ii) on each bermuda option exercise date and the + -- expiration date, in the case of a Bermuda style option the + -- commencement date to, and including, the expiration date , + -- in the case of an American option.+ , americExerc_latestExerciseTime :: Maybe BusinessCenterTime+ -- ^ For a Bermuda or American style option, the latest time on + -- an exercise business day (excluding the expiration date) + -- within the exercise period that notice can be given by the + -- buyer to the seller or seller's agent. Notice of exercise + -- given after this time will be deemed to have been given on + -- the next exercise business day.+ , americExerc_expirationTime :: Maybe BusinessCenterTime+ -- ^ The latest time for exercise on expirationDate.+ , americExerc_multipleExercise :: Maybe MultipleExercise+ -- ^ As defined in the 2000 ISDA Definitions, Section 12.4. + -- Multiple Exercise, the buyer of the option has the right to + -- exercise all or less than all the unexercised notional + -- amount of the underlying swap on one or more days in the + -- exercise period, but on any such day may not exercise less + -- than the minimum notional amount or more that the maximum + -- notional amount, and if an integral multiple amount is + -- specified, the notional amount exercised must be equal to, + -- or be an intergral multiple of, the integral multiple + -- amount.+ , americExerc_exerciseFeeSchedule :: Maybe ExerciseFeeSchedule+ -- ^ The fees associated with an exercise date. The fees are + -- conditional on the exercise occuring. The fees can be + -- specified as actual currency amounts or as percentages of + -- the notional amount being exercised.+ }+ deriving (Eq,Show)+instance SchemaType AmericanExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (AmericanExercise a0)+ `apply` optional (parseSchemaType "commencementDate")+ `apply` optional (parseSchemaType "expirationDate")+ `apply` optional (parseSchemaType "relevantUnderlyingDate")+ `apply` optional (parseSchemaType "earliestExerciseTime")+ `apply` optional (parseSchemaType "latestExerciseTime")+ `apply` optional (parseSchemaType "expirationTime")+ `apply` optional (parseSchemaType "multipleExercise")+ `apply` optional (parseSchemaType "exerciseFeeSchedule")+ schemaTypeToXML s x@AmericanExercise{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ americExerc_ID x+ ]+ [ maybe [] (schemaTypeToXML "commencementDate") $ americExerc_commencementDate x+ , maybe [] (schemaTypeToXML "expirationDate") $ americExerc_expirationDate x+ , maybe [] (schemaTypeToXML "relevantUnderlyingDate") $ americExerc_relevantUnderlyingDate x+ , maybe [] (schemaTypeToXML "earliestExerciseTime") $ americExerc_earliestExerciseTime x+ , maybe [] (schemaTypeToXML "latestExerciseTime") $ americExerc_latestExerciseTime x+ , maybe [] (schemaTypeToXML "expirationTime") $ americExerc_expirationTime x+ , maybe [] (schemaTypeToXML "multipleExercise") $ americExerc_multipleExercise x+ , maybe [] (schemaTypeToXML "exerciseFeeSchedule") $ americExerc_exerciseFeeSchedule x+ ]+instance Extension AmericanExercise Exercise where+ supertype v = Exercise_AmericanExercise v+ +-- | Specifies a reference to a monetary amount.+data AmountReference = AmountReference+ { amountRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType AmountReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (AmountReference a0)+ schemaTypeToXML s x@AmountReference{} =+ toXMLElement s [ toXMLAttribute "href" $ amountRef_href x+ ]+ []+instance Extension AmountReference Reference where+ supertype v = Reference_AmountReference v+ +-- | A type defining a currency amount or a currency amount +-- schedule.+data AmountSchedule = AmountSchedule+ { amountSched_ID :: Maybe Xsd.ID+ , amountSched_initialValue :: Xsd.Decimal+ -- ^ The initial rate or amount, as the case may be. An initial + -- rate of 5% would be represented as 0.05.+ , amountSched_step :: [Step]+ -- ^ The schedule of step date and value pairs. On each step + -- date the associated step value becomes effective A list of + -- steps may be ordered in the document by ascending step + -- date. An FpML document containing an unordered list of + -- steps is still regarded as a conformant document.+ , amountSched_currency :: Maybe Currency+ -- ^ The currency in which an amount is denominated.+ }+ deriving (Eq,Show)+instance SchemaType AmountSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (AmountSchedule a0)+ `apply` parseSchemaType "initialValue"+ `apply` many (parseSchemaType "step")+ `apply` optional (parseSchemaType "currency")+ schemaTypeToXML s x@AmountSchedule{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ amountSched_ID x+ ]+ [ schemaTypeToXML "initialValue" $ amountSched_initialValue x+ , concatMap (schemaTypeToXML "step") $ amountSched_step x+ , maybe [] (schemaTypeToXML "currency") $ amountSched_currency x+ ]+instance Extension AmountSchedule Schedule where+ supertype (AmountSchedule a0 e0 e1 e2) =+ Schedule a0 e0 e1+ +data AssetClass = AssetClass Scheme AssetClassAttributes deriving (Eq,Show)+data AssetClassAttributes = AssetClassAttributes+ { assetClassAttrib_assetClassScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType AssetClass where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "assetClassScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ AssetClass v (AssetClassAttributes a0)+ schemaTypeToXML s (AssetClass bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "assetClassScheme") $ assetClassAttrib_assetClassScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension AssetClass Scheme where+ supertype (AssetClass s _) = s+ +-- | A type to define automatic exercise of a swaption. With +-- automatic exercise the option is deemed to have exercised +-- if it is in the money by more than the threshold amount on +-- the exercise date.+data AutomaticExercise = AutomaticExercise+ { automExerc_thresholdRate :: Maybe Xsd.Decimal+ -- ^ A threshold rate. The threshold of 0.10% would be + -- represented as 0.001+ }+ deriving (Eq,Show)+instance SchemaType AutomaticExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return AutomaticExercise+ `apply` optional (parseSchemaType "thresholdRate")+ schemaTypeToXML s x@AutomaticExercise{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "thresholdRate") $ automExerc_thresholdRate x+ ]+ +-- | To indicate the limitation percentage and limitation +-- period.+data AverageDailyTradingVolumeLimit = AverageDailyTradingVolumeLimit+ { averageDailyTradingVolumeLimit_limitationPercentage :: Maybe RestrictedPercentage+ -- ^ Specifies the limitation percentage in Average Daily + -- trading volume.+ , averageDailyTradingVolumeLimit_limitationPeriod :: Maybe Xsd.NonNegativeInteger+ -- ^ Specifies the limitation period for Average Daily trading + -- volume in number of days.+ }+ deriving (Eq,Show)+instance SchemaType AverageDailyTradingVolumeLimit where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return AverageDailyTradingVolumeLimit+ `apply` optional (parseSchemaType "limitationPercentage")+ `apply` optional (parseSchemaType "limitationPeriod")+ schemaTypeToXML s x@AverageDailyTradingVolumeLimit{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "limitationPercentage") $ averageDailyTradingVolumeLimit_limitationPercentage x+ , maybe [] (schemaTypeToXML "limitationPeriod") $ averageDailyTradingVolumeLimit_limitationPeriod x+ ]+ +-- | A type defining the beneficiary of the funds.+data Beneficiary = Beneficiary+ { beneficiary_choice0 :: (Maybe (OneOf3 RoutingIds RoutingExplicitDetails RoutingIdsAndExplicitDetails))+ -- ^ Choice between:+ -- + -- (1) A set of unique identifiers for a party, eachone + -- identifying the party within a payment system. The + -- assumption is that each party will not have more than + -- one identifier within the same payment system.+ -- + -- (2) A set of details that is used to identify a party + -- involved in the routing of a payment when the party + -- does not have a code that identifies it within one of + -- the recognized payment systems.+ -- + -- (3) A combination of coded payment system identifiers and + -- details for physical addressing for a party involved in + -- the routing of a payment.+ , beneficiary_partyReference :: Maybe PartyReference+ -- ^ Link to the party acting as beneficiary. This element can + -- only appear within the beneficiary container element.+ }+ deriving (Eq,Show)+instance SchemaType Beneficiary where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Beneficiary+ `apply` optional (oneOf' [ ("RoutingIds", fmap OneOf3 (parseSchemaType "routingIds"))+ , ("RoutingExplicitDetails", fmap TwoOf3 (parseSchemaType "routingExplicitDetails"))+ , ("RoutingIdsAndExplicitDetails", fmap ThreeOf3 (parseSchemaType "routingIdsAndExplicitDetails"))+ ])+ `apply` optional (parseSchemaType "beneficiaryPartyReference")+ schemaTypeToXML s x@Beneficiary{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "routingIds")+ (schemaTypeToXML "routingExplicitDetails")+ (schemaTypeToXML "routingIdsAndExplicitDetails")+ ) $ beneficiary_choice0 x+ , maybe [] (schemaTypeToXML "beneficiaryPartyReference") $ beneficiary_partyReference x+ ]+ +-- | A type defining the Bermuda option exercise dates and the +-- expiration date together with any rules govenerning the +-- notional amount of the underlying which can be exercised on +-- any given exercise date and any associated exercise fee.+data BermudaExercise = BermudaExercise+ { bermudaExerc_ID :: Maybe Xsd.ID+ , bermudaExercise_dates :: Maybe AdjustableOrRelativeDates+ -- ^ The dates the define the Bermuda option exercise dates and + -- the expiration date. The last specified date is assumed to + -- be the expiration date. The dates can either be specified + -- as a series of explicit dates and associated adjustments or + -- as a series of dates defined relative to another schedule + -- of dates, for example, the calculation period start dates. + -- Where a relative series of dates are defined the first and + -- last possible exercise dates can be separately specified.+ , bermudaExerc_relevantUnderlyingDate :: Maybe AdjustableOrRelativeDates+ -- ^ The date on the underlying set by the exercise of an + -- option. What this date is depends on the option (e.g. in a + -- swaption it is the swap effective date, in an + -- extendible/cancelable provision it is the swap termination + -- date).+ , bermudaExerc_earliestExerciseTime :: Maybe BusinessCenterTime+ -- ^ The earliest time at which notice of exercise can be given + -- by the buyer to the seller (or seller's agent) i) on the + -- expriation date, in the case of a European style option, + -- (ii) on each bermuda option exercise date and the + -- expiration date, in the case of a Bermuda style option the + -- commencement date to, and including, the expiration date , + -- in the case of an American option.+ , bermudaExerc_latestExerciseTime :: Maybe BusinessCenterTime+ -- ^ For a Bermuda or American style option, the latest time on + -- an exercise business day (excluding the expiration date) + -- within the exercise period that notice can be given by the + -- buyer to the seller or seller's agent. Notice of exercise + -- given after this time will be deemed to have been given on + -- the next exercise business day.+ , bermudaExerc_expirationTime :: Maybe BusinessCenterTime+ -- ^ The latest time for exercise on expirationDate.+ , bermudaExerc_multipleExercise :: Maybe MultipleExercise+ -- ^ As defined in the 2000 ISDA Definitions, Section 12.4. + -- Multiple Exercise, the buyer of the option has the right to + -- exercise all or less than all the unexercised notional + -- amount of the underlying swap on one or more days in the + -- exercise period, but on any such day may not exercise less + -- than the minimum notional amount or more that the maximum + -- notional amount, and if an integral multiple amount is + -- specified, the notional amount exercised must be equal to, + -- or be an intergral multiple of, the integral multiple + -- amount.+ , bermudaExerc_exerciseFeeSchedule :: Maybe ExerciseFeeSchedule+ -- ^ The fees associated with an exercise date. The fees are + -- conditional on the exercise occuring. The fees can be + -- specified as actual currency amounts or as percentages of + -- the notional amount being exercised.+ }+ deriving (Eq,Show)+instance SchemaType BermudaExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (BermudaExercise a0)+ `apply` optional (parseSchemaType "bermudaExerciseDates")+ `apply` optional (parseSchemaType "relevantUnderlyingDate")+ `apply` optional (parseSchemaType "earliestExerciseTime")+ `apply` optional (parseSchemaType "latestExerciseTime")+ `apply` optional (parseSchemaType "expirationTime")+ `apply` optional (parseSchemaType "multipleExercise")+ `apply` optional (parseSchemaType "exerciseFeeSchedule")+ schemaTypeToXML s x@BermudaExercise{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ bermudaExerc_ID x+ ]+ [ maybe [] (schemaTypeToXML "bermudaExerciseDates") $ bermudaExercise_dates x+ , maybe [] (schemaTypeToXML "relevantUnderlyingDate") $ bermudaExerc_relevantUnderlyingDate x+ , maybe [] (schemaTypeToXML "earliestExerciseTime") $ bermudaExerc_earliestExerciseTime x+ , maybe [] (schemaTypeToXML "latestExerciseTime") $ bermudaExerc_latestExerciseTime x+ , maybe [] (schemaTypeToXML "expirationTime") $ bermudaExerc_expirationTime x+ , maybe [] (schemaTypeToXML "multipleExercise") $ bermudaExerc_multipleExercise x+ , maybe [] (schemaTypeToXML "exerciseFeeSchedule") $ bermudaExerc_exerciseFeeSchedule x+ ]+instance Extension BermudaExercise Exercise where+ supertype v = Exercise_BermudaExercise v+ +-- | Identifies the market sector in which the trade has been +-- arranged.+data BrokerConfirmation = BrokerConfirmation+ { brokerConfirmation_type :: Maybe BrokerConfirmationType+ -- ^ The type of broker confirmation executed between the + -- parties.+ }+ deriving (Eq,Show)+instance SchemaType BrokerConfirmation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return BrokerConfirmation+ `apply` optional (parseSchemaType "brokerConfirmationType")+ schemaTypeToXML s x@BrokerConfirmation{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "brokerConfirmationType") $ brokerConfirmation_type x+ ]+ +-- | Identifies the market sector in which the trade has been +-- arranged.+data BrokerConfirmationType = BrokerConfirmationType Scheme BrokerConfirmationTypeAttributes deriving (Eq,Show)+data BrokerConfirmationTypeAttributes = BrokerConfirmationTypeAttributes+ { brokerConfirTypeAttrib_brokerConfirmationTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType BrokerConfirmationType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "brokerConfirmationTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ BrokerConfirmationType v (BrokerConfirmationTypeAttributes a0)+ schemaTypeToXML s (BrokerConfirmationType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "brokerConfirmationTypeScheme") $ brokerConfirTypeAttrib_brokerConfirmationTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension BrokerConfirmationType Scheme where+ supertype (BrokerConfirmationType s _) = s+ +-- | A code identifying a business day calendar location. A +-- business day calendar location is drawn from the list +-- identified by the business day calendar location scheme.+data BusinessCenter = BusinessCenter Scheme BusinessCenterAttributes deriving (Eq,Show)+data BusinessCenterAttributes = BusinessCenterAttributes+ { busCenterAttrib_businessCenterScheme :: Maybe Xsd.AnyURI+ , busCenterAttrib_ID :: Maybe Xsd.ID+ }+ deriving (Eq,Show)+instance SchemaType BusinessCenter where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "businessCenterScheme" e pos+ a1 <- optional $ getAttribute "id" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ BusinessCenter v (BusinessCenterAttributes a0 a1)+ schemaTypeToXML s (BusinessCenter bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "businessCenterScheme") $ busCenterAttrib_businessCenterScheme at+ , maybe [] (toXMLAttribute "id") $ busCenterAttrib_ID at+ ]+ $ schemaTypeToXML s bt+instance Extension BusinessCenter Scheme where+ supertype (BusinessCenter s _) = s+ +-- | A type for defining business day calendar used in +-- determining whether a day is a business day or not. A list +-- of business day calendar locations may be ordered in the +-- document alphabetically based on business day calendar +-- location code. An FpML document containing an unordered +-- business day calendar location list is still regarded as a +-- conformant document.+data BusinessCenters = BusinessCenters+ { busCenters_ID :: Maybe Xsd.ID+ , busCenters_businessCenter :: [BusinessCenter]+ }+ deriving (Eq,Show)+instance SchemaType BusinessCenters where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (BusinessCenters a0)+ `apply` many (parseSchemaType "businessCenter")+ schemaTypeToXML s x@BusinessCenters{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ busCenters_ID x+ ]+ [ concatMap (schemaTypeToXML "businessCenter") $ busCenters_businessCenter x+ ]+ +-- | A pointer style reference to a set of business day calendar +-- defined elsewhere in the document.+data BusinessCentersReference = BusinessCentersReference+ { busCentersRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType BusinessCentersReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (BusinessCentersReference a0)+ schemaTypeToXML s x@BusinessCentersReference{} =+ toXMLElement s [ toXMLAttribute "href" $ busCentersRef_href x+ ]+ []+instance Extension BusinessCentersReference Reference where+ supertype v = Reference_BusinessCentersReference v+ +-- | A type for defining a time with respect to a business day +-- calendar location. For example, 11:00am London time.+data BusinessCenterTime = BusinessCenterTime+ { busCenterTime_hourMinuteTime :: Maybe HourMinuteTime+ -- ^ A time specified in hh:mm:ss format where the second + -- component must be '00', e.g. 11am would be represented as + -- 11:00:00.+ , busCenterTime_businessCenter :: Maybe BusinessCenter+ }+ deriving (Eq,Show)+instance SchemaType BusinessCenterTime where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return BusinessCenterTime+ `apply` optional (parseSchemaType "hourMinuteTime")+ `apply` optional (parseSchemaType "businessCenter")+ schemaTypeToXML s x@BusinessCenterTime{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "hourMinuteTime") $ busCenterTime_hourMinuteTime x+ , maybe [] (schemaTypeToXML "businessCenter") $ busCenterTime_businessCenter x+ ]+ +-- | A type defining a range of contiguous business days by +-- defining an unadjusted first date, an unadjusted last date +-- and a business day convention and business centers for +-- adjusting the first and last dates if they would otherwise +-- fall on a non business day in the specified business +-- centers. The days between the first and last date must also +-- be good business days in the specified centers to be +-- counted in the range.+data BusinessDateRange = BusinessDateRange+ { busDateRange_unadjustedFirstDate :: Maybe Xsd.Date+ -- ^ The first date of a date range.+ , busDateRange_unadjustedLastDate :: Maybe Xsd.Date+ -- ^ The last date of a date range.+ , busDateRange_businessDayConvention :: Maybe BusinessDayConventionEnum+ -- ^ The convention for adjusting a date if it would otherwise + -- fall on a day that is not a business day.+ , busDateRange_choice3 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to a set of financial + -- business centers defined elsewhere in the document. + -- This set of business centers is used to determine + -- whether a particular day is a business day or not.+ -- + -- (2) businessCenters+ }+ deriving (Eq,Show)+instance SchemaType BusinessDateRange where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return BusinessDateRange+ `apply` optional (parseSchemaType "unadjustedFirstDate")+ `apply` optional (parseSchemaType "unadjustedLastDate")+ `apply` optional (parseSchemaType "businessDayConvention")+ `apply` optional (oneOf' [ ("BusinessCentersReference", fmap OneOf2 (parseSchemaType "businessCentersReference"))+ , ("BusinessCenters", fmap TwoOf2 (parseSchemaType "businessCenters"))+ ])+ schemaTypeToXML s x@BusinessDateRange{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "unadjustedFirstDate") $ busDateRange_unadjustedFirstDate x+ , maybe [] (schemaTypeToXML "unadjustedLastDate") $ busDateRange_unadjustedLastDate x+ , maybe [] (schemaTypeToXML "businessDayConvention") $ busDateRange_businessDayConvention x+ , maybe [] (foldOneOf2 (schemaTypeToXML "businessCentersReference")+ (schemaTypeToXML "businessCenters")+ ) $ busDateRange_choice3 x+ ]+instance Extension BusinessDateRange DateRange where+ supertype (BusinessDateRange e0 e1 e2 e3) =+ DateRange e0 e1+ +-- | A type defining the business day convention and financial +-- business centers used for adjusting any relevant date if it +-- would otherwise fall on a day that is not a business day in +-- the specified business centers.+data BusinessDayAdjustments = BusinessDayAdjustments+ { busDayAdjust_ID :: Maybe Xsd.ID+ , busDayAdjust_businessDayConvention :: Maybe BusinessDayConventionEnum+ -- ^ The convention for adjusting a date if it would otherwise + -- fall on a day that is not a business day.+ , busDayAdjust_choice1 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to a set of financial + -- business centers defined elsewhere in the document. + -- This set of business centers is used to determine + -- whether a particular day is a business day or not.+ -- + -- (2) businessCenters+ }+ deriving (Eq,Show)+instance SchemaType BusinessDayAdjustments where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (BusinessDayAdjustments a0)+ `apply` optional (parseSchemaType "businessDayConvention")+ `apply` optional (oneOf' [ ("BusinessCentersReference", fmap OneOf2 (parseSchemaType "businessCentersReference"))+ , ("BusinessCenters", fmap TwoOf2 (parseSchemaType "businessCenters"))+ ])+ schemaTypeToXML s x@BusinessDayAdjustments{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ busDayAdjust_ID x+ ]+ [ maybe [] (schemaTypeToXML "businessDayConvention") $ busDayAdjust_businessDayConvention x+ , maybe [] (foldOneOf2 (schemaTypeToXML "businessCentersReference")+ (schemaTypeToXML "businessCenters")+ ) $ busDayAdjust_choice1 x+ ]+ +-- | Reference to a business day adjustments structure.+data BusinessDayAdjustmentsReference = BusinessDayAdjustmentsReference+ { busDayAdjustRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType BusinessDayAdjustmentsReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (BusinessDayAdjustmentsReference a0)+ schemaTypeToXML s x@BusinessDayAdjustmentsReference{} =+ toXMLElement s [ toXMLAttribute "href" $ busDayAdjustRef_href x+ ]+ []+instance Extension BusinessDayAdjustmentsReference Reference where+ supertype v = Reference_BusinessDayAdjustmentsReference v+ +-- | A type defining the ISDA calculation agent responsible for +-- performing duties as defined in the applicable product +-- definitions.+data CalculationAgent = CalculationAgent+ { calcAgent_choice0 :: (Maybe (OneOf2 [PartyReference] CalculationAgentPartyEnum))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to a party identifier defined + -- elsewhere in the document. The party referenced is the + -- ISDA Calculation Agent for the trade. If more than one + -- party is referenced then the parties are assumed to be + -- co-calculation agents, i.e. they have joint + -- responsibility.+ -- + -- (2) The ISDA calculation agent responsible for performing + -- duties as defined in the applicable product + -- definitions. For example, the Calculation Agent may be + -- defined as being the Non-exercising Party.+ }+ deriving (Eq,Show)+instance SchemaType CalculationAgent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CalculationAgent+ `apply` optional (oneOf' [ ("[PartyReference]", fmap OneOf2 (many1 (parseSchemaType "calculationAgentPartyReference")))+ , ("CalculationAgentPartyEnum", fmap TwoOf2 (parseSchemaType "calculationAgentParty"))+ ])+ schemaTypeToXML s x@CalculationAgent{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (concatMap (schemaTypeToXML "calculationAgentPartyReference"))+ (schemaTypeToXML "calculationAgentParty")+ ) $ calcAgent_choice0 x+ ]+ +-- | A type defining the frequency at which calculation period +-- end dates occur within the regular part of the calculation +-- period schedule and thier roll date convention. In case the +-- calculation frequency is of value T (term), the period is +-- defined by the +-- swap\swapStream\calculationPerioDates\effectiveDate and the +-- swap\swapStream\calculationPerioDates\terminationDate.+data CalculationPeriodFrequency = CalculationPeriodFrequency+ { calcPeriodFrequ_ID :: Maybe Xsd.ID+ , calcPeriodFrequ_periodMultiplier :: Maybe Xsd.PositiveInteger+ -- ^ A time period multiplier, e.g. 1, 2 or 3 etc. If the period + -- value is T (Term) then periodMultiplier must contain the + -- value 1.+ , calcPeriodFrequ_period :: Maybe PeriodExtendedEnum+ -- ^ A time period, e.g. a day, week, month, year or term of the + -- stream.+ , calcPeriodFrequ_rollConvention :: Maybe RollConventionEnum+ -- ^ Used in conjunction with a frequency and the regular period + -- start date of a calculation period, determines each + -- calculation period end date within the regular part of a + -- calculation period schedule.+ }+ deriving (Eq,Show)+instance SchemaType CalculationPeriodFrequency where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CalculationPeriodFrequency a0)+ `apply` optional (parseSchemaType "periodMultiplier")+ `apply` optional (parseSchemaType "period")+ `apply` optional (parseSchemaType "rollConvention")+ schemaTypeToXML s x@CalculationPeriodFrequency{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ calcPeriodFrequ_ID x+ ]+ [ maybe [] (schemaTypeToXML "periodMultiplier") $ calcPeriodFrequ_periodMultiplier x+ , maybe [] (schemaTypeToXML "period") $ calcPeriodFrequ_period x+ , maybe [] (schemaTypeToXML "rollConvention") $ calcPeriodFrequ_rollConvention x+ ]+instance Extension CalculationPeriodFrequency Frequency where+ supertype (CalculationPeriodFrequency a0 e0 e1 e2) =+ Frequency a0 e0 e1+ +-- | An identifier used to identify a single component cashflow.+data CashflowId = CashflowId Scheme CashflowIdAttributes deriving (Eq,Show)+data CashflowIdAttributes = CashflowIdAttributes+ { cashflIdAttrib_cashflowIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CashflowId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "cashflowIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CashflowId v (CashflowIdAttributes a0)+ schemaTypeToXML s (CashflowId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "cashflowIdScheme") $ cashflIdAttrib_cashflowIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CashflowId Scheme where+ supertype (CashflowId s _) = s+ +-- | The notional/principal value/quantity/volume used to +-- compute the cashflow.+data CashflowNotional = CashflowNotional+ { cashflNotion_ID :: Maybe Xsd.ID+ , cashflNotion_choice0 :: (Maybe (OneOf2 Currency Xsd.NormalizedString))+ -- ^ Choice between:+ -- + -- (1) The currency in which an amount is denominated.+ -- + -- (2) The units in which an amount (not monetary) is + -- denominated.+ , cashflNotion_amount :: Xsd.Decimal+ -- ^ The quantity of notional (in currency or other units).+ }+ deriving (Eq,Show)+instance SchemaType CashflowNotional where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CashflowNotional a0)+ `apply` optional (oneOf' [ ("Currency", fmap OneOf2 (parseSchemaType "currency"))+ , ("Xsd.NormalizedString", fmap TwoOf2 (parseSchemaType "units"))+ ])+ `apply` parseSchemaType "amount"+ schemaTypeToXML s x@CashflowNotional{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ cashflNotion_ID x+ ]+ [ maybe [] (foldOneOf2 (schemaTypeToXML "currency")+ (schemaTypeToXML "units")+ ) $ cashflNotion_choice0 x+ , schemaTypeToXML "amount" $ cashflNotion_amount x+ ]+ +-- | A coding scheme used to describe the type or purpose of a +-- cash flow or cash flow component.+data CashflowType = CashflowType Scheme CashflowTypeAttributes deriving (Eq,Show)+data CashflowTypeAttributes = CashflowTypeAttributes+ { cashflTypeAttrib_cashflowTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CashflowType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "cashflowTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CashflowType v (CashflowTypeAttributes a0)+ schemaTypeToXML s (CashflowType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "cashflowTypeScheme") $ cashflTypeAttrib_cashflowTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CashflowType Scheme where+ supertype (CashflowType s _) = s+ +-- | A type defining the list of reference institutions polled +-- for relevant rates or prices when determining the cash +-- settlement amount for a product where cash settlement is +-- applicable.+data CashSettlementReferenceBanks = CashSettlementReferenceBanks+ { cashSettlRefBanks_ID :: Maybe Xsd.ID+ , cashSettlRefBanks_referenceBank :: [ReferenceBank]+ -- ^ An institution (party) identified by means of a coding + -- scheme and an optional name.+ }+ deriving (Eq,Show)+instance SchemaType CashSettlementReferenceBanks where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CashSettlementReferenceBanks a0)+ `apply` many (parseSchemaType "referenceBank")+ schemaTypeToXML s x@CashSettlementReferenceBanks{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ cashSettlRefBanks_ID x+ ]+ [ concatMap (schemaTypeToXML "referenceBank") $ cashSettlRefBanks_referenceBank x+ ]+ +-- | Unless otherwise specified, the principal clearance system +-- customarily used for settling trades in the relevant +-- underlying.+data ClearanceSystem = ClearanceSystem Scheme ClearanceSystemAttributes deriving (Eq,Show)+data ClearanceSystemAttributes = ClearanceSystemAttributes+ { clearSystemAttrib_clearanceSystemScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ClearanceSystem where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "clearanceSystemScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ClearanceSystem v (ClearanceSystemAttributes a0)+ schemaTypeToXML s (ClearanceSystem bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "clearanceSystemScheme") $ clearSystemAttrib_clearanceSystemScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ClearanceSystem Scheme where+ supertype (ClearanceSystem s _) = s+ +-- | The definitions, such as those published by ISDA, that will +-- define the terms of the trade.+data ContractualDefinitions = ContractualDefinitions Scheme ContractualDefinitionsAttributes deriving (Eq,Show)+data ContractualDefinitionsAttributes = ContractualDefinitionsAttributes+ { contrDefinAttrib_contractualDefinitionsScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ContractualDefinitions where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "contractualDefinitionsScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ContractualDefinitions v (ContractualDefinitionsAttributes a0)+ schemaTypeToXML s (ContractualDefinitions bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "contractualDefinitionsScheme") $ contrDefinAttrib_contractualDefinitionsScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ContractualDefinitions Scheme where+ supertype (ContractualDefinitions s _) = s+ +data ContractualMatrix = ContractualMatrix+ { contrMatrix_matrixType :: Maybe MatrixType+ -- ^ Identifies the form of applicable matrix.+ , contrMatrix_publicationDate :: Maybe Xsd.Date+ -- ^ Specifies the publication date of the applicable version of + -- the matrix. When this element is omitted, the ISDA + -- supplemental language for incorporation of the relevant + -- matrix will generally define rules for which version of the + -- matrix is applicable.+ , contrMatrix_matrixTerm :: Maybe MatrixTerm+ -- ^ Defines any applicable key into the relevant matrix. For + -- example, the Transaction Type would be the single term + -- required for the Credit Derivatives Physical Settlement + -- Matrix. This element should be omitted in the case of the + -- 2000 ISDA Definitions Settlement Matrix for Early + -- Termination and Swaptions.+ }+ deriving (Eq,Show)+instance SchemaType ContractualMatrix where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ContractualMatrix+ `apply` optional (parseSchemaType "matrixType")+ `apply` optional (parseSchemaType "publicationDate")+ `apply` optional (parseSchemaType "matrixTerm")+ schemaTypeToXML s x@ContractualMatrix{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "matrixType") $ contrMatrix_matrixType x+ , maybe [] (schemaTypeToXML "publicationDate") $ contrMatrix_publicationDate x+ , maybe [] (schemaTypeToXML "matrixTerm") $ contrMatrix_matrixTerm x+ ]+ +-- | A contractual supplement (such as those published by ISDA) +-- that will apply to the trade.+data ContractualSupplement = ContractualSupplement Scheme ContractualSupplementAttributes deriving (Eq,Show)+data ContractualSupplementAttributes = ContractualSupplementAttributes+ { contrSupplAttrib_contractualSupplementScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ContractualSupplement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "contractualSupplementScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ContractualSupplement v (ContractualSupplementAttributes a0)+ schemaTypeToXML s (ContractualSupplement bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "contractualSupplementScheme") $ contrSupplAttrib_contractualSupplementScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ContractualSupplement Scheme where+ supertype (ContractualSupplement s _) = s+ +-- | A contractual supplement (such as those published by ISDA) +-- and its publication date that will apply to the trade.+data ContractualTermsSupplement = ContractualTermsSupplement+ { contrTermsSuppl_type :: Maybe ContractualSupplement+ -- ^ Identifies the form of applicable contractual supplement.+ , contrTermsSuppl_publicationDate :: Maybe Xsd.Date+ -- ^ Specifies the publication date of the applicable version of + -- the contractual supplement.+ }+ deriving (Eq,Show)+instance SchemaType ContractualTermsSupplement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ContractualTermsSupplement+ `apply` optional (parseSchemaType "type")+ `apply` optional (parseSchemaType "publicationDate")+ schemaTypeToXML s x@ContractualTermsSupplement{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "type") $ contrTermsSuppl_type x+ , maybe [] (schemaTypeToXML "publicationDate") $ contrTermsSuppl_publicationDate x+ ]+ +-- | A type that describes the information to identify a +-- correspondent bank that will make delivery of the funds on +-- the paying bank's behalf in the country where the payment +-- is to be made.+data CorrespondentInformation = CorrespondentInformation+ { corresInfo_choice0 :: (Maybe (OneOf3 RoutingIds RoutingExplicitDetails RoutingIdsAndExplicitDetails))+ -- ^ Choice between:+ -- + -- (1) A set of unique identifiers for a party, eachone + -- identifying the party within a payment system. The + -- assumption is that each party will not have more than + -- one identifier within the same payment system.+ -- + -- (2) A set of details that is used to identify a party + -- involved in the routing of a payment when the party + -- does not have a code that identifies it within one of + -- the recognized payment systems.+ -- + -- (3) A combination of coded payment system identifiers and + -- details for physical addressing for a party involved in + -- the routing of a payment.+ , corresInfo_correspondentPartyReference :: Maybe PartyReference+ -- ^ Link to the party acting as correspondent. This element can + -- only appear within the correspondentInformation container + -- element.+ }+ deriving (Eq,Show)+instance SchemaType CorrespondentInformation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CorrespondentInformation+ `apply` optional (oneOf' [ ("RoutingIds", fmap OneOf3 (parseSchemaType "routingIds"))+ , ("RoutingExplicitDetails", fmap TwoOf3 (parseSchemaType "routingExplicitDetails"))+ , ("RoutingIdsAndExplicitDetails", fmap ThreeOf3 (parseSchemaType "routingIdsAndExplicitDetails"))+ ])+ `apply` optional (parseSchemaType "correspondentPartyReference")+ schemaTypeToXML s x@CorrespondentInformation{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "routingIds")+ (schemaTypeToXML "routingExplicitDetails")+ (schemaTypeToXML "routingIdsAndExplicitDetails")+ ) $ corresInfo_choice0 x+ , maybe [] (schemaTypeToXML "correspondentPartyReference") $ corresInfo_correspondentPartyReference x+ ]+ +-- | The code representation of a country or an area of special +-- sovereignty. By default it is a valid 2 character country +-- code as defined by the ISO standard 3166-1 alpha-2 - Codes +-- for representation of countries +-- http://www.niso.org/standards/resources/3166.html.+data CountryCode = CountryCode Xsd.Token CountryCodeAttributes deriving (Eq,Show)+data CountryCodeAttributes = CountryCodeAttributes+ { countryCodeAttrib_countryScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CountryCode where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "countryScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CountryCode v (CountryCodeAttributes a0)+ schemaTypeToXML s (CountryCode bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "countryScheme") $ countryCodeAttrib_countryScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CountryCode Xsd.Token where+ supertype (CountryCode s _) = s+ +-- | The repayment precedence of a debt instrument.+data CreditSeniority = CreditSeniority Scheme CreditSeniorityAttributes deriving (Eq,Show)+data CreditSeniorityAttributes = CreditSeniorityAttributes+ { creditSeniorAttrib_creditSeniorityScheme :: Maybe Xsd.AnyURI+ -- ^ creditSeniorityTradingScheme overrides + -- creditSeniorityScheme when the underlyer defines the + -- reference obligation used in a single name credit default + -- swap trade.+ }+ deriving (Eq,Show)+instance SchemaType CreditSeniority where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "creditSeniorityScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CreditSeniority v (CreditSeniorityAttributes a0)+ schemaTypeToXML s (CreditSeniority bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "creditSeniorityScheme") $ creditSeniorAttrib_creditSeniorityScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CreditSeniority Scheme where+ supertype (CreditSeniority s _) = s+ +-- | The agreement executed between the parties and intended to +-- govern collateral arrangement for all OTC derivatives +-- transactions between those parties.+data CreditSupportAgreement = CreditSupportAgreement+ { creditSupportAgreem_type :: Maybe CreditSupportAgreementType+ -- ^ The type of ISDA Credit Support Agreement+ , creditSupportAgreem_date :: Maybe Xsd.Date+ -- ^ The date of the agreement executed between the parties and + -- intended to govern collateral arrangements for all OTC + -- derivatives transactions between those parties.+ , creditSupportAgreem_identifier :: Maybe CreditSupportAgreementIdentifier+ -- ^ An identifier used to uniquely identify the CSA+ }+ deriving (Eq,Show)+instance SchemaType CreditSupportAgreement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CreditSupportAgreement+ `apply` optional (parseSchemaType "type")+ `apply` optional (parseSchemaType "date")+ `apply` optional (parseSchemaType "identifier")+ schemaTypeToXML s x@CreditSupportAgreement{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "type") $ creditSupportAgreem_type x+ , maybe [] (schemaTypeToXML "date") $ creditSupportAgreem_date x+ , maybe [] (schemaTypeToXML "identifier") $ creditSupportAgreem_identifier x+ ]+ +data CreditSupportAgreementIdentifier = CreditSupportAgreementIdentifier Scheme CreditSupportAgreementIdentifierAttributes deriving (Eq,Show)+data CreditSupportAgreementIdentifierAttributes = CreditSupportAgreementIdentifierAttributes+ { csaia_creditSupportAgreementIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CreditSupportAgreementIdentifier where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "creditSupportAgreementIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CreditSupportAgreementIdentifier v (CreditSupportAgreementIdentifierAttributes a0)+ schemaTypeToXML s (CreditSupportAgreementIdentifier bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "creditSupportAgreementIdScheme") $ csaia_creditSupportAgreementIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CreditSupportAgreementIdentifier Scheme where+ supertype (CreditSupportAgreementIdentifier s _) = s+ +data CreditSupportAgreementType = CreditSupportAgreementType Scheme CreditSupportAgreementTypeAttributes deriving (Eq,Show)+data CreditSupportAgreementTypeAttributes = CreditSupportAgreementTypeAttributes+ { csata_creditSupportAgreementTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CreditSupportAgreementType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "creditSupportAgreementTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CreditSupportAgreementType v (CreditSupportAgreementTypeAttributes a0)+ schemaTypeToXML s (CreditSupportAgreementType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "creditSupportAgreementTypeScheme") $ csata_creditSupportAgreementTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CreditSupportAgreementType Scheme where+ supertype (CreditSupportAgreementType s _) = s+ +-- | A party's credit rating.+data CreditRating = CreditRating Scheme CreditRatingAttributes deriving (Eq,Show)+data CreditRatingAttributes = CreditRatingAttributes+ { creditRatingAttrib_creditRatingScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType CreditRating where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "creditRatingScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ CreditRating v (CreditRatingAttributes a0)+ schemaTypeToXML s (CreditRating bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "creditRatingScheme") $ creditRatingAttrib_creditRatingScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension CreditRating Scheme where+ supertype (CreditRating s _) = s+ +-- | The code representation of a currency or fund. By default +-- it is a valid currency code as defined by the ISO standard +-- 4217 - Codes for representation of currencies and funds +-- http://www.iso.org/iso/en/prods-services/popstds/currencycodeslist.html.+data Currency = Currency Scheme CurrencyAttributes deriving (Eq,Show)+data CurrencyAttributes = CurrencyAttributes+ { currenAttrib_currencyScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType Currency where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "currencyScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ Currency v (CurrencyAttributes a0)+ schemaTypeToXML s (Currency bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "currencyScheme") $ currenAttrib_currencyScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension Currency Scheme where+ supertype (Currency s _) = s+ +-- | List of Dates+data DateList = DateList+ { dateList_date :: [Xsd.Date]+ }+ deriving (Eq,Show)+instance SchemaType DateList where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DateList+ `apply` many (parseSchemaType "date")+ schemaTypeToXML s x@DateList{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "date") $ dateList_date x+ ]+ +-- | A type defining an offset used in calculating a date when +-- this date is defined in reference to another date through a +-- date offset. The type includes the convention for adjusting +-- the date and an optional sequence element to indicate the +-- order in a sequence of multiple date offsets.+data DateOffset = DateOffset+ { dateOffset_ID :: Maybe Xsd.ID+ , dateOffset_periodMultiplier :: Xsd.Integer+ -- ^ A time period multiplier, e.g. 1, 2 or 3 etc. A negative + -- value can be used when specifying an offset relative to + -- another date, e.g. -2 days.+ , dateOffset_period :: PeriodEnum+ -- ^ A time period, e.g. a day, week, month or year of the + -- stream. If the periodMultiplier value is 0 (zero) then + -- period must contain the value D (day).+ , dateOffset_dayType :: Maybe DayTypeEnum+ -- ^ In the case of an offset specified as a number of days, + -- this element defines whether consideration is given as to + -- whether a day is a good business day or not. If a day type + -- of business days is specified then non-business days are + -- ignored when calculating the offset. The financial business + -- centers to use for determination of business days are + -- implied by the context in which this element is used. This + -- element must only be included when the offset is specified + -- as a number of days. If the offset is zero days then the + -- dayType element should not be included.+ , dateOffset_businessDayConvention :: Maybe BusinessDayConventionEnum+ -- ^ The convention for adjusting a date if it would otherwise + -- fall on a day that is not a business day.+ }+ deriving (Eq,Show)+instance SchemaType DateOffset where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (DateOffset a0)+ `apply` parseSchemaType "periodMultiplier"+ `apply` parseSchemaType "period"+ `apply` optional (parseSchemaType "dayType")+ `apply` optional (parseSchemaType "businessDayConvention")+ schemaTypeToXML s x@DateOffset{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ dateOffset_ID x+ ]+ [ schemaTypeToXML "periodMultiplier" $ dateOffset_periodMultiplier x+ , schemaTypeToXML "period" $ dateOffset_period x+ , maybe [] (schemaTypeToXML "dayType") $ dateOffset_dayType x+ , maybe [] (schemaTypeToXML "businessDayConvention") $ dateOffset_businessDayConvention x+ ]+instance Extension DateOffset Offset where+ supertype (DateOffset a0 e0 e1 e2 e3) =+ Offset a0 e0 e1 e2+instance Extension DateOffset Period where+ supertype = (supertype :: Offset -> Period)+ . (supertype :: DateOffset -> Offset)+ + +-- | A type defining a contiguous series of calendar dates. The +-- date range is defined as all the dates between and +-- including the first and the last date. The first date must +-- fall before the last date.+data DateRange = DateRange+ { dateRange_unadjustedFirstDate :: Maybe Xsd.Date+ -- ^ The first date of a date range.+ , dateRange_unadjustedLastDate :: Maybe Xsd.Date+ -- ^ The last date of a date range.+ }+ deriving (Eq,Show)+instance SchemaType DateRange where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DateRange+ `apply` optional (parseSchemaType "unadjustedFirstDate")+ `apply` optional (parseSchemaType "unadjustedLastDate")+ schemaTypeToXML s x@DateRange{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "unadjustedFirstDate") $ dateRange_unadjustedFirstDate x+ , maybe [] (schemaTypeToXML "unadjustedLastDate") $ dateRange_unadjustedLastDate x+ ]+ +-- | Reference to an identified date or a complex date +-- structure.+data DateReference = DateReference+ { dateRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType DateReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (DateReference a0)+ schemaTypeToXML s x@DateReference{} =+ toXMLElement s [ toXMLAttribute "href" $ dateRef_href x+ ]+ []+instance Extension DateReference Reference where+ supertype v = Reference_DateReference v+ +-- | List of DateTimes+data DateTimeList = DateTimeList+ { dateTimeList_dateTime :: [Xsd.DateTime]+ }+ deriving (Eq,Show)+instance SchemaType DateTimeList where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DateTimeList+ `apply` many (parseSchemaType "dateTime")+ schemaTypeToXML s x@DateTimeList{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "dateTime") $ dateTimeList_dateTime x+ ]+ +-- | The specification for how the number of days between two +-- dates is calculated for purposes of calculation of a fixed +-- or floating payment amount and the basis for how many days +-- are assumed to be in a year. Day Count Fraction is an ISDA +-- term. The equivalent AFB (Association Francaise de Banques) +-- term is Calculation Basis.+data DayCountFraction = DayCountFraction Scheme DayCountFractionAttributes deriving (Eq,Show)+data DayCountFractionAttributes = DayCountFractionAttributes+ { dayCountFractAttrib_dayCountFractionScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType DayCountFraction where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "dayCountFractionScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ DayCountFraction v (DayCountFractionAttributes a0)+ schemaTypeToXML s (DayCountFraction bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "dayCountFractionScheme") $ dayCountFractAttrib_dayCountFractionScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension DayCountFraction Scheme where+ supertype (DayCountFraction s _) = s+ +-- | Coding scheme that specifies the method according to which +-- an amount or a date is determined.+data DeterminationMethod = DeterminationMethod Scheme DeterminationMethodAttributes deriving (Eq,Show)+data DeterminationMethodAttributes = DeterminationMethodAttributes+ { determMethodAttrib_determinationMethodScheme :: Maybe Xsd.AnyURI+ , determMethodAttrib_ID :: Maybe Xsd.ID+ }+ deriving (Eq,Show)+instance SchemaType DeterminationMethod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "determinationMethodScheme" e pos+ a1 <- optional $ getAttribute "id" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ DeterminationMethod v (DeterminationMethodAttributes a0 a1)+ schemaTypeToXML s (DeterminationMethod bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "determinationMethodScheme") $ determMethodAttrib_determinationMethodScheme at+ , maybe [] (toXMLAttribute "id") $ determMethodAttrib_ID at+ ]+ $ schemaTypeToXML s bt+instance Extension DeterminationMethod Scheme where+ supertype (DeterminationMethod s _) = s+ +-- | A reference to the return swap notional determination +-- method.+data DeterminationMethodReference = DeterminationMethodReference+ { determMethodRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType DeterminationMethodReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (DeterminationMethodReference a0)+ schemaTypeToXML s x@DeterminationMethodReference{} =+ toXMLElement s [ toXMLAttribute "href" $ determMethodRef_href x+ ]+ []+instance Extension DeterminationMethodReference Reference where+ supertype v = Reference_DeterminationMethodReference v+ +-- | An entity for defining the definitions that govern the +-- document and should include the year and type of +-- definitions referenced, along with any relevant +-- documentation (such as master agreement) and the date it +-- was signed.+data Documentation = Documentation+ { docum_masterAgreement :: Maybe MasterAgreement+ -- ^ The agreement executed between the parties and intended to + -- govern all OTC derivatives transactions between those + -- parties.+ , docum_choice1 :: (Maybe (OneOf2 MasterConfirmation BrokerConfirmation))+ -- ^ Choice between:+ -- + -- (1) The agreement executed between the parties and intended + -- to govern all OTC derivatives transactions between + -- those parties.+ -- + -- (2) Specifies the deails for a broker confirm.+ , docum_contractualDefinitions :: [ContractualDefinitions]+ -- ^ The definitions such as those published by ISDA that will + -- define the terms of the trade.+ , docum_contractualTermsSupplement :: [ContractualTermsSupplement]+ -- ^ A contractual supplement (such as those published by ISDA) + -- that will apply to the trade.+ , docum_contractualMatrix :: [ContractualMatrix]+ -- ^ A reference to a contractual matrix of elected terms/values + -- (such as those published by ISDA) that shall be deemed to + -- apply to the trade. The applicable matrix is identified by + -- reference to a name and optionally a publication date. + -- Depending on the structure of the matrix, an additional + -- term (specified in the matrixTerm element) may be required + -- to further identify a subset of applicable terms/values + -- within the matrix.+ , docum_creditSupportAgreement :: Maybe CreditSupportAgreement+ -- ^ The agreement executed between the parties and intended to + -- govern collateral arrangement for all OTC derivatives + -- transactions between those parties.+ , docum_attachment :: [Resource]+ -- ^ A human readable document related to this transaction, for + -- example a confirmation.+ }+ deriving (Eq,Show)+instance SchemaType Documentation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Documentation+ `apply` optional (parseSchemaType "masterAgreement")+ `apply` optional (oneOf' [ ("MasterConfirmation", fmap OneOf2 (parseSchemaType "masterConfirmation"))+ , ("BrokerConfirmation", fmap TwoOf2 (parseSchemaType "brokerConfirmation"))+ ])+ `apply` many (parseSchemaType "contractualDefinitions")+ `apply` many (parseSchemaType "contractualTermsSupplement")+ `apply` many (parseSchemaType "contractualMatrix")+ `apply` optional (parseSchemaType "creditSupportAgreement")+ `apply` many (parseSchemaType "attachment")+ schemaTypeToXML s x@Documentation{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "masterAgreement") $ docum_masterAgreement x+ , maybe [] (foldOneOf2 (schemaTypeToXML "masterConfirmation")+ (schemaTypeToXML "brokerConfirmation")+ ) $ docum_choice1 x+ , concatMap (schemaTypeToXML "contractualDefinitions") $ docum_contractualDefinitions x+ , concatMap (schemaTypeToXML "contractualTermsSupplement") $ docum_contractualTermsSupplement x+ , concatMap (schemaTypeToXML "contractualMatrix") $ docum_contractualMatrix x+ , maybe [] (schemaTypeToXML "creditSupportAgreement") $ docum_creditSupportAgreement x+ , concatMap (schemaTypeToXML "attachment") $ docum_attachment x+ ]+ +-- | A for holding information about documents external to the +-- FpML.+data ExternalDocument = ExternalDocument+ { externDocum_mimeType :: Maybe MimeType+ -- ^ Indicates the type of media used to store the content. + -- mimeType is used to determine the software product(s) that + -- can read the content. MIME Types are described in RFC 2046.+ , externDocum_choice1 :: (Maybe (OneOf5 Xsd.XsdString Xsd.HexBinary Xsd.Base64Binary Xsd.AnyURI HTTPAttachmentReference))+ -- ^ Choice between:+ -- + -- (1) Provides extra information as string. In case the extra + -- information is in XML format, a CDATA section must be + -- placed around the source message to prevent its + -- interpretation as XML content.+ -- + -- (2) Provides extra information as binary contents coded in + -- hexadecimal.+ -- + -- (3) Provides extra information as binary contents coded in + -- base64.+ -- + -- (4) Provides extra information as URL that references the + -- information on a web server accessible to the message + -- recipient.+ -- + -- (5) Provides a place to put a reference to an attachment on + -- an HTTP message, such as is used by SOAP with + -- Attachments and ebXML.+ }+ deriving (Eq,Show)+instance SchemaType ExternalDocument where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ExternalDocument+ `apply` optional (parseSchemaType "mimeType")+ `apply` optional (oneOf' [ ("Xsd.XsdString", fmap OneOf5 (parseSchemaType "string"))+ , ("Xsd.HexBinary", fmap TwoOf5 (parseSchemaType "hexadecimalBinary"))+ , ("Xsd.Base64Binary", fmap ThreeOf5 (parseSchemaType "base64Binary"))+ , ("Xsd.AnyURI", fmap FourOf5 (parseSchemaType "url"))+ , ("HTTPAttachmentReference", fmap FiveOf5 (parseSchemaType "attachmentReference"))+ ])+ schemaTypeToXML s x@ExternalDocument{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "mimeType") $ externDocum_mimeType x+ , maybe [] (foldOneOf5 (schemaTypeToXML "string")+ (schemaTypeToXML "hexadecimalBinary")+ (schemaTypeToXML "base64Binary")+ (schemaTypeToXML "url")+ (schemaTypeToXML "attachmentReference")+ ) $ externDocum_choice1 x+ ]+ +-- | A special type that allows references to HTTP attachments +-- identified with an HTTP "Content-ID" header, as is done +-- with SOAP with Attachments +-- (http://www.w3.org/TR/SOAP-attachments). Unlike with a +-- normal FpML @href, the type is not IDREF, as the target is +-- not identified by an XML @id attribute.+data HTTPAttachmentReference = HTTPAttachmentReference+ { hTTPAttachRef_href :: Xsd.XsdString+ }+ deriving (Eq,Show)+instance SchemaType HTTPAttachmentReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (HTTPAttachmentReference a0)+ schemaTypeToXML s x@HTTPAttachmentReference{} =+ toXMLElement s [ toXMLAttribute "href" $ hTTPAttachRef_href x+ ]+ []+instance Extension HTTPAttachmentReference Reference where+ supertype v = Reference_HTTPAttachmentReference v+ +-- | A special type meant to be used for elements with no +-- content and no attributes.+data Empty = Empty+ deriving (Eq,Show)+instance SchemaType Empty where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Empty+ schemaTypeToXML s x@Empty{} =+ toXMLElement s []+ []+ +-- | A legal entity identifier (e.g. RED entity code).+data EntityId = EntityId Scheme EntityIdAttributes deriving (Eq,Show)+data EntityIdAttributes = EntityIdAttributes+ { entityIdAttrib_entityIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType EntityId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "entityIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ EntityId v (EntityIdAttributes a0)+ schemaTypeToXML s (EntityId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "entityIdScheme") $ entityIdAttrib_entityIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension EntityId Scheme where+ supertype (EntityId s _) = s+ +-- | The name of the reference entity. A free format string. +-- FpML does not define usage rules for this element.+data EntityName = EntityName Scheme EntityNameAttributes deriving (Eq,Show)+data EntityNameAttributes = EntityNameAttributes+ { entityNameAttrib_entityNameScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType EntityName where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "entityNameScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ EntityName v (EntityNameAttributes a0)+ schemaTypeToXML s (EntityName bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "entityNameScheme") $ entityNameAttrib_entityNameScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension EntityName Scheme where+ supertype (EntityName s _) = s+ +-- | A type defining the exercise period for a European style +-- option together with any rules governing the notional +-- amount of the underlying which can be exercised on any +-- given exercise date and any associated exercise fees.+data EuropeanExercise = EuropeanExercise+ { europExerc_ID :: Maybe Xsd.ID+ , europExerc_expirationDate :: AdjustableOrRelativeDate+ -- ^ The last day within an exercise period for an American + -- style option. For a European style option it is the only + -- day within the exercise period.+ , europExerc_relevantUnderlyingDate :: Maybe AdjustableOrRelativeDates+ -- ^ The date on the underlying set by the exercise of an + -- option. What this date is depends on the option (e.g. in a + -- swaption it is the swap effective date, in an + -- extendible/cancelable provision it is the swap termination + -- date).+ , europExerc_earliestExerciseTime :: Maybe BusinessCenterTime+ -- ^ The earliest time at which notice of exercise can be given + -- by the buyer to the seller (or seller's agent) i) on the + -- expriation date, in the case of a European style option, + -- (ii) on each bermuda option exercise date and the + -- expiration date, in the case of a Bermuda style option the + -- commencement date to, and including, the expiration date , + -- in the case of an American option.+ , europExerc_expirationTime :: Maybe BusinessCenterTime+ -- ^ The latest time for exercise on expirationDate.+ , europExerc_partialExercise :: Maybe PartialExercise+ -- ^ As defined in the 2000 ISDA Definitions, Section 12.3. + -- Partial Exercise, the buyer of the option has the right to + -- exercise all or less than all the notional amount of the + -- underlying swap on the expiration date, but may not + -- exercise less than the minimum notional amount, and if an + -- integral multiple amount is specified, the notional amount + -- exercised must be equal to, or be an integral multiple of, + -- the integral multiple amount.+ , europExerc_exerciseFee :: Maybe ExerciseFee+ -- ^ A fee to be paid on exercise. This could be represented as + -- an amount or a rate and notional reference on which to + -- apply the rate.+ }+ deriving (Eq,Show)+instance SchemaType EuropeanExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (EuropeanExercise a0)+ `apply` parseSchemaType "expirationDate"+ `apply` optional (parseSchemaType "relevantUnderlyingDate")+ `apply` optional (parseSchemaType "earliestExerciseTime")+ `apply` optional (parseSchemaType "expirationTime")+ `apply` optional (parseSchemaType "partialExercise")+ `apply` optional (parseSchemaType "exerciseFee")+ schemaTypeToXML s x@EuropeanExercise{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ europExerc_ID x+ ]+ [ schemaTypeToXML "expirationDate" $ europExerc_expirationDate x+ , maybe [] (schemaTypeToXML "relevantUnderlyingDate") $ europExerc_relevantUnderlyingDate x+ , maybe [] (schemaTypeToXML "earliestExerciseTime") $ europExerc_earliestExerciseTime x+ , maybe [] (schemaTypeToXML "expirationTime") $ europExerc_expirationTime x+ , maybe [] (schemaTypeToXML "partialExercise") $ europExerc_partialExercise x+ , maybe [] (schemaTypeToXML "exerciseFee") $ europExerc_exerciseFee x+ ]+instance Extension EuropeanExercise Exercise where+ supertype v = Exercise_EuropeanExercise v+ +-- | A short form unique identifier for an exchange. If the +-- element is not present then the exchange shall be the +-- primary exchange on which the underlying is listed. The +-- term "Exchange" is assumed to have the meaning as defined +-- in the ISDA 2002 Equity Derivatives Definitions.+data ExchangeId = ExchangeId Scheme ExchangeIdAttributes deriving (Eq,Show)+data ExchangeIdAttributes = ExchangeIdAttributes+ { exchIdAttrib_exchangeIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ExchangeId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "exchangeIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ExchangeId v (ExchangeIdAttributes a0)+ schemaTypeToXML s (ExchangeId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "exchangeIdScheme") $ exchIdAttrib_exchangeIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ExchangeId Scheme where+ supertype (ExchangeId s _) = s+ +-- | The abstract base class for all types which define way in +-- which options may be exercised.+data Exercise+ = Exercise_SharedAmericanExercise SharedAmericanExercise+ | Exercise_EuropeanExercise EuropeanExercise+ | Exercise_BermudaExercise BermudaExercise+ | Exercise_AmericanExercise AmericanExercise+ | Exercise_FxEuropeanExercise FxEuropeanExercise+ | Exercise_FxDigitalAmericanExercise FxDigitalAmericanExercise+ | Exercise_CommodityPhysicalEuropeanExercise CommodityPhysicalEuropeanExercise+ | Exercise_CommodityPhysicalAmericanExercise CommodityPhysicalAmericanExercise+ | Exercise_CommodityEuropeanExercise CommodityEuropeanExercise+ | Exercise_CommodityAmericanExercise CommodityAmericanExercise+ | Exercise_EquityEuropeanExercise EquityEuropeanExercise+ + deriving (Eq,Show)+instance SchemaType Exercise where+ parseSchemaType s = do+ (fmap Exercise_SharedAmericanExercise $ parseSchemaType s)+ `onFail`+ (fmap Exercise_EuropeanExercise $ parseSchemaType s)+ `onFail`+ (fmap Exercise_BermudaExercise $ parseSchemaType s)+ `onFail`+ (fmap Exercise_AmericanExercise $ parseSchemaType s)+ `onFail`+ (fmap Exercise_FxEuropeanExercise $ parseSchemaType s)+ `onFail`+ (fmap Exercise_FxDigitalAmericanExercise $ parseSchemaType s)+ `onFail`+ (fmap Exercise_CommodityPhysicalEuropeanExercise $ parseSchemaType s)+ `onFail`+ (fmap Exercise_CommodityPhysicalAmericanExercise $ parseSchemaType s)+ `onFail`+ (fmap Exercise_CommodityEuropeanExercise $ parseSchemaType s)+ `onFail`+ (fmap Exercise_CommodityAmericanExercise $ parseSchemaType s)+ `onFail`+ (fmap Exercise_EquityEuropeanExercise $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of Exercise,\n\+\ namely one of:\n\+\SharedAmericanExercise,EuropeanExercise,BermudaExercise,AmericanExercise,FxEuropeanExercise,FxDigitalAmericanExercise,CommodityPhysicalEuropeanExercise,CommodityPhysicalAmericanExercise,CommodityEuropeanExercise,CommodityAmericanExercise,EquityEuropeanExercise"+ schemaTypeToXML _s (Exercise_SharedAmericanExercise x) = schemaTypeToXML "sharedAmericanExercise" x+ schemaTypeToXML _s (Exercise_EuropeanExercise x) = schemaTypeToXML "europeanExercise" x+ schemaTypeToXML _s (Exercise_BermudaExercise x) = schemaTypeToXML "bermudaExercise" x+ schemaTypeToXML _s (Exercise_AmericanExercise x) = schemaTypeToXML "americanExercise" x+ schemaTypeToXML _s (Exercise_FxEuropeanExercise x) = schemaTypeToXML "fxEuropeanExercise" x+ schemaTypeToXML _s (Exercise_FxDigitalAmericanExercise x) = schemaTypeToXML "fxDigitalAmericanExercise" x+ schemaTypeToXML _s (Exercise_CommodityPhysicalEuropeanExercise x) = schemaTypeToXML "commodityPhysicalEuropeanExercise" x+ schemaTypeToXML _s (Exercise_CommodityPhysicalAmericanExercise x) = schemaTypeToXML "commodityPhysicalAmericanExercise" x+ schemaTypeToXML _s (Exercise_CommodityEuropeanExercise x) = schemaTypeToXML "commodityEuropeanExercise" x+ schemaTypeToXML _s (Exercise_CommodityAmericanExercise x) = schemaTypeToXML "commodityAmericanExercise" x+ schemaTypeToXML _s (Exercise_EquityEuropeanExercise x) = schemaTypeToXML "equityEuropeanExercise" x+ +-- | A type defining the fee payable on exercise of an option. +-- This fee may be defined as an amount or a percentage of the +-- notional exercised.+data ExerciseFee = ExerciseFee+ { exerciseFee_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , exerciseFee_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , exerciseFee_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , exerciseFee_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , exerciseFee_notionalReference :: Maybe NotionalReference+ -- ^ A pointer style reference to the associated notional + -- schedule defined elsewhere in the document.+ , exerciseFee_choice5 :: (Maybe (OneOf2 Xsd.Decimal Xsd.Decimal))+ -- ^ Choice between:+ -- + -- (1) The amount of fee to be paid on exercise. The fee + -- currency is that of the referenced notional.+ -- + -- (2) A fee represented as a percentage of some referenced + -- notional. A percentage of 5% would be represented as + -- 0.05.+ , exerciseFee_feePaymentDate :: Maybe RelativeDateOffset+ -- ^ The date on which exercise fee(s) will be paid. It is + -- specified as a relative date.+ }+ deriving (Eq,Show)+instance SchemaType ExerciseFee where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ExerciseFee+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "notionalReference")+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "feeAmount"))+ , ("Xsd.Decimal", fmap TwoOf2 (parseSchemaType "feeRate"))+ ])+ `apply` optional (parseSchemaType "feePaymentDate")+ schemaTypeToXML s x@ExerciseFee{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ exerciseFee_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ exerciseFee_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ exerciseFee_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ exerciseFee_receiverAccountReference x+ , maybe [] (schemaTypeToXML "notionalReference") $ exerciseFee_notionalReference x+ , maybe [] (foldOneOf2 (schemaTypeToXML "feeAmount")+ (schemaTypeToXML "feeRate")+ ) $ exerciseFee_choice5 x+ , maybe [] (schemaTypeToXML "feePaymentDate") $ exerciseFee_feePaymentDate x+ ]+ +-- | A type to define a fee or schedule of fees to be payable on +-- the exercise of an option. This fee may be defined as an +-- amount or a percentage of the notional exercised.+data ExerciseFeeSchedule = ExerciseFeeSchedule+ { exercFeeSched_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , exercFeeSched_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , exercFeeSched_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , exercFeeSched_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , exercFeeSched_notionalReference :: Maybe ScheduleReference+ -- ^ A pointer style reference to the associated notional + -- schedule defined elsewhere in the document.+ , exercFeeSched_choice5 :: (Maybe (OneOf2 AmountSchedule Schedule))+ -- ^ Choice between:+ -- + -- (1) The exercise fee amount schedule. The fees are + -- expressed as currency amounts. The currency of the fee + -- is assumed to be that of the notional schedule + -- referenced.+ -- + -- (2) The exercise free rate schedule. The fees are expressed + -- as percentage rates of the notional being exercised. + -- The currency of the fee is assumed to be that of the + -- notional schedule referenced.+ , exercFeeSched_feePaymentDate :: Maybe RelativeDateOffset+ -- ^ The date on which exercise fee(s) will be paid. It is + -- specified as a relative date.+ }+ deriving (Eq,Show)+instance SchemaType ExerciseFeeSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ExerciseFeeSchedule+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "notionalReference")+ `apply` optional (oneOf' [ ("AmountSchedule", fmap OneOf2 (parseSchemaType "feeAmountSchedule"))+ , ("Schedule", fmap TwoOf2 (parseSchemaType "feeRateSchedule"))+ ])+ `apply` optional (parseSchemaType "feePaymentDate")+ schemaTypeToXML s x@ExerciseFeeSchedule{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ exercFeeSched_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ exercFeeSched_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ exercFeeSched_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ exercFeeSched_receiverAccountReference x+ , maybe [] (schemaTypeToXML "notionalReference") $ exercFeeSched_notionalReference x+ , maybe [] (foldOneOf2 (schemaTypeToXML "feeAmountSchedule")+ (schemaTypeToXML "feeRateSchedule")+ ) $ exercFeeSched_choice5 x+ , maybe [] (schemaTypeToXML "feePaymentDate") $ exercFeeSched_feePaymentDate x+ ]+ +-- | A type defining to whom and where notice of execution +-- should be given. The partyReference refers to one of the +-- principal parties of the trade. If present the +-- exerciseNoticePartyReference refers to a party, other than +-- the principal party, to whome notice should be given.+data ExerciseNotice = ExerciseNotice+ { exercNotice_partyReference :: Maybe PartyReference+ -- ^ The party referenced has allocated the trade identifier.+ , exerciseNotice_partyReference :: Maybe PartyReference+ -- ^ The party referenced is the party to which notice of + -- exercise should be given by the buyer.+ , exercNotice_businessCenter :: Maybe BusinessCenter+ }+ deriving (Eq,Show)+instance SchemaType ExerciseNotice where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ExerciseNotice+ `apply` optional (parseSchemaType "partyReference")+ `apply` optional (parseSchemaType "exerciseNoticePartyReference")+ `apply` optional (parseSchemaType "businessCenter")+ schemaTypeToXML s x@ExerciseNotice{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "partyReference") $ exercNotice_partyReference x+ , maybe [] (schemaTypeToXML "exerciseNoticePartyReference") $ exerciseNotice_partyReference x+ , maybe [] (schemaTypeToXML "businessCenter") $ exercNotice_businessCenter x+ ]+ +-- | A type describing how notice of exercise should be given. +-- This can be either manual or automatic.+data ExerciseProcedure = ExerciseProcedure+ { exercProced_choice0 :: (Maybe (OneOf2 ManualExercise AutomaticExercise))+ -- ^ Choice between:+ -- + -- (1) Specifies that the notice of exercise must be given by + -- the buyer to the seller or seller's agent.+ -- + -- (2) If automatic is specified then the notional amount of + -- the underlying swap, not previously exercised under the + -- swaption will be automatically exercised at the + -- expriration time on the expiration date if at such time + -- the buyer is in-the-money, provided that the difference + -- between the settlement rate and the fixed rate under + -- the relevant underlying swap is not less than the + -- specified threshold rate. The term in-the-money is + -- assumed to have the meaning defining in the 2000 ISDA + -- Definitions, Section 17.4 In-the-money.+ , exercProced_followUpConfirmation :: Maybe Xsd.Boolean+ -- ^ A flag to indicate whether follow-up confirmation of + -- exercise (written or electronic) is required following + -- telephonic notice by the buyer to the seller or seller's + -- agent.+ , exercProced_limitedRightToConfirm :: Maybe Xsd.Boolean+ -- ^ Has the meaning defined as part of the 1997 ISDA Government + -- Bond Option Definitions, section 4.5 Limited Right to + -- Confirm Exercise. If present, (i) the Seller may request + -- the Buyer to confirm its intent if not done on or before + -- the expiration time on the Expiration date (ii) specific + -- rules will apply in relation to the settlement mode.+ , exercProced_splitTicket :: Maybe Xsd.Boolean+ -- ^ Typically applicable to the physical settlement of bond and + -- convertible bond options. If present, means that the Party + -- required to deliver the bonds will divide those to be + -- delivered as notifying party desires to facilitate delivery + -- obligations.+ }+ deriving (Eq,Show)+instance SchemaType ExerciseProcedure where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ExerciseProcedure+ `apply` optional (oneOf' [ ("ManualExercise", fmap OneOf2 (parseSchemaType "manualExercise"))+ , ("AutomaticExercise", fmap TwoOf2 (parseSchemaType "automaticExercise"))+ ])+ `apply` optional (parseSchemaType "followUpConfirmation")+ `apply` optional (parseSchemaType "limitedRightToConfirm")+ `apply` optional (parseSchemaType "splitTicket")+ schemaTypeToXML s x@ExerciseProcedure{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "manualExercise")+ (schemaTypeToXML "automaticExercise")+ ) $ exercProced_choice0 x+ , maybe [] (schemaTypeToXML "followUpConfirmation") $ exercProced_followUpConfirmation x+ , maybe [] (schemaTypeToXML "limitedRightToConfirm") $ exercProced_limitedRightToConfirm x+ , maybe [] (schemaTypeToXML "splitTicket") $ exercProced_splitTicket x+ ]+ +-- | A type describing how notice of exercise should be given. +-- This can be either manual or automatic.+data ExerciseProcedureOption = ExerciseProcedureOption+ { exercProcedOption_choice0 :: OneOf2 Empty Empty+ -- ^ Choice between:+ -- + -- (1) Specifies that the notice of exercise must be given by + -- the buyer to the seller or seller's agent.+ -- + -- (2) If automatic is specified then the notional amount of + -- the underlying swap, not previously exercised under the + -- swaption will be automatically exercised at the + -- expriration time on the expiration date if at such time + -- the buyer is in-the-money, provided that the difference + -- between the settlement rate and the fixed rate under + -- the relevant underlying swap is not less than the + -- specified threshold rate. The term in-the-money is + -- assumed to have the meaning defining in the 2000 ISDA + -- Definitions, Section 17.4 In-the-money.+ }+ deriving (Eq,Show)+instance SchemaType ExerciseProcedureOption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ExerciseProcedureOption+ `apply` oneOf' [ ("Empty", fmap OneOf2 (parseSchemaType "manualExercise"))+ , ("Empty", fmap TwoOf2 (parseSchemaType "automaticExercise"))+ ]+ schemaTypeToXML s x@ExerciseProcedureOption{} =+ toXMLElement s []+ [ foldOneOf2 (schemaTypeToXML "manualExercise")+ (schemaTypeToXML "automaticExercise")+ $ exercProcedOption_choice0 x+ ]+ +-- | A type defining a floating rate.+data FloatingRate = FloatingRate+ { floatingRate_ID :: Maybe Xsd.ID+ , floatingRate_index :: FloatingRateIndex+ , floatingRate_indexTenor :: Maybe Period+ -- ^ The ISDA Designated Maturity, i.e. the tenor of the + -- floating rate.+ , floatingRate_multiplierSchedule :: Maybe Schedule+ -- ^ A rate multiplier or multiplier schedule to apply to the + -- floating rate. A multiplier schedule is expressed as + -- explicit multipliers and dates. In the case of a schedule, + -- the step dates may be subject to adjustment in accordance + -- with any adjustments specified in the + -- calculationPeriodDatesAdjustments. The multiplier can be a + -- positive or negative decimal. This element should only be + -- included if the multiplier is not equal to 1 (one) for the + -- term of the stream.+ , floatingRate_spreadSchedule :: [SpreadSchedule]+ -- ^ The ISDA Spread or a Spread schedule expressed as explicit + -- spreads and dates. In the case of a schedule, the step + -- dates may be subject to adjustment in accordance with any + -- adjustments specified in calculationPeriodDatesAdjustments. + -- The spread is a per annum rate, expressed as a decimal. For + -- purposes of determining a calculation period amount, if + -- positive the spread will be added to the floating rate and + -- if negative the spread will be subtracted from the floating + -- rate. A positive 10 basis point (0.1%) spread would be + -- represented as 0.001.+ , floatingRate_rateTreatment :: Maybe RateTreatmentEnum+ -- ^ The specification of any rate conversion which needs to be + -- applied to the observed rate before being used in any + -- calculations. The two common conversions are for securities + -- quoted on a bank discount basis which will need to be + -- converted to either a Money Market Yield or Bond Equivalent + -- Yield. See the Annex to the 2000 ISDA Definitions, Section + -- 7.3. Certain General Definitions Relating to Floating Rate + -- Options, paragraphs (g) and (h) for definitions of these + -- terms.+ , floatingRate_capRateSchedule :: [StrikeSchedule]+ -- ^ The cap rate or cap rate schedule, if any, which applies to + -- the floating rate. The cap rate (strike) is only required + -- where the floating rate on a swap stream is capped at a + -- certain level. A cap rate schedule is expressed as explicit + -- cap rates and dates and the step dates may be subject to + -- adjustment in accordance with any adjustments specified in + -- calculationPeriodDatesAdjustments. The cap rate is assumed + -- to be exclusive of any spread and is a per annum rate, + -- expressed as a decimal. A cap rate of 5% would be + -- represented as 0.05.+ , floatingRate_floorRateSchedule :: [StrikeSchedule]+ -- ^ The floor rate or floor rate schedule, if any, which + -- applies to the floating rate. The floor rate (strike) is + -- only required where the floating rate on a swap stream is + -- floored at a certain strike level. A floor rate schedule is + -- expressed as explicit floor rates and dates and the step + -- dates may be subject to adjustment in accordance with any + -- adjustments specified in calculationPeriodDatesAdjustments. + -- The floor rate is assumed to be exclusive of any spread and + -- is a per annum rate, expressed as a decimal. A floor rate + -- of 5% would be represented as 0.05.+ }+ deriving (Eq,Show)+instance SchemaType FloatingRate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FloatingRate a0)+ `apply` parseSchemaType "floatingRateIndex"+ `apply` optional (parseSchemaType "indexTenor")+ `apply` optional (parseSchemaType "floatingRateMultiplierSchedule")+ `apply` many (parseSchemaType "spreadSchedule")+ `apply` optional (parseSchemaType "rateTreatment")+ `apply` many (parseSchemaType "capRateSchedule")+ `apply` many (parseSchemaType "floorRateSchedule")+ schemaTypeToXML s x@FloatingRate{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ floatingRate_ID x+ ]+ [ schemaTypeToXML "floatingRateIndex" $ floatingRate_index x+ , maybe [] (schemaTypeToXML "indexTenor") $ floatingRate_indexTenor x+ , maybe [] (schemaTypeToXML "floatingRateMultiplierSchedule") $ floatingRate_multiplierSchedule x+ , concatMap (schemaTypeToXML "spreadSchedule") $ floatingRate_spreadSchedule x+ , maybe [] (schemaTypeToXML "rateTreatment") $ floatingRate_rateTreatment x+ , concatMap (schemaTypeToXML "capRateSchedule") $ floatingRate_capRateSchedule x+ , concatMap (schemaTypeToXML "floorRateSchedule") $ floatingRate_floorRateSchedule x+ ]+instance Extension FloatingRate Rate where+ supertype v = Rate_FloatingRate v+ +-- | A type defining the floating rate and definitions relating +-- to the calculation of floating rate amounts.+data FloatingRateCalculation = FloatingRateCalculation+ { floatRateCalc_ID :: Maybe Xsd.ID+ , floatRateCalc_floatingRateIndex :: FloatingRateIndex+ , floatRateCalc_indexTenor :: Maybe Period+ -- ^ The ISDA Designated Maturity, i.e. the tenor of the + -- floating rate.+ , floatRateCalc_floatingRateMultiplierSchedule :: Maybe Schedule+ -- ^ A rate multiplier or multiplier schedule to apply to the + -- floating rate. A multiplier schedule is expressed as + -- explicit multipliers and dates. In the case of a schedule, + -- the step dates may be subject to adjustment in accordance + -- with any adjustments specified in the + -- calculationPeriodDatesAdjustments. The multiplier can be a + -- positive or negative decimal. This element should only be + -- included if the multiplier is not equal to 1 (one) for the + -- term of the stream.+ , floatRateCalc_spreadSchedule :: [SpreadSchedule]+ -- ^ The ISDA Spread or a Spread schedule expressed as explicit + -- spreads and dates. In the case of a schedule, the step + -- dates may be subject to adjustment in accordance with any + -- adjustments specified in calculationPeriodDatesAdjustments. + -- The spread is a per annum rate, expressed as a decimal. For + -- purposes of determining a calculation period amount, if + -- positive the spread will be added to the floating rate and + -- if negative the spread will be subtracted from the floating + -- rate. A positive 10 basis point (0.1%) spread would be + -- represented as 0.001.+ , floatRateCalc_rateTreatment :: Maybe RateTreatmentEnum+ -- ^ The specification of any rate conversion which needs to be + -- applied to the observed rate before being used in any + -- calculations. The two common conversions are for securities + -- quoted on a bank discount basis which will need to be + -- converted to either a Money Market Yield or Bond Equivalent + -- Yield. See the Annex to the 2000 ISDA Definitions, Section + -- 7.3. Certain General Definitions Relating to Floating Rate + -- Options, paragraphs (g) and (h) for definitions of these + -- terms.+ , floatRateCalc_capRateSchedule :: [StrikeSchedule]+ -- ^ The cap rate or cap rate schedule, if any, which applies to + -- the floating rate. The cap rate (strike) is only required + -- where the floating rate on a swap stream is capped at a + -- certain level. A cap rate schedule is expressed as explicit + -- cap rates and dates and the step dates may be subject to + -- adjustment in accordance with any adjustments specified in + -- calculationPeriodDatesAdjustments. The cap rate is assumed + -- to be exclusive of any spread and is a per annum rate, + -- expressed as a decimal. A cap rate of 5% would be + -- represented as 0.05.+ , floatRateCalc_floorRateSchedule :: [StrikeSchedule]+ -- ^ The floor rate or floor rate schedule, if any, which + -- applies to the floating rate. The floor rate (strike) is + -- only required where the floating rate on a swap stream is + -- floored at a certain strike level. A floor rate schedule is + -- expressed as explicit floor rates and dates and the step + -- dates may be subject to adjustment in accordance with any + -- adjustments specified in calculationPeriodDatesAdjustments. + -- The floor rate is assumed to be exclusive of any spread and + -- is a per annum rate, expressed as a decimal. A floor rate + -- of 5% would be represented as 0.05.+ , floatRateCalc_initialRate :: Maybe Xsd.Decimal+ -- ^ The initial floating rate reset agreed between the + -- principal parties involved in the trade. This is assumed to + -- be the first required reset rate for the first regular + -- calculation period. It should only be included when the + -- rate is not equal to the rate published on the source + -- implied by the floating rate index. An initial rate of 5% + -- would be represented as 0.05.+ , floatRateCalc_finalRateRounding :: Maybe Rounding+ -- ^ The rounding convention to apply to the final rate used in + -- determination of a calculation period amount.+ , floatRateCalc_averagingMethod :: Maybe AveragingMethodEnum+ -- ^ If averaging is applicable, this component specifies + -- whether a weighted or unweighted average method of + -- calculation is to be used. The component must only be + -- included when averaging applies.+ , floatRateCalc_negativeInterestRateTreatment :: Maybe NegativeInterestRateTreatmentEnum+ -- ^ The specification of any provisions for calculating payment + -- obligations when a floating rate is negative (either due to + -- a quoted negative floating rate or by operation of a spread + -- that is subtracted from the floating rate).+ }+ deriving (Eq,Show)+instance SchemaType FloatingRateCalculation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FloatingRateCalculation a0)+ `apply` parseSchemaType "floatingRateIndex"+ `apply` optional (parseSchemaType "indexTenor")+ `apply` optional (parseSchemaType "floatingRateMultiplierSchedule")+ `apply` many (parseSchemaType "spreadSchedule")+ `apply` optional (parseSchemaType "rateTreatment")+ `apply` many (parseSchemaType "capRateSchedule")+ `apply` many (parseSchemaType "floorRateSchedule")+ `apply` optional (parseSchemaType "initialRate")+ `apply` optional (parseSchemaType "finalRateRounding")+ `apply` optional (parseSchemaType "averagingMethod")+ `apply` optional (parseSchemaType "negativeInterestRateTreatment")+ schemaTypeToXML s x@FloatingRateCalculation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ floatRateCalc_ID x+ ]+ [ schemaTypeToXML "floatingRateIndex" $ floatRateCalc_floatingRateIndex x+ , maybe [] (schemaTypeToXML "indexTenor") $ floatRateCalc_indexTenor x+ , maybe [] (schemaTypeToXML "floatingRateMultiplierSchedule") $ floatRateCalc_floatingRateMultiplierSchedule x+ , concatMap (schemaTypeToXML "spreadSchedule") $ floatRateCalc_spreadSchedule x+ , maybe [] (schemaTypeToXML "rateTreatment") $ floatRateCalc_rateTreatment x+ , concatMap (schemaTypeToXML "capRateSchedule") $ floatRateCalc_capRateSchedule x+ , concatMap (schemaTypeToXML "floorRateSchedule") $ floatRateCalc_floorRateSchedule x+ , maybe [] (schemaTypeToXML "initialRate") $ floatRateCalc_initialRate x+ , maybe [] (schemaTypeToXML "finalRateRounding") $ floatRateCalc_finalRateRounding x+ , maybe [] (schemaTypeToXML "averagingMethod") $ floatRateCalc_averagingMethod x+ , maybe [] (schemaTypeToXML "negativeInterestRateTreatment") $ floatRateCalc_negativeInterestRateTreatment x+ ]+instance Extension FloatingRateCalculation FloatingRate where+ supertype (FloatingRateCalculation a0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10) =+ FloatingRate a0 e0 e1 e2 e3 e4 e5 e6+instance Extension FloatingRateCalculation Rate where+ supertype = (supertype :: FloatingRate -> Rate)+ . (supertype :: FloatingRateCalculation -> FloatingRate)+ + +-- | The ISDA Floating Rate Option, i.e. the floating rate +-- index.+data FloatingRateIndex = FloatingRateIndex Scheme FloatingRateIndexAttributes deriving (Eq,Show)+data FloatingRateIndexAttributes = FloatingRateIndexAttributes+ { floatRateIndexAttrib_floatingRateIndexScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType FloatingRateIndex where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "floatingRateIndexScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ FloatingRateIndex v (FloatingRateIndexAttributes a0)+ schemaTypeToXML s (FloatingRateIndex bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "floatingRateIndexScheme") $ floatRateIndexAttrib_floatingRateIndexScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension FloatingRateIndex Scheme where+ supertype (FloatingRateIndex s _) = s+ +-- | A type defining a rate index.+data ForecastRateIndex = ForecastRateIndex+ { forecRateIndex_floatingRateIndex :: Maybe FloatingRateIndex+ -- ^ The ISDA Floating Rate Option, i.e. the floating rate + -- index.+ , forecRateIndex_indexTenor :: Maybe Period+ -- ^ The ISDA Designated Maturity, i.e. the tenor of the + -- floating rate.+ }+ deriving (Eq,Show)+instance SchemaType ForecastRateIndex where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ForecastRateIndex+ `apply` optional (parseSchemaType "floatingRateIndex")+ `apply` optional (parseSchemaType "indexTenor")+ schemaTypeToXML s x@ForecastRateIndex{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "floatingRateIndex") $ forecRateIndex_floatingRateIndex x+ , maybe [] (schemaTypeToXML "indexTenor") $ forecRateIndex_indexTenor x+ ]+ +-- | A type describing a financial formula, with its description +-- and components.+data Formula = Formula+ { formula_description :: Maybe Xsd.XsdString+ -- ^ Text description of the formula+ , formula_math :: Maybe Math+ -- ^ An element for containing an XML representation of the + -- formula. Defined using xsd:any currently for flexibility in + -- choice of language (MathML, OpenMath)+ , formula_component :: [FormulaComponent]+ -- ^ Elements describing the components of the formula. The name + -- attribute points to a value used in the math element. The + -- href attribute points to a value elsewhere in the document+ }+ deriving (Eq,Show)+instance SchemaType Formula where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Formula+ `apply` optional (parseSchemaType "formulaDescription")+ `apply` optional (parseSchemaType "math")+ `apply` many (parseSchemaType "formulaComponent")+ schemaTypeToXML s x@Formula{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "formulaDescription") $ formula_description x+ , maybe [] (schemaTypeToXML "math") $ formula_math x+ , concatMap (schemaTypeToXML "formulaComponent") $ formula_component x+ ]+ +-- | Elements describing the components of the formula. The name +-- attribute points to a value used in the math element. The +-- href attribute points to a numeric value defined elsewhere +-- in the document that is used by the formula component.+data FormulaComponent = FormulaComponent+ { formulaCompon_name :: Maybe Xsd.NormalizedString+ , formulaCompon_componentDescription :: Maybe Xsd.XsdString+ -- ^ Text description of the component+ , formulaCompon_formula :: Maybe Formula+ -- ^ Additional formulas required to describe this component+ }+ deriving (Eq,Show)+instance SchemaType FormulaComponent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "name" e pos+ commit $ interior e $ return (FormulaComponent a0)+ `apply` optional (parseSchemaType "componentDescription")+ `apply` optional (parseSchemaType "formula")+ schemaTypeToXML s x@FormulaComponent{} =+ toXMLElement s [ maybe [] (toXMLAttribute "name") $ formulaCompon_name x+ ]+ [ maybe [] (schemaTypeToXML "componentDescription") $ formulaCompon_componentDescription x+ , maybe [] (schemaTypeToXML "formula") $ formulaCompon_formula x+ ]+ +-- | A type defining a time frequency, e.g. one day, three +-- months. Used for specifying payment or calculation +-- frequencies at which the value T (Term) is applicable.+data Frequency = Frequency+ { frequency_ID :: Maybe Xsd.ID+ , frequency_periodMultiplier :: Maybe Xsd.PositiveInteger+ -- ^ A time period multiplier, e.g. 1, 2 or 3 etc. If the period + -- value is T (Term) then periodMultiplier must contain the + -- value 1.+ , frequency_period :: Maybe PeriodExtendedEnum+ -- ^ A time period, e.g. a day, week, month, year or term of the + -- stream.+ }+ deriving (Eq,Show)+instance SchemaType Frequency where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Frequency a0)+ `apply` optional (parseSchemaType "periodMultiplier")+ `apply` optional (parseSchemaType "period")+ schemaTypeToXML s x@Frequency{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ frequency_ID x+ ]+ [ maybe [] (schemaTypeToXML "periodMultiplier") $ frequency_periodMultiplier x+ , maybe [] (schemaTypeToXML "period") $ frequency_period x+ ]+ +-- | A type defining a currency amount as at a future value +-- date.+data FutureValueAmount = FutureValueAmount+ { futureValueAmount_ID :: Maybe Xsd.ID+ , futureValueAmount_currency :: Currency+ -- ^ The currency in which an amount is denominated.+ , futureValueAmount_amount :: NonNegativeDecimal+ -- ^ The non negative monetary quantity in currency units.+ , futureValueAmount_calculationPeriodNumberOfDays :: Maybe Xsd.PositiveInteger+ -- ^ The number of days from the adjusted calculation period + -- start date to the adjusted value date, calculated in + -- accordance with the applicable day count fraction.+ , futureValueAmount_valueDate :: Maybe Xsd.Date+ -- ^ Adjusted value date of the future value amount.+ }+ deriving (Eq,Show)+instance SchemaType FutureValueAmount where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FutureValueAmount a0)+ `apply` parseSchemaType "currency"+ `apply` parseSchemaType "amount"+ `apply` optional (parseSchemaType "calculationPeriodNumberOfDays")+ `apply` optional (parseSchemaType "valueDate")+ schemaTypeToXML s x@FutureValueAmount{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ futureValueAmount_ID x+ ]+ [ schemaTypeToXML "currency" $ futureValueAmount_currency x+ , schemaTypeToXML "amount" $ futureValueAmount_amount x+ , maybe [] (schemaTypeToXML "calculationPeriodNumberOfDays") $ futureValueAmount_calculationPeriodNumberOfDays x+ , maybe [] (schemaTypeToXML "valueDate") $ futureValueAmount_valueDate x+ ]+instance Extension FutureValueAmount NonNegativeMoney where+ supertype (FutureValueAmount a0 e0 e1 e2 e3) =+ NonNegativeMoney a0 e0 e1+instance Extension FutureValueAmount MoneyBase where+ supertype = (supertype :: NonNegativeMoney -> MoneyBase)+ . (supertype :: FutureValueAmount -> NonNegativeMoney)+ + +-- | A type that specifies the source for and timing of a fixing +-- of an exchange rate. This is used in the agreement of +-- non-deliverable forward trades as well as various types of +-- FX OTC options that require observations against a +-- particular rate.+data FxFixing = FxFixing+ { fxFixing_quotedCurrencyPair :: Maybe QuotedCurrencyPair+ -- ^ Defines the two currencies for an FX trade and the + -- quotation relationship between the two currencies.+ , fxFixing_fixingDate :: Maybe Xsd.Date+ -- ^ Describes the specific date when a non-deliverable forward + -- or cash-settled option will "fix" against a particular + -- rate, which will be used to compute the ultimate cash + -- settlement. This element should be omitted where a single, + -- discrete fixing date cannot be identified e.g. on an + -- american option, where fixing may occur at any date on a + -- continuous range.+ , fxFixing_fxSpotRateSource :: Maybe FxSpotRateSource+ -- ^ Specifies the methodology (reference source and, + -- optionally, fixing time) to be used for determining a + -- currency conversion rate.+ }+ deriving (Eq,Show)+instance SchemaType FxFixing where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxFixing+ `apply` optional (parseSchemaType "quotedCurrencyPair")+ `apply` optional (parseSchemaType "fixingDate")+ `apply` optional (parseSchemaType "fxSpotRateSource")+ schemaTypeToXML s x@FxFixing{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "quotedCurrencyPair") $ fxFixing_quotedCurrencyPair x+ , maybe [] (schemaTypeToXML "fixingDate") $ fxFixing_fixingDate x+ , maybe [] (schemaTypeToXML "fxSpotRateSource") $ fxFixing_fxSpotRateSource x+ ]+ +-- | A type that is used for describing cash settlement of an +-- option / non deliverable forward. It includes the currency +-- to settle into together with the fixings required to +-- calculate the currency amount.+data FxCashSettlement = FxCashSettlement+ { fxCashSettl_settlementCurrency :: Maybe Currency+ -- ^ The currency in which cash settlement occurs for + -- non-deliverable forwards and cash-settled options + -- (non-deliverable or otherwise).+ , fxCashSettl_fixing :: [FxFixing]+ -- ^ Specifies the source for and timing of a fixing of an + -- exchange rate. This is used in the agreement of + -- non-deliverable forward trades as well as various types of + -- FX OTC options that require observations against a + -- particular rate. This element is optional, permitting it to + -- be omitted where fixing details are unavailable at the + -- point of message creation. It has multiple occurrence to + -- support the case where fixing details must be specified for + -- more than one currency pair e.g. on an option settled into + -- a third currency (that is not one of the option + -- currencies).+ }+ deriving (Eq,Show)+instance SchemaType FxCashSettlement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxCashSettlement+ `apply` optional (parseSchemaType "settlementCurrency")+ `apply` many (parseSchemaType "fixing")+ schemaTypeToXML s x@FxCashSettlement{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "settlementCurrency") $ fxCashSettl_settlementCurrency x+ , concatMap (schemaTypeToXML "fixing") $ fxCashSettl_fixing x+ ]+ +-- | A type describing the rate of a currency conversion: pair +-- of currency, quotation mode and exchange rate.+data FxRate = FxRate+ { fxRate_quotedCurrencyPair :: Maybe QuotedCurrencyPair+ -- ^ Defines the two currencies for an FX trade and the + -- quotation relationship between the two currencies.+ , fxRate_rate :: Maybe Xsd.Decimal+ -- ^ The rate of exchange between the two currencies of the leg + -- of a deal. Must be specified with a quote basis.+ }+ deriving (Eq,Show)+instance SchemaType FxRate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxRate+ `apply` optional (parseSchemaType "quotedCurrencyPair")+ `apply` optional (parseSchemaType "rate")+ schemaTypeToXML s x@FxRate{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "quotedCurrencyPair") $ fxRate_quotedCurrencyPair x+ , maybe [] (schemaTypeToXML "rate") $ fxRate_rate x+ ]+ +-- | A type defining the source and time for an fx rate.+data FxSpotRateSource = FxSpotRateSource+ { fxSpotRateSource_primaryRateSource :: Maybe InformationSource+ -- ^ The primary source for where the rate observation will + -- occur. Will typically be either a page or a reference bank + -- published rate.+ , fxSpotRateSource_secondaryRateSource :: Maybe InformationSource+ -- ^ An alternative, or secondary, source for where the rate + -- observation will occur. Will typically be either a page or + -- a reference bank published rate.+ , fxSpotRateSource_fixingTime :: Maybe BusinessCenterTime+ -- ^ The time at which the spot currency exchange rate will be + -- observed. It is specified as a time in a business day + -- calendar location, e.g. 11:00am London time.+ }+ deriving (Eq,Show)+instance SchemaType FxSpotRateSource where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxSpotRateSource+ `apply` optional (parseSchemaType "primaryRateSource")+ `apply` optional (parseSchemaType "secondaryRateSource")+ `apply` optional (parseSchemaType "fixingTime")+ schemaTypeToXML s x@FxSpotRateSource{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "primaryRateSource") $ fxSpotRateSource_primaryRateSource x+ , maybe [] (schemaTypeToXML "secondaryRateSource") $ fxSpotRateSource_secondaryRateSource x+ , maybe [] (schemaTypeToXML "fixingTime") $ fxSpotRateSource_fixingTime x+ ]+ +-- | An entity for defining a generic agreement executed between +-- two parties for any purpose.+data GenericAgreement = GenericAgreement+ { genericAgreem_type :: Maybe AgreementType+ -- ^ The type of agreement executed between the parties.+ , genericAgreem_version :: Maybe AgreementVersion+ -- ^ The version of the agreement.+ , genericAgreem_date :: Maybe Xsd.Date+ -- ^ The date on which the agreement was signed.+ , genericAgreem_amendmentDate :: [Xsd.Date]+ -- ^ A date on which the agreement was amended.+ , genericAgreem_governingLaw :: Maybe GoverningLaw+ -- ^ Identification of the law governing the agreement.+ }+ deriving (Eq,Show)+instance SchemaType GenericAgreement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return GenericAgreement+ `apply` optional (parseSchemaType "type")+ `apply` optional (parseSchemaType "version")+ `apply` optional (parseSchemaType "date")+ `apply` many (parseSchemaType "amendmentDate")+ `apply` optional (parseSchemaType "governingLaw")+ schemaTypeToXML s x@GenericAgreement{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "type") $ genericAgreem_type x+ , maybe [] (schemaTypeToXML "version") $ genericAgreem_version x+ , maybe [] (schemaTypeToXML "date") $ genericAgreem_date x+ , concatMap (schemaTypeToXML "amendmentDate") $ genericAgreem_amendmentDate x+ , maybe [] (schemaTypeToXML "governingLaw") $ genericAgreem_governingLaw x+ ]+ +-- | Identification of the law governing the transaction.+data GoverningLaw = GoverningLaw Scheme GoverningLawAttributes deriving (Eq,Show)+data GoverningLawAttributes = GoverningLawAttributes+ { governLawAttrib_governingLawScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType GoverningLaw where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "governingLawScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ GoverningLaw v (GoverningLawAttributes a0)+ schemaTypeToXML s (GoverningLaw bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "governingLawScheme") $ governLawAttrib_governingLawScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension GoverningLaw Scheme where+ supertype (GoverningLaw s _) = s+ +-- | A payment component owed from one party to the other for +-- the cash flow date. This payment component should by of +-- only a single type, e.g. a fee or a cashflow from a +-- cashflow stream.+data GrossCashflow = GrossCashflow+ { grossCashfl_cashflowId :: Maybe CashflowId+ -- ^ Unique identifier for a cash flow.+ , grossCashfl_partyTradeIdentifierReference :: Maybe PartyTradeIdentifierReference+ -- ^ Pointer-style reference to the partyTradeIdentifier block + -- within the tradeIdentifyingItems collection, which + -- identifies the parent trade for this cashflow.+ , grossCashfl_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , grossCashfl_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , grossCashfl_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , grossCashfl_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , grossCashfl_cashflowAmount :: Maybe Money+ -- ^ Cash flow amount in a given currency to be paid/received.+ , grossCashfl_cashflowType :: Maybe CashflowType+ -- ^ Defines the type of cash flow. For instance, a type of fee, + -- premium, principal exchange, leg fee.+ }+ deriving (Eq,Show)+instance SchemaType GrossCashflow where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return GrossCashflow+ `apply` optional (parseSchemaType "cashflowId")+ `apply` optional (parseSchemaType "partyTradeIdentifierReference")+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "cashflowAmount")+ `apply` optional (parseSchemaType "cashflowType")+ schemaTypeToXML s x@GrossCashflow{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "cashflowId") $ grossCashfl_cashflowId x+ , maybe [] (schemaTypeToXML "partyTradeIdentifierReference") $ grossCashfl_partyTradeIdentifierReference x+ , maybe [] (schemaTypeToXML "payerPartyReference") $ grossCashfl_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ grossCashfl_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ grossCashfl_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ grossCashfl_receiverAccountReference x+ , maybe [] (schemaTypeToXML "cashflowAmount") $ grossCashfl_cashflowAmount x+ , maybe [] (schemaTypeToXML "cashflowType") $ grossCashfl_cashflowType x+ ]+ +-- | Specifies Currency with ID attribute.+data IdentifiedCurrency = IdentifiedCurrency Currency IdentifiedCurrencyAttributes deriving (Eq,Show)+data IdentifiedCurrencyAttributes = IdentifiedCurrencyAttributes+ { identCurrenAttrib_ID :: Maybe Xsd.ID+ }+ deriving (Eq,Show)+instance SchemaType IdentifiedCurrency where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "id" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ IdentifiedCurrency v (IdentifiedCurrencyAttributes a0)+ schemaTypeToXML s (IdentifiedCurrency bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "id") $ identCurrenAttrib_ID at+ ]+ $ schemaTypeToXML s bt+instance Extension IdentifiedCurrency Currency where+ supertype (IdentifiedCurrency s _) = s+ +-- | Reference to a currency with ID attribute+data IdentifiedCurrencyReference = IdentifiedCurrencyReference+ { identCurrenRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType IdentifiedCurrencyReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (IdentifiedCurrencyReference a0)+ schemaTypeToXML s x@IdentifiedCurrencyReference{} =+ toXMLElement s [ toXMLAttribute "href" $ identCurrenRef_href x+ ]+ []+instance Extension IdentifiedCurrencyReference Reference where+ supertype v = Reference_IdentifiedCurrencyReference v+ +-- | A date which can be referenced elsewhere.+data IdentifiedDate = IdentifiedDate Xsd.Date IdentifiedDateAttributes deriving (Eq,Show)+data IdentifiedDateAttributes = IdentifiedDateAttributes+ { identDateAttrib_ID :: Maybe Xsd.ID+ }+ deriving (Eq,Show)+instance SchemaType IdentifiedDate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "id" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ IdentifiedDate v (IdentifiedDateAttributes a0)+ schemaTypeToXML s (IdentifiedDate bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "id") $ identDateAttrib_ID at+ ]+ $ schemaTypeToXML s bt+instance Extension IdentifiedDate Xsd.Date where+ supertype (IdentifiedDate s _) = s+ +-- | A type extending the PayerReceiverEnum type wih an id +-- attribute.+data IdentifiedPayerReceiver = IdentifiedPayerReceiver PayerReceiverEnum IdentifiedPayerReceiverAttributes deriving (Eq,Show)+data IdentifiedPayerReceiverAttributes = IdentifiedPayerReceiverAttributes+ { identPayerReceivAttrib_ID :: Maybe Xsd.ID+ }+ deriving (Eq,Show)+instance SchemaType IdentifiedPayerReceiver where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "id" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ IdentifiedPayerReceiver v (IdentifiedPayerReceiverAttributes a0)+ schemaTypeToXML s (IdentifiedPayerReceiver bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "id") $ identPayerReceivAttrib_ID at+ ]+ $ schemaTypeToXML s bt+instance Extension IdentifiedPayerReceiver PayerReceiverEnum where+ supertype (IdentifiedPayerReceiver s _) = s+ +-- | A party's industry sector classification.+data IndustryClassification = IndustryClassification Scheme IndustryClassificationAttributes deriving (Eq,Show)+data IndustryClassificationAttributes = IndustryClassificationAttributes+ { industClassAttrib_industryClassificationScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType IndustryClassification where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "industryClassificationScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ IndustryClassification v (IndustryClassificationAttributes a0)+ schemaTypeToXML s (IndustryClassification bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "industryClassificationScheme") $ industClassAttrib_industryClassificationScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension IndustryClassification Scheme where+ supertype (IndustryClassification s _) = s+ +data InformationProvider = InformationProvider Scheme InformationProviderAttributes deriving (Eq,Show)+data InformationProviderAttributes = InformationProviderAttributes+ { infoProvidAttrib_informationProviderScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType InformationProvider where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "informationProviderScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ InformationProvider v (InformationProviderAttributes a0)+ schemaTypeToXML s (InformationProvider bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "informationProviderScheme") $ infoProvidAttrib_informationProviderScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension InformationProvider Scheme where+ supertype (InformationProvider s _) = s+ +-- | A type defining the source for a piece of information (e.g. +-- a rate refix or an fx fixing).+data InformationSource = InformationSource+ { infoSource_rateSource :: Maybe InformationProvider+ -- ^ An information source for obtaining a market rate. For + -- example Bloomberg, Reuters, Telerate etc.+ , infoSource_rateSourcePage :: Maybe RateSourcePage+ -- ^ A specific page for the rate source for obtaining a market + -- rate.+ , infoSource_rateSourcePageHeading :: Maybe Xsd.XsdString+ -- ^ The heading for the rate source on a given rate source + -- page.+ }+ deriving (Eq,Show)+instance SchemaType InformationSource where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return InformationSource+ `apply` optional (parseSchemaType "rateSource")+ `apply` optional (parseSchemaType "rateSourcePage")+ `apply` optional (parseSchemaType "rateSourcePageHeading")+ schemaTypeToXML s x@InformationSource{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "rateSource") $ infoSource_rateSource x+ , maybe [] (schemaTypeToXML "rateSourcePage") $ infoSource_rateSourcePage x+ , maybe [] (schemaTypeToXML "rateSourcePageHeading") $ infoSource_rateSourcePageHeading x+ ]+ +-- | A short form unique identifier for a security.+data InstrumentId = InstrumentId Scheme InstrumentIdAttributes deriving (Eq,Show)+data InstrumentIdAttributes = InstrumentIdAttributes+ { instrIdAttrib_instrumentIdScheme :: Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType InstrumentId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- getAttribute "instrumentIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ InstrumentId v (InstrumentIdAttributes a0)+ schemaTypeToXML s (InstrumentId bt at) =+ addXMLAttributes [ toXMLAttribute "instrumentIdScheme" $ instrIdAttrib_instrumentIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension InstrumentId Scheme where+ supertype (InstrumentId s _) = s+ +-- | A type defining the way in which interests are accrued: the +-- applicable rate (fixed or floating reference) and the +-- compounding method.+data InterestAccrualsCompoundingMethod = InterestAccrualsCompoundingMethod+ { interAccruCompoMethod_choice0 :: OneOf2 FloatingRateCalculation Xsd.Decimal+ -- ^ Choice between:+ -- + -- (1) The floating rate calculation definitions+ -- + -- (2) The calculation period fixed rate. A per annum rate, + -- expressed as a decimal. A fixed rate of 5% would be + -- represented as 0.05.+ , interAccruCompoMethod_compoundingMethod :: Maybe CompoundingMethodEnum+ -- ^ If more that one calculation period contributes to a single + -- payment amount this element specifies whether compounding + -- is applicable, and if so, what compounding method is to be + -- used. This element must only be included when more that one + -- calculation period contributes to a single payment amount.+ }+ deriving (Eq,Show)+instance SchemaType InterestAccrualsCompoundingMethod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return InterestAccrualsCompoundingMethod+ `apply` oneOf' [ ("FloatingRateCalculation", fmap OneOf2 (parseSchemaType "floatingRateCalculation"))+ , ("Xsd.Decimal", fmap TwoOf2 (parseSchemaType "fixedRate"))+ ]+ `apply` optional (parseSchemaType "compoundingMethod")+ schemaTypeToXML s x@InterestAccrualsCompoundingMethod{} =+ toXMLElement s []+ [ foldOneOf2 (schemaTypeToXML "floatingRateCalculation")+ (schemaTypeToXML "fixedRate")+ $ interAccruCompoMethod_choice0 x+ , maybe [] (schemaTypeToXML "compoundingMethod") $ interAccruCompoMethod_compoundingMethod x+ ]+instance Extension InterestAccrualsCompoundingMethod InterestAccrualsMethod where+ supertype (InterestAccrualsCompoundingMethod e0 e1) =+ InterestAccrualsMethod e0+ +-- | A type describing the method for accruing interests on +-- dividends. Can be either a fixed rate reference or a +-- floating rate reference.+data InterestAccrualsMethod = InterestAccrualsMethod+ { interAccruMethod_choice0 :: OneOf2 FloatingRateCalculation Xsd.Decimal+ -- ^ Choice between:+ -- + -- (1) The floating rate calculation definitions+ -- + -- (2) The calculation period fixed rate. A per annum rate, + -- expressed as a decimal. A fixed rate of 5% would be + -- represented as 0.05.+ }+ deriving (Eq,Show)+instance SchemaType InterestAccrualsMethod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return InterestAccrualsMethod+ `apply` oneOf' [ ("FloatingRateCalculation", fmap OneOf2 (parseSchemaType "floatingRateCalculation"))+ , ("Xsd.Decimal", fmap TwoOf2 (parseSchemaType "fixedRate"))+ ]+ schemaTypeToXML s x@InterestAccrualsMethod{} =+ toXMLElement s []+ [ foldOneOf2 (schemaTypeToXML "floatingRateCalculation")+ (schemaTypeToXML "fixedRate")+ $ interAccruMethod_choice0 x+ ]+ +-- | A type that describes the information to identify an +-- intermediary through which payment will be made by the +-- correspondent bank to the ultimate beneficiary of the +-- funds.+data IntermediaryInformation = IntermediaryInformation+ { intermInfo_choice0 :: (Maybe (OneOf3 RoutingIds RoutingExplicitDetails RoutingIdsAndExplicitDetails))+ -- ^ Choice between:+ -- + -- (1) A set of unique identifiers for a party, eachone + -- identifying the party within a payment system. The + -- assumption is that each party will not have more than + -- one identifier within the same payment system.+ -- + -- (2) A set of details that is used to identify a party + -- involved in the routing of a payment when the party + -- does not have a code that identifies it within one of + -- the recognized payment systems.+ -- + -- (3) A combination of coded payment system identifiers and + -- details for physical addressing for a party involved in + -- the routing of a payment.+ , intermInfo_intermediarySequenceNumber :: Maybe Xsd.PositiveInteger+ -- ^ A sequence number that gives the position of the current + -- intermediary in the chain of payment intermediaries. The + -- assumed domain value set is an ascending sequence of + -- integers starting from 1.+ , intermInfo_intermediaryPartyReference :: Maybe PartyReference+ -- ^ Reference to the party acting as intermediary.+ }+ deriving (Eq,Show)+instance SchemaType IntermediaryInformation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return IntermediaryInformation+ `apply` optional (oneOf' [ ("RoutingIds", fmap OneOf3 (parseSchemaType "routingIds"))+ , ("RoutingExplicitDetails", fmap TwoOf3 (parseSchemaType "routingExplicitDetails"))+ , ("RoutingIdsAndExplicitDetails", fmap ThreeOf3 (parseSchemaType "routingIdsAndExplicitDetails"))+ ])+ `apply` optional (parseSchemaType "intermediarySequenceNumber")+ `apply` optional (parseSchemaType "intermediaryPartyReference")+ schemaTypeToXML s x@IntermediaryInformation{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "routingIds")+ (schemaTypeToXML "routingExplicitDetails")+ (schemaTypeToXML "routingIdsAndExplicitDetails")+ ) $ intermInfo_choice0 x+ , maybe [] (schemaTypeToXML "intermediarySequenceNumber") $ intermInfo_intermediarySequenceNumber x+ , maybe [] (schemaTypeToXML "intermediaryPartyReference") $ intermInfo_intermediaryPartyReference x+ ]+ +-- | The type of interpolation used.+data InterpolationMethod = InterpolationMethod Scheme InterpolationMethodAttributes deriving (Eq,Show)+data InterpolationMethodAttributes = InterpolationMethodAttributes+ { interpMethodAttrib_interpolationMethodScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType InterpolationMethod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "interpolationMethodScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ InterpolationMethod v (InterpolationMethodAttributes a0)+ schemaTypeToXML s (InterpolationMethod bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "interpolationMethodScheme") $ interpMethodAttrib_interpolationMethodScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension InterpolationMethod Scheme where+ supertype (InterpolationMethod s _) = s+ +-- | The data type used for indicating the language of the +-- resource, described using the ISO 639-2/T Code.+data Language = Language Scheme LanguageAttributes deriving (Eq,Show)+data LanguageAttributes = LanguageAttributes+ { languAttrib_languageScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType Language where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "languageScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ Language v (LanguageAttributes a0)+ schemaTypeToXML s (Language bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "languageScheme") $ languAttrib_languageScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension Language Scheme where+ supertype (Language s _) = s+ +-- | A supertype of leg. All swap legs extend this type.+data Leg+ = Leg_InterestRateStream InterestRateStream+ | Leg_FxSwapLeg FxSwapLeg+ | Leg_DirectionalLeg DirectionalLeg+ | Leg_CommoditySwapLeg CommoditySwapLeg+ | Leg_CommodityForwardLeg CommodityForwardLeg+ | Leg_FeeLeg FeeLeg+ + deriving (Eq,Show)+instance SchemaType Leg where+ parseSchemaType s = do+ (fmap Leg_InterestRateStream $ parseSchemaType s)+ `onFail`+ (fmap Leg_FxSwapLeg $ parseSchemaType s)+ `onFail`+ (fmap Leg_DirectionalLeg $ parseSchemaType s)+ `onFail`+ (fmap Leg_CommoditySwapLeg $ parseSchemaType s)+ `onFail`+ (fmap Leg_CommodityForwardLeg $ parseSchemaType s)+ `onFail`+ (fmap Leg_FeeLeg $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of Leg,\n\+\ namely one of:\n\+\InterestRateStream,FxSwapLeg,DirectionalLeg,CommoditySwapLeg,CommodityForwardLeg,FeeLeg"+ schemaTypeToXML _s (Leg_InterestRateStream x) = schemaTypeToXML "interestRateStream" x+ schemaTypeToXML _s (Leg_FxSwapLeg x) = schemaTypeToXML "fxSwapLeg" x+ schemaTypeToXML _s (Leg_DirectionalLeg x) = schemaTypeToXML "directionalLeg" x+ schemaTypeToXML _s (Leg_CommoditySwapLeg x) = schemaTypeToXML "commoditySwapLeg" x+ schemaTypeToXML _s (Leg_CommodityForwardLeg x) = schemaTypeToXML "commodityForwardLeg" x+ schemaTypeToXML _s (Leg_FeeLeg x) = schemaTypeToXML "feeLeg" x+ +-- | A type defining a legal entity.+data LegalEntity = LegalEntity+ { legalEntity_ID :: Maybe Xsd.ID+ , legalEntity_choice0 :: (Maybe (OneOf1 ((Maybe (EntityName)),[EntityId])))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * The name of the reference entity. A free format + -- string. FpML does not define usage rules for this + -- element.+ -- + -- * A legal entity identifier (e.g. RED entity code).+ }+ deriving (Eq,Show)+instance SchemaType LegalEntity where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (LegalEntity a0)+ `apply` optional (oneOf' [ ("Maybe EntityName [EntityId]", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "entityName")+ `apply` many (parseSchemaType "entityId")))+ ])+ schemaTypeToXML s x@LegalEntity{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ legalEntity_ID x+ ]+ [ maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "entityName") a+ , concatMap (schemaTypeToXML "entityId") b+ ])+ ) $ legalEntity_choice0 x+ ]+ +-- | References a credit entity defined elsewhere in the +-- document.+data LegalEntityReference = LegalEntityReference+ { legalEntityRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType LegalEntityReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (LegalEntityReference a0)+ schemaTypeToXML s x@LegalEntityReference{} =+ toXMLElement s [ toXMLAttribute "href" $ legalEntityRef_href x+ ]+ []+instance Extension LegalEntityReference Reference where+ supertype v = Reference_LegalEntityReference v+ +-- | A type to define the main publication source.+data MainPublication = MainPublication Scheme MainPublicationAttributes deriving (Eq,Show)+data MainPublicationAttributes = MainPublicationAttributes+ { mainPublicAttrib_mainPublicationScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MainPublication where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "mainPublicationScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MainPublication v (MainPublicationAttributes a0)+ schemaTypeToXML s (MainPublication bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "mainPublicationScheme") $ mainPublicAttrib_mainPublicationScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MainPublication Scheme where+ supertype (MainPublication s _) = s+ +-- | A type defining manual exercise, i.e. that the option buyer +-- counterparty must give notice to the option seller of +-- exercise.+data ManualExercise = ManualExercise+ { manualExerc_exerciseNotice :: Maybe ExerciseNotice+ -- ^ Definition of the party to whom notice of exercise should + -- be given.+ , manualExerc_fallbackExercise :: Maybe Xsd.Boolean+ -- ^ If fallback exercise is specified then the notional amount + -- of the underlying swap, not previously exercised under the + -- swaption, will be automatically exercised at the expiration + -- time on the expiration date if at such time the buyer is + -- in-the-money, provided that the difference between the + -- settlement rate and the fixed rate under the relevant + -- underlying swap is not less than one tenth of a percentage + -- point (0.10% or 0.001). The term in-the-money is assumed to + -- have the meaning defined in the 2000 ISDA Definitions, + -- Section 17.4. In-the-money.+ }+ deriving (Eq,Show)+instance SchemaType ManualExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ManualExercise+ `apply` optional (parseSchemaType "exerciseNotice")+ `apply` optional (parseSchemaType "fallbackExercise")+ schemaTypeToXML s x@ManualExercise{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "exerciseNotice") $ manualExerc_exerciseNotice x+ , maybe [] (schemaTypeToXML "fallbackExercise") $ manualExerc_fallbackExercise x+ ]+ +-- | An entity for defining the agreement executed between the +-- parties and intended to govern all OTC derivatives +-- transactions between those parties.+data MasterAgreement = MasterAgreement+ { masterAgreement_type :: Maybe MasterAgreementType+ -- ^ The agreement executed between the parties and intended to + -- govern product-specific derivatives transactions between + -- those parties.+ , masterAgreement_version :: Maybe MasterAgreementVersion+ -- ^ The version of the master agreement.+ , masterAgreement_date :: Maybe Xsd.Date+ -- ^ The date on which the master agreement was signed.+ }+ deriving (Eq,Show)+instance SchemaType MasterAgreement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return MasterAgreement+ `apply` optional (parseSchemaType "masterAgreementType")+ `apply` optional (parseSchemaType "masterAgreementVersion")+ `apply` optional (parseSchemaType "masterAgreementDate")+ schemaTypeToXML s x@MasterAgreement{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "masterAgreementType") $ masterAgreement_type x+ , maybe [] (schemaTypeToXML "masterAgreementVersion") $ masterAgreement_version x+ , maybe [] (schemaTypeToXML "masterAgreementDate") $ masterAgreement_date x+ ]+ +data MasterAgreementType = MasterAgreementType Scheme MasterAgreementTypeAttributes deriving (Eq,Show)+data MasterAgreementTypeAttributes = MasterAgreementTypeAttributes+ { masterAgreemTypeAttrib_masterAgreementTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MasterAgreementType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "masterAgreementTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MasterAgreementType v (MasterAgreementTypeAttributes a0)+ schemaTypeToXML s (MasterAgreementType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "masterAgreementTypeScheme") $ masterAgreemTypeAttrib_masterAgreementTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MasterAgreementType Scheme where+ supertype (MasterAgreementType s _) = s+ +data MasterAgreementVersion = MasterAgreementVersion Scheme MasterAgreementVersionAttributes deriving (Eq,Show)+data MasterAgreementVersionAttributes = MasterAgreementVersionAttributes+ { masterAgreemVersionAttrib_masterAgreementVersionScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MasterAgreementVersion where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "masterAgreementVersionScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MasterAgreementVersion v (MasterAgreementVersionAttributes a0)+ schemaTypeToXML s (MasterAgreementVersion bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "masterAgreementVersionScheme") $ masterAgreemVersionAttrib_masterAgreementVersionScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MasterAgreementVersion Scheme where+ supertype (MasterAgreementVersion s _) = s+ +-- | An entity for defining the master confirmation agreement +-- executed between the parties.+data MasterConfirmation = MasterConfirmation+ { masterConfirmation_type :: Maybe MasterConfirmationType+ -- ^ The type of master confirmation executed between the + -- parties.+ , masterConfirmation_date :: Maybe Xsd.Date+ -- ^ The date of the confirmation executed between the parties + -- and intended to govern all relevant transactions between + -- those parties.+ , masterConfirmation_annexDate :: Maybe Xsd.Date+ -- ^ The date that an annex to the master confirmation was + -- executed between the parties.+ , masterConfirmation_annexType :: Maybe MasterConfirmationAnnexType+ -- ^ The type of master confirmation annex executed between the + -- parties.+ }+ deriving (Eq,Show)+instance SchemaType MasterConfirmation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return MasterConfirmation+ `apply` optional (parseSchemaType "masterConfirmationType")+ `apply` optional (parseSchemaType "masterConfirmationDate")+ `apply` optional (parseSchemaType "masterConfirmationAnnexDate")+ `apply` optional (parseSchemaType "masterConfirmationAnnexType")+ schemaTypeToXML s x@MasterConfirmation{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "masterConfirmationType") $ masterConfirmation_type x+ , maybe [] (schemaTypeToXML "masterConfirmationDate") $ masterConfirmation_date x+ , maybe [] (schemaTypeToXML "masterConfirmationAnnexDate") $ masterConfirmation_annexDate x+ , maybe [] (schemaTypeToXML "masterConfirmationAnnexType") $ masterConfirmation_annexType x+ ]+ +data MasterConfirmationAnnexType = MasterConfirmationAnnexType Scheme MasterConfirmationAnnexTypeAttributes deriving (Eq,Show)+data MasterConfirmationAnnexTypeAttributes = MasterConfirmationAnnexTypeAttributes+ { mcata_masterConfirmationAnnexTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MasterConfirmationAnnexType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "masterConfirmationAnnexTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MasterConfirmationAnnexType v (MasterConfirmationAnnexTypeAttributes a0)+ schemaTypeToXML s (MasterConfirmationAnnexType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "masterConfirmationAnnexTypeScheme") $ mcata_masterConfirmationAnnexTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MasterConfirmationAnnexType Scheme where+ supertype (MasterConfirmationAnnexType s _) = s+ +data MasterConfirmationType = MasterConfirmationType Scheme MasterConfirmationTypeAttributes deriving (Eq,Show)+data MasterConfirmationTypeAttributes = MasterConfirmationTypeAttributes+ { masterConfirTypeAttrib_masterConfirmationTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MasterConfirmationType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "masterConfirmationTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MasterConfirmationType v (MasterConfirmationTypeAttributes a0)+ schemaTypeToXML s (MasterConfirmationType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "masterConfirmationTypeScheme") $ masterConfirTypeAttrib_masterConfirmationTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MasterConfirmationType Scheme where+ supertype (MasterConfirmationType s _) = s+ +-- | An identifier used to identify matched cashflows.+data MatchId = MatchId Scheme MatchIdAttributes deriving (Eq,Show)+data MatchIdAttributes = MatchIdAttributes+ { matchIdAttrib_matchIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MatchId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "matchIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MatchId v (MatchIdAttributes a0)+ schemaTypeToXML s (MatchId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "matchIdScheme") $ matchIdAttrib_matchIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MatchId Scheme where+ supertype (MatchId s _) = s+ +-- | A type defining a mathematical expression.+data Math = Math+ { math_text0 :: String+ , math_any1 :: [AnyElement]+ , math_text2 :: String+ }+ deriving (Eq,Show)+instance SchemaType Math where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Math+ `apply` parseText+ `apply` many1 (parseAnyElement)+ `apply` parseText+ schemaTypeToXML s x@Math{} =+ toXMLElement s []+ [ toXMLText $ math_text0 x+ , concatMap (toXMLAnyElement) $ math_any1 x+ , toXMLText $ math_text2 x+ ]+ +data MatrixType = MatrixType Scheme MatrixTypeAttributes deriving (Eq,Show)+data MatrixTypeAttributes = MatrixTypeAttributes+ { matrixTypeAttrib_matrixTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MatrixType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "matrixTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MatrixType v (MatrixTypeAttributes a0)+ schemaTypeToXML s (MatrixType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "matrixTypeScheme") $ matrixTypeAttrib_matrixTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MatrixType Scheme where+ supertype (MatrixType s _) = s+ +data MatrixTerm = MatrixTerm Scheme MatrixTermAttributes deriving (Eq,Show)+data MatrixTermAttributes = MatrixTermAttributes+ { matrixTermAttrib_matrixTermScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MatrixTerm where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "matrixTermScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MatrixTerm v (MatrixTermAttributes a0)+ schemaTypeToXML s (MatrixTerm bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "matrixTermScheme") $ matrixTermAttrib_matrixTermScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MatrixTerm Scheme where+ supertype (MatrixTerm s _) = s+ +-- | The type that indicates the type of media used to store the +-- content. MimeType is used to determine the software +-- product(s) that can read the content. MIME types are +-- described in RFC 2046.+data MimeType = MimeType Scheme MimeTypeAttributes deriving (Eq,Show)+data MimeTypeAttributes = MimeTypeAttributes+ { mimeTypeAttrib_mimeTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MimeType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "mimeTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MimeType v (MimeTypeAttributes a0)+ schemaTypeToXML s (MimeType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "mimeTypeScheme") $ mimeTypeAttrib_mimeTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MimeType Scheme where+ supertype (MimeType s _) = s+ +-- | A type defining a currency amount.+data Money = Money+ { money_ID :: Maybe Xsd.ID+ , money_currency :: Currency+ -- ^ The currency in which an amount is denominated.+ , money_amount :: Xsd.Decimal+ -- ^ The monetary quantity in currency units.+ }+ deriving (Eq,Show)+instance SchemaType Money where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Money a0)+ `apply` parseSchemaType "currency"+ `apply` parseSchemaType "amount"+ schemaTypeToXML s x@Money{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ money_ID x+ ]+ [ schemaTypeToXML "currency" $ money_currency x+ , schemaTypeToXML "amount" $ money_amount x+ ]+instance Extension Money MoneyBase where+ supertype v = MoneyBase_Money v+ +-- | Abstract base class for all money types.+data MoneyBase+ = MoneyBase_PositiveMoney PositiveMoney+ | MoneyBase_NonNegativeMoney NonNegativeMoney+ | MoneyBase_Money Money+ + deriving (Eq,Show)+instance SchemaType MoneyBase where+ parseSchemaType s = do+ (fmap MoneyBase_PositiveMoney $ parseSchemaType s)+ `onFail`+ (fmap MoneyBase_NonNegativeMoney $ parseSchemaType s)+ `onFail`+ (fmap MoneyBase_Money $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of MoneyBase,\n\+\ namely one of:\n\+\PositiveMoney,NonNegativeMoney,Money"+ schemaTypeToXML _s (MoneyBase_PositiveMoney x) = schemaTypeToXML "positiveMoney" x+ schemaTypeToXML _s (MoneyBase_NonNegativeMoney x) = schemaTypeToXML "nonNegativeMoney" x+ schemaTypeToXML _s (MoneyBase_Money x) = schemaTypeToXML "money" x+ +-- | A type defining multiple exercises. As defining in the 2000 +-- ISDA Definitions, Section 12.4. Multiple Exercise, the +-- buyer of the option has the right to exercise all or less +-- than all the unexercised notional amount of the underlying +-- swap on one or more days in the exercise period, but on any +-- such day may not exercise less than the minimum notional +-- amount or more than the maximum notional amount, and if an +-- integral multiple amount is specified, the notional +-- exercised must be equal to or, be an integral multiple of, +-- the integral multiple amount.+data MultipleExercise = MultipleExercise+ { multiExerc_notionalReference :: [NotionalReference]+ -- ^ A pointer style reference to the associated notional + -- schedule defined elsewhere in the document. This element + -- has been made optional as part of its integration in the + -- OptionBaseExtended, because not required for the options on + -- securities.+ , multiExerc_integralMultipleAmount :: Maybe Xsd.Decimal+ -- ^ A notional amount which restricts the amount of notional + -- that can be exercised when partial exercise or multiple + -- exercise is applicable. The integral multiple amount + -- defines a lower limit of notional that can be exercised and + -- also defines a unit multiple of notional that can be + -- exercised, i.e. only integer multiples of this amount can + -- be exercised.+ , multiExerc_choice2 :: (Maybe (OneOf2 Xsd.Decimal Xsd.NonNegativeInteger))+ -- ^ Choice between:+ -- + -- (1) The minimum notional amount that can be exercised on a + -- given exercise date. See multipleExercise.+ -- + -- (2) The minimum number of options that can be exercised on + -- a given exercise date.+ , multiExerc_choice3 :: (Maybe (OneOf2 Xsd.Decimal NonNegativeDecimal))+ -- ^ Choice between:+ -- + -- (1) The maximum notional amount that can be exercised on a + -- given exercise date.+ -- + -- (2) The maximum number of options that can be exercised on + -- a given exercise date. If the number is not specified, + -- it means that the maximum number of options corresponds + -- to the remaining unexercised options.+ }+ deriving (Eq,Show)+instance SchemaType MultipleExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return MultipleExercise+ `apply` many (parseSchemaType "notionalReference")+ `apply` optional (parseSchemaType "integralMultipleAmount")+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "minimumNotionalAmount"))+ , ("Xsd.NonNegativeInteger", fmap TwoOf2 (parseSchemaType "minimumNumberOfOptions"))+ ])+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "maximumNotionalAmount"))+ , ("NonNegativeDecimal", fmap TwoOf2 (parseSchemaType "maximumNumberOfOptions"))+ ])+ schemaTypeToXML s x@MultipleExercise{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "notionalReference") $ multiExerc_notionalReference x+ , maybe [] (schemaTypeToXML "integralMultipleAmount") $ multiExerc_integralMultipleAmount x+ , maybe [] (foldOneOf2 (schemaTypeToXML "minimumNotionalAmount")+ (schemaTypeToXML "minimumNumberOfOptions")+ ) $ multiExerc_choice2 x+ , maybe [] (foldOneOf2 (schemaTypeToXML "maximumNotionalAmount")+ (schemaTypeToXML "maximumNumberOfOptions")+ ) $ multiExerc_choice3 x+ ]+ +-- | A type defining a currency amount or a currency amount +-- schedule.+data NonNegativeAmountSchedule = NonNegativeAmountSchedule+ { nonNegatAmountSched_ID :: Maybe Xsd.ID+ , nonNegatAmountSched_initialValue :: NonNegativeDecimal+ -- ^ The non-negative initial rate or amount, as the case may + -- be. An initial rate of 5% would be represented as 0.05.+ , nonNegatAmountSched_step :: [NonNegativeStep]+ -- ^ The schedule of step date and non-negative value pairs. On + -- each step date the associated step value becomes effective. + -- A list of steps may be ordered in the document by ascending + -- step date. An FpML document containing an unordered list of + -- steps is still regarded as a conformant document.+ , nonNegatAmountSched_currency :: Maybe Currency+ -- ^ The currency in which an amount is denominated.+ }+ deriving (Eq,Show)+instance SchemaType NonNegativeAmountSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (NonNegativeAmountSchedule a0)+ `apply` parseSchemaType "initialValue"+ `apply` many (parseSchemaType "step")+ `apply` optional (parseSchemaType "currency")+ schemaTypeToXML s x@NonNegativeAmountSchedule{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ nonNegatAmountSched_ID x+ ]+ [ schemaTypeToXML "initialValue" $ nonNegatAmountSched_initialValue x+ , concatMap (schemaTypeToXML "step") $ nonNegatAmountSched_step x+ , maybe [] (schemaTypeToXML "currency") $ nonNegatAmountSched_currency x+ ]+instance Extension NonNegativeAmountSchedule NonNegativeSchedule where+ supertype (NonNegativeAmountSchedule a0 e0 e1 e2) =+ NonNegativeSchedule a0 e0 e1+ +-- | A type defining a non negative money amount.+data NonNegativeMoney = NonNegativeMoney+ { nonNegatMoney_ID :: Maybe Xsd.ID+ , nonNegatMoney_currency :: Currency+ -- ^ The currency in which an amount is denominated.+ , nonNegatMoney_amount :: NonNegativeDecimal+ -- ^ The non negative monetary quantity in currency units.+ }+ deriving (Eq,Show)+instance SchemaType NonNegativeMoney where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (NonNegativeMoney a0)+ `apply` parseSchemaType "currency"+ `apply` parseSchemaType "amount"+ schemaTypeToXML s x@NonNegativeMoney{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ nonNegatMoney_ID x+ ]+ [ schemaTypeToXML "currency" $ nonNegatMoney_currency x+ , schemaTypeToXML "amount" $ nonNegatMoney_amount x+ ]+instance Extension NonNegativeMoney MoneyBase where+ supertype v = MoneyBase_NonNegativeMoney v+ +-- | A complex type to specify non negative payments.+data NonNegativePayment = NonNegativePayment+ { nonNegatPayment_ID :: Maybe Xsd.ID+ , nonNegatPayment_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , nonNegatPayment_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , nonNegatPayment_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , nonNegatPayment_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , nonNegatPayment_paymentDate :: Maybe AdjustableOrRelativeDate+ -- ^ The payment date, which can be expressed as either an + -- adjustable or relative date.+ , nonNegatPayment_paymentAmount :: Maybe NonNegativeMoney+ -- ^ Non negative payment amount.+ }+ deriving (Eq,Show)+instance SchemaType NonNegativePayment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (NonNegativePayment a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "paymentDate")+ `apply` optional (parseSchemaType "paymentAmount")+ schemaTypeToXML s x@NonNegativePayment{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ nonNegatPayment_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ nonNegatPayment_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ nonNegatPayment_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ nonNegatPayment_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ nonNegatPayment_receiverAccountReference x+ , maybe [] (schemaTypeToXML "paymentDate") $ nonNegatPayment_paymentDate x+ , maybe [] (schemaTypeToXML "paymentAmount") $ nonNegatPayment_paymentAmount x+ ]+instance Extension NonNegativePayment PaymentBaseExtended where+ supertype v = PaymentBaseExtended_NonNegativePayment v+instance Extension NonNegativePayment PaymentBase where+ supertype = (supertype :: PaymentBaseExtended -> PaymentBase)+ . (supertype :: NonNegativePayment -> PaymentBaseExtended)+ + +-- | A type defining a schedule of non-negative rates or amounts +-- in terms of an initial value and then a series of step date +-- and value pairs. On each step date the rate or amount +-- changes to the new step value. The series of step date and +-- value pairs are optional. If not specified, this implies +-- that the initial value remains unchanged over time.+data NonNegativeSchedule = NonNegativeSchedule+ { nonNegatSched_ID :: Maybe Xsd.ID+ , nonNegatSched_initialValue :: NonNegativeDecimal+ -- ^ The non-negative initial rate or amount, as the case may + -- be. An initial rate of 5% would be represented as 0.05.+ , nonNegatSched_step :: [NonNegativeStep]+ -- ^ The schedule of step date and non-negative value pairs. On + -- each step date the associated step value becomes effective. + -- A list of steps may be ordered in the document by ascending + -- step date. An FpML document containing an unordered list of + -- steps is still regarded as a conformant document.+ }+ deriving (Eq,Show)+instance SchemaType NonNegativeSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (NonNegativeSchedule a0)+ `apply` parseSchemaType "initialValue"+ `apply` many (parseSchemaType "step")+ schemaTypeToXML s x@NonNegativeSchedule{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ nonNegatSched_ID x+ ]+ [ schemaTypeToXML "initialValue" $ nonNegatSched_initialValue x+ , concatMap (schemaTypeToXML "step") $ nonNegatSched_step x+ ]+ +-- | A type defining a step date and non-negative step value +-- pair. This step definitions are used to define varying rate +-- or amount schedules, e.g. a notional amortization or a +-- step-up coupon schedule.+data NonNegativeStep = NonNegativeStep+ { nonNegatStep_ID :: Maybe Xsd.ID+ , nonNegatStep_stepDate :: Maybe Xsd.Date+ -- ^ The date on which the associated stepValue becomes + -- effective. This day may be subject to adjustment in + -- accordance with a business day convention.+ , nonNegatStep_stepValue :: Maybe NonNegativeDecimal+ -- ^ The non-negative rate or amount which becomes effective on + -- the associated stepDate. A rate of 5% would be represented + -- as 0.05.+ }+ deriving (Eq,Show)+instance SchemaType NonNegativeStep where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (NonNegativeStep a0)+ `apply` optional (parseSchemaType "stepDate")+ `apply` optional (parseSchemaType "stepValue")+ schemaTypeToXML s x@NonNegativeStep{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ nonNegatStep_ID x+ ]+ [ maybe [] (schemaTypeToXML "stepDate") $ nonNegatStep_stepDate x+ , maybe [] (schemaTypeToXML "stepValue") $ nonNegatStep_stepValue x+ ]+instance Extension NonNegativeStep StepBase where+ supertype v = StepBase_NonNegativeStep v+ +-- | A complex type to specify the notional amount.+data NotionalAmount = NotionalAmount+ { notionAmount_ID :: Maybe Xsd.ID+ , notionAmount_currency :: Currency+ -- ^ The currency in which an amount is denominated.+ , notionAmount_amount :: NonNegativeDecimal+ -- ^ The non negative monetary quantity in currency units.+ }+ deriving (Eq,Show)+instance SchemaType NotionalAmount where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (NotionalAmount a0)+ `apply` parseSchemaType "currency"+ `apply` parseSchemaType "amount"+ schemaTypeToXML s x@NotionalAmount{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ notionAmount_ID x+ ]+ [ schemaTypeToXML "currency" $ notionAmount_currency x+ , schemaTypeToXML "amount" $ notionAmount_amount x+ ]+instance Extension NotionalAmount NonNegativeMoney where+ supertype (NotionalAmount a0 e0 e1) =+ NonNegativeMoney a0 e0 e1+instance Extension NotionalAmount MoneyBase where+ supertype = (supertype :: NonNegativeMoney -> MoneyBase)+ . (supertype :: NotionalAmount -> NonNegativeMoney)+ + +-- | A reference to the notional amount.+data NotionalAmountReference = NotionalAmountReference+ { notionAmountRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType NotionalAmountReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (NotionalAmountReference a0)+ schemaTypeToXML s x@NotionalAmountReference{} =+ toXMLElement s [ toXMLAttribute "href" $ notionAmountRef_href x+ ]+ []+instance Extension NotionalAmountReference Reference where+ supertype v = Reference_NotionalAmountReference v+ +-- | A reference to the notional amount.+data NotionalReference = NotionalReference+ { notionRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType NotionalReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (NotionalReference a0)+ schemaTypeToXML s x@NotionalReference{} =+ toXMLElement s [ toXMLAttribute "href" $ notionRef_href x+ ]+ []+instance Extension NotionalReference Reference where+ supertype v = Reference_NotionalReference v+ +-- | A type defining an offset used in calculating a new date +-- relative to a reference date. Currently, the only offsets +-- defined are expected to be expressed as either calendar or +-- business day offsets.+data Offset = Offset+ { offset_ID :: Maybe Xsd.ID+ , offset_periodMultiplier :: Xsd.Integer+ -- ^ A time period multiplier, e.g. 1, 2 or 3 etc. A negative + -- value can be used when specifying an offset relative to + -- another date, e.g. -2 days.+ , offset_period :: PeriodEnum+ -- ^ A time period, e.g. a day, week, month or year of the + -- stream. If the periodMultiplier value is 0 (zero) then + -- period must contain the value D (day).+ , offset_dayType :: Maybe DayTypeEnum+ -- ^ In the case of an offset specified as a number of days, + -- this element defines whether consideration is given as to + -- whether a day is a good business day or not. If a day type + -- of business days is specified then non-business days are + -- ignored when calculating the offset. The financial business + -- centers to use for determination of business days are + -- implied by the context in which this element is used. This + -- element must only be included when the offset is specified + -- as a number of days. If the offset is zero days then the + -- dayType element should not be included.+ }+ deriving (Eq,Show)+instance SchemaType Offset where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Offset a0)+ `apply` parseSchemaType "periodMultiplier"+ `apply` parseSchemaType "period"+ `apply` optional (parseSchemaType "dayType")+ schemaTypeToXML s x@Offset{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ offset_ID x+ ]+ [ schemaTypeToXML "periodMultiplier" $ offset_periodMultiplier x+ , schemaTypeToXML "period" $ offset_period x+ , maybe [] (schemaTypeToXML "dayType") $ offset_dayType x+ ]+instance Extension Offset Period where+ supertype (Offset a0 e0 e1 e2) =+ Period a0 e0 e1+ +-- | Allows the specification of a time that may be on a day +-- prior or subsequent to the day in question. This type is +-- intended for use with a day of the week (i.e. where no +-- actual date is specified) as part of, for example, a period +-- that runs from 23:00-07:00 on a series of days and where +-- holidays on the actual days would affect the entire time +-- period.+data OffsetPrevailingTime = OffsetPrevailingTime+ { offsetPrevaTime_time :: Maybe PrevailingTime+ , offsetPrevaTime_offset :: Maybe Offset+ -- ^ Indicates whether time applies to the actual day specified + -- (in which case this element should be omitted) the day + -- prior to that day (in which case periodMultiplier should be + -- -1 and period should be Day) or the day subsequent to that + -- day (in which case periodMultiplier should be 1 and period + -- should be Day).+ }+ deriving (Eq,Show)+instance SchemaType OffsetPrevailingTime where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OffsetPrevailingTime+ `apply` optional (parseSchemaType "time")+ `apply` optional (parseSchemaType "offset")+ schemaTypeToXML s x@OffsetPrevailingTime{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "time") $ offsetPrevaTime_time x+ , maybe [] (schemaTypeToXML "offset") $ offsetPrevaTime_offset x+ ]+ +data OnBehalfOf = OnBehalfOf+ { onBehalfOf_partyReference :: Maybe PartyReference+ -- ^ The party for which the message reciever should work.+ , onBehalfOf_accountReference :: [AccountReference]+ -- ^ Identifies the account(s) related to the party when they + -- can be determined from the party alone, for example in a + -- inter-book trade.+ }+ deriving (Eq,Show)+instance SchemaType OnBehalfOf where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OnBehalfOf+ `apply` optional (parseSchemaType "partyReference")+ `apply` many (parseSchemaType "accountReference")+ schemaTypeToXML s x@OnBehalfOf{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "partyReference") $ onBehalfOf_partyReference x+ , concatMap (schemaTypeToXML "accountReference") $ onBehalfOf_accountReference x+ ]+ +data OriginatingEvent = OriginatingEvent Scheme OriginatingEventAttributes deriving (Eq,Show)+data OriginatingEventAttributes = OriginatingEventAttributes+ { originEventAttrib_originatingEventScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType OriginatingEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "originatingEventScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ OriginatingEvent v (OriginatingEventAttributes a0)+ schemaTypeToXML s (OriginatingEvent bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "originatingEventScheme") $ originEventAttrib_originatingEventScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension OriginatingEvent Scheme where+ supertype (OriginatingEvent s _) = s+ +-- | A type defining partial exercise. As defined in the 2000 +-- ISDA Definitions, Section 12.3 Partial Exercise, the buyer +-- of the option may exercise all or less than all the +-- notional amount of the underlying swap but may not be less +-- than the minimum notional amount (if specified) and must be +-- an integral multiple of the integral multiple amount if +-- specified.+data PartialExercise = PartialExercise+ { partialExerc_notionalReference :: [NotionalReference]+ -- ^ A pointer style reference to the associated notional + -- schedule defined elsewhere in the document. This element + -- has been made optional as part of its integration in the + -- OptionBaseExtended, because not required for the options on + -- securities.+ , partialExerc_integralMultipleAmount :: Maybe Xsd.Decimal+ -- ^ A notional amount which restricts the amount of notional + -- that can be exercised when partial exercise or multiple + -- exercise is applicable. The integral multiple amount + -- defines a lower limit of notional that can be exercised and + -- also defines a unit multiple of notional that can be + -- exercised, i.e. only integer multiples of this amount can + -- be exercised.+ , partialExerc_choice2 :: (Maybe (OneOf2 Xsd.Decimal Xsd.NonNegativeInteger))+ -- ^ Choice between:+ -- + -- (1) The minimum notional amount that can be exercised on a + -- given exercise date. See multipleExercise.+ -- + -- (2) The minimum number of options that can be exercised on + -- a given exercise date.+ }+ deriving (Eq,Show)+instance SchemaType PartialExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PartialExercise+ `apply` many (parseSchemaType "notionalReference")+ `apply` optional (parseSchemaType "integralMultipleAmount")+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "minimumNotionalAmount"))+ , ("Xsd.NonNegativeInteger", fmap TwoOf2 (parseSchemaType "minimumNumberOfOptions"))+ ])+ schemaTypeToXML s x@PartialExercise{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "notionalReference") $ partialExerc_notionalReference x+ , maybe [] (schemaTypeToXML "integralMultipleAmount") $ partialExerc_integralMultipleAmount x+ , maybe [] (foldOneOf2 (schemaTypeToXML "minimumNotionalAmount")+ (schemaTypeToXML "minimumNumberOfOptions")+ ) $ partialExerc_choice2 x+ ]+ +data Party = Party+ { party_ID :: Xsd.ID+ -- ^ The id uniquely identifying the Party within the document.+ , party_id :: [PartyId]+ -- ^ A party identifier, e.g. a S.W.I.F.T. bank identifier code + -- (BIC).+ , party_name :: Maybe PartyName+ -- ^ The legal name of the organization. A free format string. + -- FpML does not define usage rules for this element.+ , party_classification :: [IndustryClassification]+ -- ^ The party's industry sector classification.+ , party_creditRating :: [CreditRating]+ -- ^ The party's credit rating.+ , party_country :: Maybe CountryCode+ -- ^ The country where the party is domiciled.+ , party_jurisdiction :: [GoverningLaw]+ -- ^ The legal jurisdiction of the entity's registration.+ , party_organizationType :: Maybe OrganizationType+ -- ^ The country where the party is domiciled.+ , party_contactInfo :: Maybe ContactInformation+ -- ^ Information on how to contact the party using various + -- means.+ , party_businessUnit :: [BusinessUnit]+ -- ^ Optional organization unit information used to describe the + -- organization units (e.g. trading desks) involved in a + -- transaction or business process .+ , party_person :: [Person]+ -- ^ Optional information about people involved in a transaction + -- or busines process. (These are eomployees of the party).+ }+ deriving (Eq,Show)+instance SchemaType Party where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "id" e pos+ commit $ interior e $ return (Party a0)+ `apply` many (parseSchemaType "partyId")+ `apply` optional (parseSchemaType "partyName")+ `apply` many (parseSchemaType "classification")+ `apply` many (parseSchemaType "creditRating")+ `apply` optional (parseSchemaType "country")+ `apply` many (parseSchemaType "jurisdiction")+ `apply` optional (parseSchemaType "organizationType")+ `apply` optional (parseSchemaType "contactInfo")+ `apply` many (parseSchemaType "businessUnit")+ `apply` many (parseSchemaType "person")+ schemaTypeToXML s x@Party{} =+ toXMLElement s [ toXMLAttribute "id" $ party_ID x+ ]+ [ concatMap (schemaTypeToXML "partyId") $ party_id x+ , maybe [] (schemaTypeToXML "partyName") $ party_name x+ , concatMap (schemaTypeToXML "classification") $ party_classification x+ , concatMap (schemaTypeToXML "creditRating") $ party_creditRating x+ , maybe [] (schemaTypeToXML "country") $ party_country x+ , concatMap (schemaTypeToXML "jurisdiction") $ party_jurisdiction x+ , maybe [] (schemaTypeToXML "organizationType") $ party_organizationType x+ , maybe [] (schemaTypeToXML "contactInfo") $ party_contactInfo x+ , concatMap (schemaTypeToXML "businessUnit") $ party_businessUnit x+ , concatMap (schemaTypeToXML "person") $ party_person x+ ]+ +-- | The data type used for party identifiers.+data PartyId = PartyId Scheme PartyIdAttributes deriving (Eq,Show)+data PartyIdAttributes = PartyIdAttributes+ { partyIdAttrib_partyIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType PartyId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "partyIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ PartyId v (PartyIdAttributes a0)+ schemaTypeToXML s (PartyId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "partyIdScheme") $ partyIdAttrib_partyIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension PartyId Scheme where+ supertype (PartyId s _) = s+ +-- | The data type used for the legal name of an organization.+data PartyName = PartyName Scheme PartyNameAttributes deriving (Eq,Show)+data PartyNameAttributes = PartyNameAttributes+ { partyNameAttrib_partyNameScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType PartyName where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "partyNameScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ PartyName v (PartyNameAttributes a0)+ schemaTypeToXML s (PartyName bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "partyNameScheme") $ partyNameAttrib_partyNameScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension PartyName Scheme where+ supertype (PartyName s _) = s+ +-- | Reference to a party.+data PartyReference = PartyReference+ { partyRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType PartyReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (PartyReference a0)+ schemaTypeToXML s x@PartyReference{} =+ toXMLElement s [ toXMLAttribute "href" $ partyRef_href x+ ]+ []+instance Extension PartyReference Reference where+ supertype v = Reference_PartyReference v+ +data PartyRelationship = PartyRelationship+ { partyRelat_partyReference :: PartyReference+ -- ^ Reference to a party.+ , partyRelat_accountReference :: Maybe AccountReference+ -- ^ Reference to an account.+ , partyRelat_role :: Maybe PartyRole+ -- ^ The category of the relationship. The related party + -- performs the role specified in this field for the base + -- party. For example, if the role is "Guarantor", the related + -- party acts as a guarantor for the base party.+ , partyRelat_type :: Maybe PartyRoleType+ -- ^ Additional definition refining the type of relationship. + -- For example, if the "role" is Guarantor, this element may + -- be used to specify whether all positions are guaranteed, or + -- only a subset of them.+ , partyRelat_effectiveDate :: Maybe Xsd.Date+ -- ^ The date on which the relationship begins or began.+ , partyRelat_terminationDate :: Maybe Xsd.Date+ -- ^ The date on which the relationship ends or ended.+ , partyRelat_documentation :: Maybe PartyRelationshipDocumentation+ -- ^ Describes the agreements that define the party + -- relationship.+ }+ deriving (Eq,Show)+instance SchemaType PartyRelationship where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PartyRelationship+ `apply` parseSchemaType "partyReference"+ `apply` optional (parseSchemaType "accountReference")+ `apply` optional (parseSchemaType "role")+ `apply` optional (parseSchemaType "type")+ `apply` optional (parseSchemaType "effectiveDate")+ `apply` optional (parseSchemaType "terminationDate")+ `apply` optional (parseSchemaType "documentation")+ schemaTypeToXML s x@PartyRelationship{} =+ toXMLElement s []+ [ schemaTypeToXML "partyReference" $ partyRelat_partyReference x+ , maybe [] (schemaTypeToXML "accountReference") $ partyRelat_accountReference x+ , maybe [] (schemaTypeToXML "role") $ partyRelat_role x+ , maybe [] (schemaTypeToXML "type") $ partyRelat_type x+ , maybe [] (schemaTypeToXML "effectiveDate") $ partyRelat_effectiveDate x+ , maybe [] (schemaTypeToXML "terminationDate") $ partyRelat_terminationDate x+ , maybe [] (schemaTypeToXML "documentation") $ partyRelat_documentation x+ ]+ +-- | A description of the legal agreement(s) and definitions +-- that document a party's relationships with other parties+data PartyRelationshipDocumentation = PartyRelationshipDocumentation+ { partyRelatDocum_choice0 :: [OneOf3 MasterAgreement CreditSupportAgreement GenericAgreement]+ -- ^ Choice between:+ -- + -- (1) A agreement executed between two parties that includes + -- or references the related party.+ -- + -- (2) An agreement executed between two parties intended to + -- govern collateral arrangement for OTC derivatives + -- transactions between those parties, and that references + -- the related party.+ -- + -- (3) An agrement that references the related party.+ }+ deriving (Eq,Show)+instance SchemaType PartyRelationshipDocumentation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PartyRelationshipDocumentation+ `apply` many (oneOf' [ ("MasterAgreement", fmap OneOf3 (parseSchemaType "masterAgreement"))+ , ("CreditSupportAgreement", fmap TwoOf3 (parseSchemaType "creditSupportAgreement"))+ , ("GenericAgreement", fmap ThreeOf3 (parseSchemaType "agreement"))+ ])+ schemaTypeToXML s x@PartyRelationshipDocumentation{} =+ toXMLElement s []+ [ concatMap (foldOneOf3 (schemaTypeToXML "masterAgreement")+ (schemaTypeToXML "creditSupportAgreement")+ (schemaTypeToXML "agreement")+ ) $ partyRelatDocum_choice0 x+ ]+ +-- | A type describing a role played by a party in one or more +-- transactions. Examples include roles such as guarantor, +-- custodian, confirmation service provider, etc. This can be +-- extended to provide custom roles.+data PartyRole = PartyRole Scheme PartyRoleAttributes deriving (Eq,Show)+data PartyRoleAttributes = PartyRoleAttributes+ { partyRoleAttrib_partyRoleScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType PartyRole where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "partyRoleScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ PartyRole v (PartyRoleAttributes a0)+ schemaTypeToXML s (PartyRole bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "partyRoleScheme") $ partyRoleAttrib_partyRoleScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension PartyRole Scheme where+ supertype (PartyRole s _) = s+ +-- | A type refining the role a role played by a party in one or +-- more transactions. Examples include "AllPositions" and +-- "SomePositions" for Guarantor. This can be extended to +-- provide custom types.+data PartyRoleType = PartyRoleType Scheme PartyRoleTypeAttributes deriving (Eq,Show)+data PartyRoleTypeAttributes = PartyRoleTypeAttributes+ { partyRoleTypeAttrib_partyRoleTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType PartyRoleType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "partyRoleTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ PartyRoleType v (PartyRoleTypeAttributes a0)+ schemaTypeToXML s (PartyRoleType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "partyRoleTypeScheme") $ partyRoleTypeAttrib_partyRoleTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension PartyRoleType Scheme where+ supertype (PartyRoleType s _) = s+ +-- | Reference to an organizational unit.+data BusinessUnitReference = BusinessUnitReference+ { busUnitRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType BusinessUnitReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (BusinessUnitReference a0)+ schemaTypeToXML s x@BusinessUnitReference{} =+ toXMLElement s [ toXMLAttribute "href" $ busUnitRef_href x+ ]+ []+instance Extension BusinessUnitReference Reference where+ supertype v = Reference_BusinessUnitReference v+ +-- | Reference to an individual.+data PersonReference = PersonReference+ { personRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType PersonReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (PersonReference a0)+ schemaTypeToXML s x@PersonReference{} =+ toXMLElement s [ toXMLAttribute "href" $ personRef_href x+ ]+ []+instance Extension PersonReference Reference where+ supertype v = Reference_PersonReference v+ +-- | A reference to a partyTradeIdentifier object.+data PartyTradeIdentifierReference = PartyTradeIdentifierReference+ { partyTradeIdentRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType PartyTradeIdentifierReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (PartyTradeIdentifierReference a0)+ schemaTypeToXML s x@PartyTradeIdentifierReference{} =+ toXMLElement s [ toXMLAttribute "href" $ partyTradeIdentRef_href x+ ]+ []+instance Extension PartyTradeIdentifierReference Reference where+ supertype v = Reference_PartyTradeIdentifierReference v+ +-- | A type for defining payments+data Payment = Payment+ { payment_ID :: Maybe Xsd.ID+ , payment_href :: Maybe Xsd.IDREF+ -- ^ Can be used to reference the yield curve used to estimate + -- the discount factor+ , payment_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , payment_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , payment_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , payment_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , payment_amount :: NonNegativeMoney+ -- ^ The currency amount of the payment.+ , payment_date :: Maybe AdjustableOrAdjustedDate+ -- ^ The payment date. This date is subject to adjustment in + -- accordance with any applicable business day convention.+ , payment_type :: Maybe PaymentType+ -- ^ A classification of the type of fee or additional payment, + -- e.g. brokerage, upfront fee etc. FpML does not define + -- domain values for this element.+ , payment_settlementInformation :: Maybe SettlementInformation+ -- ^ The information required to settle a currency payment that + -- results from a trade.+ , payment_discountFactor :: Maybe Xsd.Decimal+ -- ^ The value representing the discount factor used to + -- calculate the present value of the cash flow.+ , payment_presentValueAmount :: Maybe Money+ -- ^ The amount representing the present value of the forecast + -- payment.+ }+ deriving (Eq,Show)+instance SchemaType Payment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ a1 <- optional $ getAttribute "href" e pos+ commit $ interior e $ return (Payment a0 a1)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` parseSchemaType "paymentAmount"+ `apply` optional (parseSchemaType "paymentDate")+ `apply` optional (parseSchemaType "paymentType")+ `apply` optional (parseSchemaType "settlementInformation")+ `apply` optional (parseSchemaType "discountFactor")+ `apply` optional (parseSchemaType "presentValueAmount")+ schemaTypeToXML s x@Payment{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ payment_ID x+ , maybe [] (toXMLAttribute "href") $ payment_href x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ payment_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ payment_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ payment_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ payment_receiverAccountReference x+ , schemaTypeToXML "paymentAmount" $ payment_amount x+ , maybe [] (schemaTypeToXML "paymentDate") $ payment_date x+ , maybe [] (schemaTypeToXML "paymentType") $ payment_type x+ , maybe [] (schemaTypeToXML "settlementInformation") $ payment_settlementInformation x+ , maybe [] (schemaTypeToXML "discountFactor") $ payment_discountFactor x+ , maybe [] (schemaTypeToXML "presentValueAmount") $ payment_presentValueAmount x+ ]+instance Extension Payment PaymentBase where+ supertype v = PaymentBase_Payment v+ +-- | An abstract base class for payment types.+data PaymentBase+ = PaymentBase_SimplePayment SimplePayment+ | PaymentBase_PaymentBaseExtended PaymentBaseExtended+ | PaymentBase_Payment Payment+ | PaymentBase_PendingPayment PendingPayment+ | PaymentBase_FeaturePayment FeaturePayment+ | PaymentBase_PaymentCalculationPeriod PaymentCalculationPeriod+ | PaymentBase_ReturnSwapAdditionalPayment ReturnSwapAdditionalPayment+ | PaymentBase_EquityPremium EquityPremium+ | PaymentBase_PaymentDetail PaymentDetail+ | PaymentBase_FixedPaymentAmount FixedPaymentAmount+ | PaymentBase_SinglePayment SinglePayment+ | PaymentBase_PeriodicPayment PeriodicPayment+ | PaymentBase_InitialPayment InitialPayment+ | PaymentBase_PrePayment PrePayment+ + deriving (Eq,Show)+instance SchemaType PaymentBase where+ parseSchemaType s = do+ (fmap PaymentBase_SimplePayment $ parseSchemaType s)+ `onFail`+ (fmap PaymentBase_PaymentBaseExtended $ parseSchemaType s)+ `onFail`+ (fmap PaymentBase_Payment $ parseSchemaType s)+ `onFail`+ (fmap PaymentBase_PendingPayment $ parseSchemaType s)+ `onFail`+ (fmap PaymentBase_FeaturePayment $ parseSchemaType s)+ `onFail`+ (fmap PaymentBase_PaymentCalculationPeriod $ parseSchemaType s)+ `onFail`+ (fmap PaymentBase_ReturnSwapAdditionalPayment $ parseSchemaType s)+ `onFail`+ (fmap PaymentBase_EquityPremium $ parseSchemaType s)+ `onFail`+ (fmap PaymentBase_PaymentDetail $ parseSchemaType s)+ `onFail`+ (fmap PaymentBase_FixedPaymentAmount $ parseSchemaType s)+ `onFail`+ (fmap PaymentBase_SinglePayment $ parseSchemaType s)+ `onFail`+ (fmap PaymentBase_PeriodicPayment $ parseSchemaType s)+ `onFail`+ (fmap PaymentBase_InitialPayment $ parseSchemaType s)+ `onFail`+ (fmap PaymentBase_PrePayment $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of PaymentBase,\n\+\ namely one of:\n\+\SimplePayment,PaymentBaseExtended,Payment,PendingPayment,FeaturePayment,PaymentCalculationPeriod,ReturnSwapAdditionalPayment,EquityPremium,PaymentDetail,FixedPaymentAmount,SinglePayment,PeriodicPayment,InitialPayment,PrePayment"+ schemaTypeToXML _s (PaymentBase_SimplePayment x) = schemaTypeToXML "simplePayment" x+ schemaTypeToXML _s (PaymentBase_PaymentBaseExtended x) = schemaTypeToXML "paymentBaseExtended" x+ schemaTypeToXML _s (PaymentBase_Payment x) = schemaTypeToXML "payment" x+ schemaTypeToXML _s (PaymentBase_PendingPayment x) = schemaTypeToXML "pendingPayment" x+ schemaTypeToXML _s (PaymentBase_FeaturePayment x) = schemaTypeToXML "featurePayment" x+ schemaTypeToXML _s (PaymentBase_PaymentCalculationPeriod x) = schemaTypeToXML "paymentCalculationPeriod" x+ schemaTypeToXML _s (PaymentBase_ReturnSwapAdditionalPayment x) = schemaTypeToXML "returnSwapAdditionalPayment" x+ schemaTypeToXML _s (PaymentBase_EquityPremium x) = schemaTypeToXML "equityPremium" x+ schemaTypeToXML _s (PaymentBase_PaymentDetail x) = schemaTypeToXML "paymentDetail" x+ schemaTypeToXML _s (PaymentBase_FixedPaymentAmount x) = schemaTypeToXML "fixedPaymentAmount" x+ schemaTypeToXML _s (PaymentBase_SinglePayment x) = schemaTypeToXML "singlePayment" x+ schemaTypeToXML _s (PaymentBase_PeriodicPayment x) = schemaTypeToXML "periodicPayment" x+ schemaTypeToXML _s (PaymentBase_InitialPayment x) = schemaTypeToXML "initialPayment" x+ schemaTypeToXML _s (PaymentBase_PrePayment x) = schemaTypeToXML "prePayment" x+ +-- | Base type for payments.+data PaymentBaseExtended+ = PaymentBaseExtended_PositivePayment PositivePayment+ | PaymentBaseExtended_NonNegativePayment NonNegativePayment+ + deriving (Eq,Show)+instance SchemaType PaymentBaseExtended where+ parseSchemaType s = do+ (fmap PaymentBaseExtended_PositivePayment $ parseSchemaType s)+ `onFail`+ (fmap PaymentBaseExtended_NonNegativePayment $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of PaymentBaseExtended,\n\+\ namely one of:\n\+\PositivePayment,NonNegativePayment"+ schemaTypeToXML _s (PaymentBaseExtended_PositivePayment x) = schemaTypeToXML "positivePayment" x+ schemaTypeToXML _s (PaymentBaseExtended_NonNegativePayment x) = schemaTypeToXML "nonNegativePayment" x+instance Extension PaymentBaseExtended PaymentBase where+ supertype v = PaymentBase_PaymentBaseExtended v+ +-- | Details on the referenced payment. e.g. Its cashflow +-- components, settlement details.+data PaymentDetails = PaymentDetails+ { paymentDetails_paymentReference :: Maybe PaymentReference+ -- ^ The reference to the identified payment strucutre.+ , paymentDetails_grossCashflow :: [GrossCashflow]+ -- ^ Payment details of this cash flow component, including + -- currency, amount and payer/payee.+ , paymentDetails_settlementInformation :: Maybe SettlementInformation+ -- ^ The information required to settle a currency payment.+ }+ deriving (Eq,Show)+instance SchemaType PaymentDetails where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PaymentDetails+ `apply` optional (parseSchemaType "paymentReference")+ `apply` many (parseSchemaType "grossCashflow")+ `apply` optional (parseSchemaType "settlementInformation")+ schemaTypeToXML s x@PaymentDetails{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "paymentReference") $ paymentDetails_paymentReference x+ , concatMap (schemaTypeToXML "grossCashflow") $ paymentDetails_grossCashflow x+ , maybe [] (schemaTypeToXML "settlementInformation") $ paymentDetails_settlementInformation x+ ]+ + +-- | An identifier used to identify a matchable payment.+data PaymentId = PaymentId Scheme PaymentIdAttributes deriving (Eq,Show)+data PaymentIdAttributes = PaymentIdAttributes+ { paymentIdAttrib_paymentIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType PaymentId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "paymentIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ PaymentId v (PaymentIdAttributes a0)+ schemaTypeToXML s (PaymentId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "paymentIdScheme") $ paymentIdAttrib_paymentIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension PaymentId Scheme where+ supertype (PaymentId s _) = s+ +-- | Reference to a payment.+data PaymentReference = PaymentReference+ { paymentRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType PaymentReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (PaymentReference a0)+ schemaTypeToXML s x@PaymentReference{} =+ toXMLElement s [ toXMLAttribute "href" $ paymentRef_href x+ ]+ []+instance Extension PaymentReference Reference where+ supertype v = Reference_PaymentReference v+ +data PaymentType = PaymentType Scheme PaymentTypeAttributes deriving (Eq,Show)+data PaymentTypeAttributes = PaymentTypeAttributes+ { paymentTypeAttrib_paymentTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType PaymentType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "paymentTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ PaymentType v (PaymentTypeAttributes a0)+ schemaTypeToXML s (PaymentType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "paymentTypeScheme") $ paymentTypeAttrib_paymentTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension PaymentType Scheme where+ supertype (PaymentType s _) = s+ +-- | A type to define recurring periods or time offsets.+data Period = Period+ { period_ID :: Maybe Xsd.ID+ , period_multiplier :: Xsd.Integer+ -- ^ A time period multiplier, e.g. 1, 2 or 3 etc. A negative + -- value can be used when specifying an offset relative to + -- another date, e.g. -2 days.+ , period :: PeriodEnum+ -- ^ A time period, e.g. a day, week, month or year of the + -- stream. If the periodMultiplier value is 0 (zero) then + -- period must contain the value D (day).+ }+ deriving (Eq,Show)+instance SchemaType Period where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Period a0)+ `apply` parseSchemaType "periodMultiplier"+ `apply` parseSchemaType "period"+ schemaTypeToXML s x@Period{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ period_ID x+ ]+ [ schemaTypeToXML "periodMultiplier" $ period_multiplier x+ , schemaTypeToXML "period" $ period x+ ]+ +data PeriodicDates = PeriodicDates+ { periodDates_calculationStartDate :: Maybe AdjustableOrRelativeDate+ , periodDates_calculationEndDate :: Maybe AdjustableOrRelativeDate+ , periodDates_calculationPeriodFrequency :: Maybe CalculationPeriodFrequency+ -- ^ The frequency at which calculation period end dates occur + -- with the regular part of the calculation period schedule + -- and their roll date convention.+ , periodDates_calculationPeriodDatesAdjustments :: Maybe BusinessDayAdjustments+ -- ^ The business day convention to apply to each calculation + -- period end date if it would otherwise fall on a day that is + -- not a business day in the specified financial business + -- centers.+ }+ deriving (Eq,Show)+instance SchemaType PeriodicDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PeriodicDates+ `apply` optional (parseSchemaType "calculationStartDate")+ `apply` optional (parseSchemaType "calculationEndDate")+ `apply` optional (parseSchemaType "calculationPeriodFrequency")+ `apply` optional (parseSchemaType "calculationPeriodDatesAdjustments")+ schemaTypeToXML s x@PeriodicDates{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "calculationStartDate") $ periodDates_calculationStartDate x+ , maybe [] (schemaTypeToXML "calculationEndDate") $ periodDates_calculationEndDate x+ , maybe [] (schemaTypeToXML "calculationPeriodFrequency") $ periodDates_calculationPeriodFrequency x+ , maybe [] (schemaTypeToXML "calculationPeriodDatesAdjustments") $ periodDates_calculationPeriodDatesAdjustments x+ ]+ +-- | A type defining a currency amount or a currency amount +-- schedule.+data PositiveAmountSchedule = PositiveAmountSchedule+ { positAmountSched_ID :: Maybe Xsd.ID+ , positAmountSched_initialValue :: PositiveDecimal+ -- ^ The strictly-positive initial rate or amount, as the case + -- may be. An initial rate of 5% would be represented as 0.05.+ , positAmountSched_step :: [PositiveStep]+ -- ^ The schedule of step date and strictly-positive value + -- pairs. On each step date the associated step value becomes + -- effective. A list of steps may be ordered in the document + -- by ascending step date. An FpML document containing an + -- unordered list of steps is still regarded as a conformant + -- document.+ , positAmountSched_currency :: Maybe Currency+ -- ^ The currency in which an amount is denominated.+ }+ deriving (Eq,Show)+instance SchemaType PositiveAmountSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PositiveAmountSchedule a0)+ `apply` parseSchemaType "initialValue"+ `apply` many (parseSchemaType "step")+ `apply` optional (parseSchemaType "currency")+ schemaTypeToXML s x@PositiveAmountSchedule{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ positAmountSched_ID x+ ]+ [ schemaTypeToXML "initialValue" $ positAmountSched_initialValue x+ , concatMap (schemaTypeToXML "step") $ positAmountSched_step x+ , maybe [] (schemaTypeToXML "currency") $ positAmountSched_currency x+ ]+instance Extension PositiveAmountSchedule PositiveSchedule where+ supertype (PositiveAmountSchedule a0 e0 e1 e2) =+ PositiveSchedule a0 e0 e1+ +-- | A type defining a positive money amount+data PositiveMoney = PositiveMoney+ { positMoney_ID :: Maybe Xsd.ID+ , positMoney_currency :: Currency+ -- ^ The currency in which an amount is denominated.+ , positMoney_amount :: Maybe PositiveDecimal+ -- ^ The positive monetary quantity in currency units.+ }+ deriving (Eq,Show)+instance SchemaType PositiveMoney where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PositiveMoney a0)+ `apply` parseSchemaType "currency"+ `apply` optional (parseSchemaType "amount")+ schemaTypeToXML s x@PositiveMoney{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ positMoney_ID x+ ]+ [ schemaTypeToXML "currency" $ positMoney_currency x+ , maybe [] (schemaTypeToXML "amount") $ positMoney_amount x+ ]+instance Extension PositiveMoney MoneyBase where+ supertype v = MoneyBase_PositiveMoney v+ +-- | A complex type to specify positive payments.+data PositivePayment = PositivePayment+ { positPayment_ID :: Maybe Xsd.ID+ , positPayment_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , positPayment_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , positPayment_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , positPayment_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , positPayment_paymentDate :: Maybe AdjustableOrRelativeDate+ -- ^ The payment date, which can be expressed as either an + -- adjustable or relative date.+ , positPayment_paymentAmount :: Maybe PositiveMoney+ -- ^ Positive payment amount.+ }+ deriving (Eq,Show)+instance SchemaType PositivePayment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PositivePayment a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "paymentDate")+ `apply` optional (parseSchemaType "paymentAmount")+ schemaTypeToXML s x@PositivePayment{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ positPayment_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ positPayment_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ positPayment_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ positPayment_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ positPayment_receiverAccountReference x+ , maybe [] (schemaTypeToXML "paymentDate") $ positPayment_paymentDate x+ , maybe [] (schemaTypeToXML "paymentAmount") $ positPayment_paymentAmount x+ ]+instance Extension PositivePayment PaymentBaseExtended where+ supertype v = PaymentBaseExtended_PositivePayment v+instance Extension PositivePayment PaymentBase where+ supertype = (supertype :: PaymentBaseExtended -> PaymentBase)+ . (supertype :: PositivePayment -> PaymentBaseExtended)+ + +-- | A type defining a schedule of strictly-postive rates or +-- amounts in terms of an initial value and then a series of +-- step date and value pairs. On each step date the rate or +-- amount changes to the new step value. The series of step +-- date and value pairs are optional. If not specified, this +-- implies that the initial value remains unchanged over time.+data PositiveSchedule = PositiveSchedule+ { positSched_ID :: Maybe Xsd.ID+ , positSched_initialValue :: PositiveDecimal+ -- ^ The strictly-positive initial rate or amount, as the case + -- may be. An initial rate of 5% would be represented as 0.05.+ , positSched_step :: [PositiveStep]+ -- ^ The schedule of step date and strictly-positive value + -- pairs. On each step date the associated step value becomes + -- effective. A list of steps may be ordered in the document + -- by ascending step date. An FpML document containing an + -- unordered list of steps is still regarded as a conformant + -- document.+ }+ deriving (Eq,Show)+instance SchemaType PositiveSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PositiveSchedule a0)+ `apply` parseSchemaType "initialValue"+ `apply` many (parseSchemaType "step")+ schemaTypeToXML s x@PositiveSchedule{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ positSched_ID x+ ]+ [ schemaTypeToXML "initialValue" $ positSched_initialValue x+ , concatMap (schemaTypeToXML "step") $ positSched_step x+ ]+ +-- | A type defining a step date and strictly-positive step +-- value pair. This step definitions are used to define +-- varying rate or amount schedules, e.g. a notional +-- amortization or a step-up coupon schedule.+data PositiveStep = PositiveStep+ { positiveStep_ID :: Maybe Xsd.ID+ , positiveStep_stepDate :: Maybe Xsd.Date+ -- ^ The date on which the associated stepValue becomes + -- effective. This day may be subject to adjustment in + -- accordance with a business day convention.+ , positiveStep_stepValue :: Maybe PositiveDecimal+ -- ^ The strictly positive rate or amount which becomes + -- effective on the associated stepDate. A rate of 5% would be + -- represented as 0.05.+ }+ deriving (Eq,Show)+instance SchemaType PositiveStep where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PositiveStep a0)+ `apply` optional (parseSchemaType "stepDate")+ `apply` optional (parseSchemaType "stepValue")+ schemaTypeToXML s x@PositiveStep{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ positiveStep_ID x+ ]+ [ maybe [] (schemaTypeToXML "stepDate") $ positiveStep_stepDate x+ , maybe [] (schemaTypeToXML "stepValue") $ positiveStep_stepValue x+ ]+instance Extension PositiveStep StepBase where+ supertype v = StepBase_PositiveStep v+ +-- | A type for defining a time with respect to a geographic +-- location, for example 11:00 Phoenix, USA. This type should +-- be used where a wider range of locations than those +-- available as business centres is required.+data PrevailingTime = PrevailingTime+ { prevaTime_hourMinuteTime :: Maybe HourMinuteTime+ -- ^ A time specified in hh:mm:ss format where the second + -- component must be '00', e.g. 11am would be represented as + -- 11:00:00.+ , prevaTime_location :: Maybe TimezoneLocation+ -- ^ The geographic location to which the hourMinuteTime + -- applies. The time takes into account any current day light + -- saving changes or other adjustments i.e. it is the + -- prevaling time at the location.+ }+ deriving (Eq,Show)+instance SchemaType PrevailingTime where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PrevailingTime+ `apply` optional (parseSchemaType "hourMinuteTime")+ `apply` optional (parseSchemaType "location")+ schemaTypeToXML s x@PrevailingTime{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "hourMinuteTime") $ prevaTime_hourMinuteTime x+ , maybe [] (schemaTypeToXML "location") $ prevaTime_location x+ ]+ +-- | An abstract pricing structure base type. Used as a base for +-- structures such as yield curves and volatility matrices.+data PricingStructure+ = PricingStructure_YieldCurve YieldCurve+ | PricingStructure_VolatilityRepresentation VolatilityRepresentation+ | PricingStructure_FxCurve FxCurve+ | PricingStructure_CreditCurve CreditCurve+ + deriving (Eq,Show)+instance SchemaType PricingStructure where+ parseSchemaType s = do+ (fmap PricingStructure_YieldCurve $ parseSchemaType s)+ `onFail`+ (fmap PricingStructure_VolatilityRepresentation $ parseSchemaType s)+ `onFail`+ (fmap PricingStructure_FxCurve $ parseSchemaType s)+ `onFail`+ (fmap PricingStructure_CreditCurve $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of PricingStructure,\n\+\ namely one of:\n\+\YieldCurve,VolatilityRepresentation,FxCurve,CreditCurve"+ schemaTypeToXML _s (PricingStructure_YieldCurve x) = schemaTypeToXML "yieldCurve" x+ schemaTypeToXML _s (PricingStructure_VolatilityRepresentation x) = schemaTypeToXML "volatilityRepresentation" x+ schemaTypeToXML _s (PricingStructure_FxCurve x) = schemaTypeToXML "fxCurve" x+ schemaTypeToXML _s (PricingStructure_CreditCurve x) = schemaTypeToXML "creditCurve" x+ +-- | Reference to a pricing structure or any derived components +-- (i.e. yield curve).+data PricingStructureReference = PricingStructureReference+ { pricingStructRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType PricingStructureReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (PricingStructureReference a0)+ schemaTypeToXML s x@PricingStructureReference{} =+ toXMLElement s [ toXMLAttribute "href" $ pricingStructRef_href x+ ]+ []+instance Extension PricingStructureReference Reference where+ supertype v = Reference_PricingStructureReference v+ +-- | A type defining which principal exchanges occur for the +-- stream.+data PrincipalExchanges = PrincipalExchanges+ { princExchan_ID :: Maybe Xsd.ID+ , princExchan_initialExchange :: Maybe Xsd.Boolean+ -- ^ A true/false flag to indicate whether there is an initial + -- exchange of principal on the effective date.+ , princExchan_finalExchange :: Maybe Xsd.Boolean+ -- ^ A true/false flag to indicate whether there is a final + -- exchange of principal on the termination date.+ , princExchan_intermediateExchange :: Maybe Xsd.Boolean+ -- ^ A true/false flag to indicate whether there are + -- intermediate or interim exchanges of principal during the + -- term of the swap.+ }+ deriving (Eq,Show)+instance SchemaType PrincipalExchanges where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (PrincipalExchanges a0)+ `apply` optional (parseSchemaType "initialExchange")+ `apply` optional (parseSchemaType "finalExchange")+ `apply` optional (parseSchemaType "intermediateExchange")+ schemaTypeToXML s x@PrincipalExchanges{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ princExchan_ID x+ ]+ [ maybe [] (schemaTypeToXML "initialExchange") $ princExchan_initialExchange x+ , maybe [] (schemaTypeToXML "finalExchange") $ princExchan_finalExchange x+ , maybe [] (schemaTypeToXML "intermediateExchange") $ princExchan_intermediateExchange x+ ]+ +-- | The base type which all FpML products extend.+data Product+ = Product_StandardProduct StandardProduct+ | Product_Option Option+ | Product_Swaption Swaption+ | Product_Swap Swap+ | Product_Fra Fra+ | Product_CapFloor CapFloor+ | Product_BulletPayment BulletPayment+ | Product_GenericProduct GenericProduct+ | Product_TermDeposit TermDeposit+ | Product_FxSwap FxSwap+ | Product_FxSingleLeg FxSingleLeg+ | Product_ReturnSwapBase ReturnSwapBase+ | Product_NettedSwapBase NettedSwapBase+ | Product_Strategy Strategy+ | Product_InstrumentTradeDetails InstrumentTradeDetails+ | Product_DividendSwapTransactionSupplement DividendSwapTransactionSupplement+ | Product_CommoditySwaption CommoditySwaption+ | Product_CommoditySwap CommoditySwap+ | Product_CommodityOption CommodityOption+ | Product_CommodityForward CommodityForward+ | Product_CreditDefaultSwap CreditDefaultSwap+ | Product_EquityDerivativeBase EquityDerivativeBase+ | Product_VarianceSwapTransactionSupplement VarianceSwapTransactionSupplement+ + deriving (Eq,Show)+instance SchemaType Product where+ parseSchemaType s = do+ (fmap Product_StandardProduct $ parseSchemaType s)+ `onFail`+ (fmap Product_Option $ parseSchemaType s)+ `onFail`+ (fmap Product_Swaption $ parseSchemaType s)+ `onFail`+ (fmap Product_Swap $ parseSchemaType s)+ `onFail`+ (fmap Product_Fra $ parseSchemaType s)+ `onFail`+ (fmap Product_CapFloor $ parseSchemaType s)+ `onFail`+ (fmap Product_BulletPayment $ parseSchemaType s)+ `onFail`+ (fmap Product_GenericProduct $ parseSchemaType s)+ `onFail`+ (fmap Product_TermDeposit $ parseSchemaType s)+ `onFail`+ (fmap Product_FxSwap $ parseSchemaType s)+ `onFail`+ (fmap Product_FxSingleLeg $ parseSchemaType s)+ `onFail`+ (fmap Product_ReturnSwapBase $ parseSchemaType s)+ `onFail`+ (fmap Product_NettedSwapBase $ parseSchemaType s)+ `onFail`+ (fmap Product_Strategy $ parseSchemaType s)+ `onFail`+ (fmap Product_InstrumentTradeDetails $ parseSchemaType s)+ `onFail`+ (fmap Product_DividendSwapTransactionSupplement $ parseSchemaType s)+ `onFail`+ (fmap Product_CommoditySwaption $ parseSchemaType s)+ `onFail`+ (fmap Product_CommoditySwap $ parseSchemaType s)+ `onFail`+ (fmap Product_CommodityOption $ parseSchemaType s)+ `onFail`+ (fmap Product_CommodityForward $ parseSchemaType s)+ `onFail`+ (fmap Product_CreditDefaultSwap $ parseSchemaType s)+ `onFail`+ (fmap Product_EquityDerivativeBase $ parseSchemaType s)+ `onFail`+ (fmap Product_VarianceSwapTransactionSupplement $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of Product,\n\+\ namely one of:\n\+\StandardProduct,Option,Swaption,Swap,Fra,CapFloor,BulletPayment,GenericProduct,TermDeposit,FxSwap,FxSingleLeg,ReturnSwapBase,NettedSwapBase,Strategy,InstrumentTradeDetails,DividendSwapTransactionSupplement,CommoditySwaption,CommoditySwap,CommodityOption,CommodityForward,CreditDefaultSwap,EquityDerivativeBase,VarianceSwapTransactionSupplement"+ schemaTypeToXML _s (Product_StandardProduct x) = schemaTypeToXML "standardProduct" x+ schemaTypeToXML _s (Product_Option x) = schemaTypeToXML "option" x+ schemaTypeToXML _s (Product_Swaption x) = schemaTypeToXML "swaption" x+ schemaTypeToXML _s (Product_Swap x) = schemaTypeToXML "swap" x+ schemaTypeToXML _s (Product_Fra x) = schemaTypeToXML "fra" x+ schemaTypeToXML _s (Product_CapFloor x) = schemaTypeToXML "capFloor" x+ schemaTypeToXML _s (Product_BulletPayment x) = schemaTypeToXML "bulletPayment" x+ schemaTypeToXML _s (Product_GenericProduct x) = schemaTypeToXML "genericProduct" x+ schemaTypeToXML _s (Product_TermDeposit x) = schemaTypeToXML "termDeposit" x+ schemaTypeToXML _s (Product_FxSwap x) = schemaTypeToXML "fxSwap" x+ schemaTypeToXML _s (Product_FxSingleLeg x) = schemaTypeToXML "fxSingleLeg" x+ schemaTypeToXML _s (Product_ReturnSwapBase x) = schemaTypeToXML "returnSwapBase" x+ schemaTypeToXML _s (Product_NettedSwapBase x) = schemaTypeToXML "nettedSwapBase" x+ schemaTypeToXML _s (Product_Strategy x) = schemaTypeToXML "strategy" x+ schemaTypeToXML _s (Product_InstrumentTradeDetails x) = schemaTypeToXML "instrumentTradeDetails" x+ schemaTypeToXML _s (Product_DividendSwapTransactionSupplement x) = schemaTypeToXML "dividendSwapTransactionSupplement" x+ schemaTypeToXML _s (Product_CommoditySwaption x) = schemaTypeToXML "commoditySwaption" x+ schemaTypeToXML _s (Product_CommoditySwap x) = schemaTypeToXML "commoditySwap" x+ schemaTypeToXML _s (Product_CommodityOption x) = schemaTypeToXML "commodityOption" x+ schemaTypeToXML _s (Product_CommodityForward x) = schemaTypeToXML "commodityForward" x+ schemaTypeToXML _s (Product_CreditDefaultSwap x) = schemaTypeToXML "creditDefaultSwap" x+ schemaTypeToXML _s (Product_EquityDerivativeBase x) = schemaTypeToXML "equityDerivativeBase" x+ schemaTypeToXML _s (Product_VarianceSwapTransactionSupplement x) = schemaTypeToXML "varianceSwapTransactionSupplement" x+ +data ProductId = ProductId Scheme ProductIdAttributes deriving (Eq,Show)+data ProductIdAttributes = ProductIdAttributes+ { productIdAttrib_productIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ProductId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "productIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ProductId v (ProductIdAttributes a0)+ schemaTypeToXML s (ProductId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "productIdScheme") $ productIdAttrib_productIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ProductId Scheme where+ supertype (ProductId s _) = s+ +-- | Reference to a full FpML product.+data ProductReference = ProductReference+ { productRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType ProductReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (ProductReference a0)+ schemaTypeToXML s x@ProductReference{} =+ toXMLElement s [ toXMLAttribute "href" $ productRef_href x+ ]+ []+instance Extension ProductReference Reference where+ supertype v = Reference_ProductReference v+ +data ProductType = ProductType Scheme ProductTypeAttributes deriving (Eq,Show)+data ProductTypeAttributes = ProductTypeAttributes+ { productTypeAttrib_productTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ProductType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "productTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ProductType v (ProductTypeAttributes a0)+ schemaTypeToXML s (ProductType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "productTypeScheme") $ productTypeAttrib_productTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ProductType Scheme where+ supertype (ProductType s _) = s+ +-- | A type that describes the composition of a rate that has +-- been quoted or is to be quoted. This includes the two +-- currencies and the quotation relationship between the two +-- currencies and is used as a building block throughout the +-- FX specification.+data QuotedCurrencyPair = QuotedCurrencyPair+ { quotedCurrenPair_currency1 :: Maybe Currency+ -- ^ The first currency specified when a pair of currencies is + -- to be evaluated.+ , quotedCurrenPair_currency2 :: Maybe Currency+ -- ^ The second currency specified when a pair of currencies is + -- to be evaluated.+ , quotedCurrenPair_quoteBasis :: Maybe QuoteBasisEnum+ -- ^ The method by which the exchange rate is quoted.+ }+ deriving (Eq,Show)+instance SchemaType QuotedCurrencyPair where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return QuotedCurrencyPair+ `apply` optional (parseSchemaType "currency1")+ `apply` optional (parseSchemaType "currency2")+ `apply` optional (parseSchemaType "quoteBasis")+ schemaTypeToXML s x@QuotedCurrencyPair{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "currency1") $ quotedCurrenPair_currency1 x+ , maybe [] (schemaTypeToXML "currency2") $ quotedCurrenPair_currency2 x+ , maybe [] (schemaTypeToXML "quoteBasis") $ quotedCurrenPair_quoteBasis x+ ]+ +-- | The abstract base class for all types which define interest +-- rate streams.+data Rate+ = Rate_FloatingRate FloatingRate+ + deriving (Eq,Show)+instance SchemaType Rate where+ parseSchemaType s = do+ (fmap Rate_FloatingRate $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of Rate,\n\+\ namely one of:\n\+\FloatingRate"+ schemaTypeToXML _s (Rate_FloatingRate x) = schemaTypeToXML "floatingRate" x+ +-- | Reference to any rate (floating, inflation) derived from +-- the abstract Rate component.+data RateReference = RateReference+ { rateRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType RateReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (RateReference a0)+ schemaTypeToXML s x@RateReference{} =+ toXMLElement s [ toXMLAttribute "href" $ rateRef_href x+ ]+ []+ +-- | A type defining parameters associated with an individual +-- observation or fixing. This type forms part of the cashflow +-- representation of a stream.+data RateObservation = RateObservation+ { rateObserv_ID :: Maybe Xsd.ID+ , rateObserv_resetDate :: Maybe Xsd.Date+ -- ^ The reset date.+ , rateObserv_adjustedFixingDate :: Maybe Xsd.Date+ -- ^ The adjusted fixing date, i.e. the actual date the rate is + -- observed. The date should already be adjusted for any + -- applicable business day convention.+ , rateObserv_observedRate :: Maybe Xsd.Decimal+ -- ^ The actual observed rate before any required rate treatment + -- is applied, e.g. before converting a rate quoted on a + -- discount basis to an equivalent yield. An observed rate of + -- 5% would be represented as 0.05.+ , rateObserv_treatedRate :: Maybe Xsd.Decimal+ -- ^ The observed rate after any required rate treatment is + -- applied. A treated rate of 5% would be represented as 0.05.+ , rateObserv_observationWeight :: Maybe Xsd.PositiveInteger+ -- ^ The number of days weighting to be associated with the rate + -- observation, i.e. the number of days such rate is in + -- effect. This is applicable in the case of a weighted + -- average method of calculation where more than one reset + -- date is established for a single calculation period.+ , rateObserv_rateReference :: Maybe RateReference+ -- ^ A pointer style reference to a floating rate component + -- defined as part of a stub calculation period amount + -- component. It is only required when it is necessary to + -- distinguish two rate observations for the same fixing date + -- which could occur when linear interpolation of two + -- different rates occurs for a stub calculation period.+ , rateObserv_forecastRate :: Maybe Xsd.Decimal+ -- ^ The value representing the forecast rate used to calculate + -- the forecast future value of the accrual period.A value of + -- 1% should be represented as 0.01+ , rateObserv_treatedForecastRate :: Maybe Xsd.Decimal+ -- ^ The value representing the forecast rate after applying + -- rate treatment rules. A value of 1% should be represented + -- as 0.01+ }+ deriving (Eq,Show)+instance SchemaType RateObservation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (RateObservation a0)+ `apply` optional (parseSchemaType "resetDate")+ `apply` optional (parseSchemaType "adjustedFixingDate")+ `apply` optional (parseSchemaType "observedRate")+ `apply` optional (parseSchemaType "treatedRate")+ `apply` optional (parseSchemaType "observationWeight")+ `apply` optional (parseSchemaType "rateReference")+ `apply` optional (parseSchemaType "forecastRate")+ `apply` optional (parseSchemaType "treatedForecastRate")+ schemaTypeToXML s x@RateObservation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ rateObserv_ID x+ ]+ [ maybe [] (schemaTypeToXML "resetDate") $ rateObserv_resetDate x+ , maybe [] (schemaTypeToXML "adjustedFixingDate") $ rateObserv_adjustedFixingDate x+ , maybe [] (schemaTypeToXML "observedRate") $ rateObserv_observedRate x+ , maybe [] (schemaTypeToXML "treatedRate") $ rateObserv_treatedRate x+ , maybe [] (schemaTypeToXML "observationWeight") $ rateObserv_observationWeight x+ , maybe [] (schemaTypeToXML "rateReference") $ rateObserv_rateReference x+ , maybe [] (schemaTypeToXML "forecastRate") $ rateObserv_forecastRate x+ , maybe [] (schemaTypeToXML "treatedForecastRate") $ rateObserv_treatedForecastRate x+ ]+ +data RateSourcePage = RateSourcePage Scheme RateSourcePageAttributes deriving (Eq,Show)+data RateSourcePageAttributes = RateSourcePageAttributes+ { rateSourcePageAttrib_rateSourcePageScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType RateSourcePage where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "rateSourcePageScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ RateSourcePage v (RateSourcePageAttributes a0)+ schemaTypeToXML s (RateSourcePage bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "rateSourcePageScheme") $ rateSourcePageAttrib_rateSourcePageScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension RateSourcePage Scheme where+ supertype (RateSourcePage s _) = s+ +-- | The abstract base class for all types which define +-- intra-document pointers.+data Reference+ = Reference_SpreadScheduleReference SpreadScheduleReference+ | Reference_ScheduleReference ScheduleReference+ | Reference_ReturnSwapNotionalAmountReference ReturnSwapNotionalAmountReference+ | Reference_ProductReference ProductReference+ | Reference_PricingStructureReference PricingStructureReference+ | Reference_PaymentReference PaymentReference+ | Reference_PartyTradeIdentifierReference PartyTradeIdentifierReference+ | Reference_PersonReference PersonReference+ | Reference_BusinessUnitReference BusinessUnitReference+ | Reference_PartyReference PartyReference+ | Reference_NotionalReference NotionalReference+ | Reference_NotionalAmountReference NotionalAmountReference+ | Reference_LegalEntityReference LegalEntityReference+ | Reference_IdentifiedCurrencyReference IdentifiedCurrencyReference+ | Reference_HTTPAttachmentReference HTTPAttachmentReference+ | Reference_DeterminationMethodReference DeterminationMethodReference+ | Reference_DateReference DateReference+ | Reference_BusinessDayAdjustmentsReference BusinessDayAdjustmentsReference+ | Reference_BusinessCentersReference BusinessCentersReference+ | Reference_AmountReference AmountReference+ | Reference_AccountReference AccountReference+ | Reference_AssetReference AssetReference+ | Reference_AnyAssetReference AnyAssetReference+ | Reference_CreditEventsReference CreditEventsReference+ | Reference_ValuationDatesReference ValuationDatesReference+ | Reference_ResetDatesReference ResetDatesReference+ | Reference_RelevantUnderlyingDateReference RelevantUnderlyingDateReference+ | Reference_PaymentDatesReference PaymentDatesReference+ | Reference_InterestRateStreamReference InterestRateStreamReference+ | Reference_CalculationPeriodDatesReference CalculationPeriodDatesReference+ | Reference_MoneyReference MoneyReference+ | Reference_InterestLegCalculationPeriodDatesReference InterestLegCalculationPeriodDatesReference+ | Reference_FloatingRateCalculationReference FloatingRateCalculationReference+ | Reference_SettlementPeriodsReference SettlementPeriodsReference+ | Reference_QuantityReference QuantityReference+ | Reference_QuantityScheduleReference QuantityScheduleReference+ | Reference_LagReference LagReference+ | Reference_CalculationPeriodsScheduleReference CalculationPeriodsScheduleReference+ | Reference_CalculationPeriodsReference CalculationPeriodsReference+ | Reference_CalculationPeriodsDatesReference CalculationPeriodsDatesReference+ | Reference_SettlementTermsReference SettlementTermsReference+ | Reference_ProtectionTermsReference ProtectionTermsReference+ | Reference_FixedRateReference FixedRateReference+ | Reference_ValuationScenarioReference ValuationScenarioReference+ | Reference_ValuationReference ValuationReference+ | Reference_SensitivitySetDefinitionReference SensitivitySetDefinitionReference+ | Reference_PricingParameterDerivativeReference PricingParameterDerivativeReference+ | Reference_PricingDataPointCoordinateReference PricingDataPointCoordinateReference+ | Reference_MarketReference MarketReference+ | Reference_AssetOrTermPointOrPricingStructureReference AssetOrTermPointOrPricingStructureReference+ + deriving (Eq,Show)+instance SchemaType Reference where+ parseSchemaType s = do+ (fmap Reference_SpreadScheduleReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_ScheduleReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_ReturnSwapNotionalAmountReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_ProductReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_PricingStructureReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_PaymentReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_PartyTradeIdentifierReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_PersonReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_BusinessUnitReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_PartyReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_NotionalReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_NotionalAmountReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_LegalEntityReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_IdentifiedCurrencyReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_HTTPAttachmentReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_DeterminationMethodReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_DateReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_BusinessDayAdjustmentsReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_BusinessCentersReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_AmountReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_AccountReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_AssetReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_AnyAssetReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_CreditEventsReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_ValuationDatesReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_ResetDatesReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_RelevantUnderlyingDateReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_PaymentDatesReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_InterestRateStreamReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_CalculationPeriodDatesReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_MoneyReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_InterestLegCalculationPeriodDatesReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_FloatingRateCalculationReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_SettlementPeriodsReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_QuantityReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_QuantityScheduleReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_LagReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_CalculationPeriodsScheduleReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_CalculationPeriodsReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_CalculationPeriodsDatesReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_SettlementTermsReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_ProtectionTermsReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_FixedRateReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_ValuationScenarioReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_ValuationReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_SensitivitySetDefinitionReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_PricingParameterDerivativeReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_PricingDataPointCoordinateReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_MarketReference $ parseSchemaType s)+ `onFail`+ (fmap Reference_AssetOrTermPointOrPricingStructureReference $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of Reference,\n\+\ namely one of:\n\+\SpreadScheduleReference,ScheduleReference,ReturnSwapNotionalAmountReference,ProductReference,PricingStructureReference,PaymentReference,PartyTradeIdentifierReference,PersonReference,BusinessUnitReference,PartyReference,NotionalReference,NotionalAmountReference,LegalEntityReference,IdentifiedCurrencyReference,HTTPAttachmentReference,DeterminationMethodReference,DateReference,BusinessDayAdjustmentsReference,BusinessCentersReference,AmountReference,AccountReference,AssetReference,AnyAssetReference,CreditEventsReference,ValuationDatesReference,ResetDatesReference,RelevantUnderlyingDateReference,PaymentDatesReference,InterestRateStreamReference,CalculationPeriodDatesReference,MoneyReference,InterestLegCalculationPeriodDatesReference,FloatingRateCalculationReference,SettlementPeriodsReference,QuantityReference,QuantityScheduleReference,LagReference,CalculationPeriodsScheduleReference,CalculationPeriodsReference,CalculationPeriodsDatesReference,SettlementTermsReference,ProtectionTermsReference,FixedRateReference,ValuationScenarioReference,ValuationReference,SensitivitySetDefinitionReference,PricingParameterDerivativeReference,PricingDataPointCoordinateReference,MarketReference,AssetOrTermPointOrPricingStructureReference"+ schemaTypeToXML _s (Reference_SpreadScheduleReference x) = schemaTypeToXML "spreadScheduleReference" x+ schemaTypeToXML _s (Reference_ScheduleReference x) = schemaTypeToXML "scheduleReference" x+ schemaTypeToXML _s (Reference_ReturnSwapNotionalAmountReference x) = schemaTypeToXML "returnSwapNotionalAmountReference" x+ schemaTypeToXML _s (Reference_ProductReference x) = schemaTypeToXML "productReference" x+ schemaTypeToXML _s (Reference_PricingStructureReference x) = schemaTypeToXML "pricingStructureReference" x+ schemaTypeToXML _s (Reference_PaymentReference x) = schemaTypeToXML "paymentReference" x+ schemaTypeToXML _s (Reference_PartyTradeIdentifierReference x) = schemaTypeToXML "partyTradeIdentifierReference" x+ schemaTypeToXML _s (Reference_PersonReference x) = schemaTypeToXML "personReference" x+ schemaTypeToXML _s (Reference_BusinessUnitReference x) = schemaTypeToXML "businessUnitReference" x+ schemaTypeToXML _s (Reference_PartyReference x) = schemaTypeToXML "partyReference" x+ schemaTypeToXML _s (Reference_NotionalReference x) = schemaTypeToXML "notionalReference" x+ schemaTypeToXML _s (Reference_NotionalAmountReference x) = schemaTypeToXML "notionalAmountReference" x+ schemaTypeToXML _s (Reference_LegalEntityReference x) = schemaTypeToXML "legalEntityReference" x+ schemaTypeToXML _s (Reference_IdentifiedCurrencyReference x) = schemaTypeToXML "identifiedCurrencyReference" x+ schemaTypeToXML _s (Reference_HTTPAttachmentReference x) = schemaTypeToXML "hTTPAttachmentReference" x+ schemaTypeToXML _s (Reference_DeterminationMethodReference x) = schemaTypeToXML "determinationMethodReference" x+ schemaTypeToXML _s (Reference_DateReference x) = schemaTypeToXML "dateReference" x+ schemaTypeToXML _s (Reference_BusinessDayAdjustmentsReference x) = schemaTypeToXML "businessDayAdjustmentsReference" x+ schemaTypeToXML _s (Reference_BusinessCentersReference x) = schemaTypeToXML "businessCentersReference" x+ schemaTypeToXML _s (Reference_AmountReference x) = schemaTypeToXML "amountReference" x+ schemaTypeToXML _s (Reference_AccountReference x) = schemaTypeToXML "accountReference" x+ schemaTypeToXML _s (Reference_AssetReference x) = schemaTypeToXML "assetReference" x+ schemaTypeToXML _s (Reference_AnyAssetReference x) = schemaTypeToXML "anyAssetReference" x+ schemaTypeToXML _s (Reference_CreditEventsReference x) = schemaTypeToXML "creditEventsReference" x+ schemaTypeToXML _s (Reference_ValuationDatesReference x) = schemaTypeToXML "valuationDatesReference" x+ schemaTypeToXML _s (Reference_ResetDatesReference x) = schemaTypeToXML "resetDatesReference" x+ schemaTypeToXML _s (Reference_RelevantUnderlyingDateReference x) = schemaTypeToXML "relevantUnderlyingDateReference" x+ schemaTypeToXML _s (Reference_PaymentDatesReference x) = schemaTypeToXML "paymentDatesReference" x+ schemaTypeToXML _s (Reference_InterestRateStreamReference x) = schemaTypeToXML "interestRateStreamReference" x+ schemaTypeToXML _s (Reference_CalculationPeriodDatesReference x) = schemaTypeToXML "calculationPeriodDatesReference" x+ schemaTypeToXML _s (Reference_MoneyReference x) = schemaTypeToXML "moneyReference" x+ schemaTypeToXML _s (Reference_InterestLegCalculationPeriodDatesReference x) = schemaTypeToXML "interestLegCalculationPeriodDatesReference" x+ schemaTypeToXML _s (Reference_FloatingRateCalculationReference x) = schemaTypeToXML "floatingRateCalculationReference" x+ schemaTypeToXML _s (Reference_SettlementPeriodsReference x) = schemaTypeToXML "settlementPeriodsReference" x+ schemaTypeToXML _s (Reference_QuantityReference x) = schemaTypeToXML "quantityReference" x+ schemaTypeToXML _s (Reference_QuantityScheduleReference x) = schemaTypeToXML "quantityScheduleReference" x+ schemaTypeToXML _s (Reference_LagReference x) = schemaTypeToXML "lagReference" x+ schemaTypeToXML _s (Reference_CalculationPeriodsScheduleReference x) = schemaTypeToXML "calculationPeriodsScheduleReference" x+ schemaTypeToXML _s (Reference_CalculationPeriodsReference x) = schemaTypeToXML "calculationPeriodsReference" x+ schemaTypeToXML _s (Reference_CalculationPeriodsDatesReference x) = schemaTypeToXML "calculationPeriodsDatesReference" x+ schemaTypeToXML _s (Reference_SettlementTermsReference x) = schemaTypeToXML "settlementTermsReference" x+ schemaTypeToXML _s (Reference_ProtectionTermsReference x) = schemaTypeToXML "protectionTermsReference" x+ schemaTypeToXML _s (Reference_FixedRateReference x) = schemaTypeToXML "fixedRateReference" x+ schemaTypeToXML _s (Reference_ValuationScenarioReference x) = schemaTypeToXML "valuationScenarioReference" x+ schemaTypeToXML _s (Reference_ValuationReference x) = schemaTypeToXML "valuationReference" x+ schemaTypeToXML _s (Reference_SensitivitySetDefinitionReference x) = schemaTypeToXML "sensitivitySetDefinitionReference" x+ schemaTypeToXML _s (Reference_PricingParameterDerivativeReference x) = schemaTypeToXML "pricingParameterDerivativeReference" x+ schemaTypeToXML _s (Reference_PricingDataPointCoordinateReference x) = schemaTypeToXML "pricingDataPointCoordinateReference" x+ schemaTypeToXML _s (Reference_MarketReference x) = schemaTypeToXML "marketReference" x+ schemaTypeToXML _s (Reference_AssetOrTermPointOrPricingStructureReference x) = schemaTypeToXML "assetOrTermPointOrPricingStructureReference" x+ +-- | Specifies the reference amount using a scheme.+data ReferenceAmount = ReferenceAmount Scheme ReferenceAmountAttributes deriving (Eq,Show)+data ReferenceAmountAttributes = ReferenceAmountAttributes+ { refAmountAttrib_referenceAmountScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ReferenceAmount where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "referenceAmountScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ReferenceAmount v (ReferenceAmountAttributes a0)+ schemaTypeToXML s (ReferenceAmount bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "referenceAmountScheme") $ refAmountAttrib_referenceAmountScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ReferenceAmount Scheme where+ supertype (ReferenceAmount s _) = s+ +-- | A type to describe an institution (party) identified by +-- means of a coding scheme and an optional name.+data ReferenceBank = ReferenceBank+ { referenceBank_id :: Maybe ReferenceBankId+ -- ^ An institution (party) identifier, e.g. a bank identifier + -- code (BIC).+ , referenceBank_name :: Maybe Xsd.XsdString+ -- ^ The name of the institution (party). A free format string. + -- FpML does not define usage rules for the element.+ }+ deriving (Eq,Show)+instance SchemaType ReferenceBank where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReferenceBank+ `apply` optional (parseSchemaType "referenceBankId")+ `apply` optional (parseSchemaType "referenceBankName")+ schemaTypeToXML s x@ReferenceBank{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "referenceBankId") $ referenceBank_id x+ , maybe [] (schemaTypeToXML "referenceBankName") $ referenceBank_name x+ ]+ +data ReferenceBankId = ReferenceBankId Scheme ReferenceBankIdAttributes deriving (Eq,Show)+data ReferenceBankIdAttributes = ReferenceBankIdAttributes+ { refBankIdAttrib_referenceBankIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ReferenceBankId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "referenceBankIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ReferenceBankId v (ReferenceBankIdAttributes a0)+ schemaTypeToXML s (ReferenceBankId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "referenceBankIdScheme") $ refBankIdAttrib_referenceBankIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ReferenceBankId Scheme where+ supertype (ReferenceBankId s _) = s+ +data RelatedBusinessUnit = RelatedBusinessUnit+ { relatedBusUnit_businessUnitReference :: BusinessUnitReference+ -- ^ The unit that is related to this.+ , relatedBusUnit_role :: BusinessUnitRole+ -- ^ The category of the relationship. The related unit performs + -- the role specified in this field for the base party. For + -- example, if the role is "Trader", the related unit acts + -- acts or acted as the base party's trading unit.+ }+ deriving (Eq,Show)+instance SchemaType RelatedBusinessUnit where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return RelatedBusinessUnit+ `apply` parseSchemaType "businessUnitReference"+ `apply` parseSchemaType "role"+ schemaTypeToXML s x@RelatedBusinessUnit{} =+ toXMLElement s []+ [ schemaTypeToXML "businessUnitReference" $ relatedBusUnit_businessUnitReference x+ , schemaTypeToXML "role" $ relatedBusUnit_role x+ ]+ +data RelatedParty = RelatedParty+ { relatedParty_partyReference :: PartyReference+ -- ^ Reference to a party.+ , relatedParty_accountReference :: Maybe AccountReference+ -- ^ Reference to an account.+ , relatedParty_role :: PartyRole+ -- ^ The category of the relationship. The related party + -- performs the role specified in this field for the base + -- party. For example, if the role is "Guarantor", the related + -- party acts as a guarantor for the base party.+ , relatedParty_type :: Maybe PartyRoleType+ -- ^ Additional definition refining the type of relationship. + -- For example, if the "role" is Guarantor, this element may + -- be used to specify whether all positions are guaranteed, or + -- only a subset of them.+ }+ deriving (Eq,Show)+instance SchemaType RelatedParty where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return RelatedParty+ `apply` parseSchemaType "partyReference"+ `apply` optional (parseSchemaType "accountReference")+ `apply` parseSchemaType "role"+ `apply` optional (parseSchemaType "type")+ schemaTypeToXML s x@RelatedParty{} =+ toXMLElement s []+ [ schemaTypeToXML "partyReference" $ relatedParty_partyReference x+ , maybe [] (schemaTypeToXML "accountReference") $ relatedParty_accountReference x+ , schemaTypeToXML "role" $ relatedParty_role x+ , maybe [] (schemaTypeToXML "type") $ relatedParty_type x+ ]+ +data RelatedPerson = RelatedPerson+ { relatedPerson_personReference :: PersonReference+ -- ^ The individual person that is related to this.+ , relatedPerson_role :: PersonRole+ -- ^ The category of the relationship. The related individual + -- performs the role specified in this field for the base + -- party. For example, if the role is "Trader", the related + -- person acts acts or acted as the base party's trader.+ }+ deriving (Eq,Show)+instance SchemaType RelatedPerson where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return RelatedPerson+ `apply` parseSchemaType "personReference"+ `apply` parseSchemaType "role"+ schemaTypeToXML s x@RelatedPerson{} =+ toXMLElement s []+ [ schemaTypeToXML "personReference" $ relatedPerson_personReference x+ , schemaTypeToXML "role" $ relatedPerson_role x+ ]+ +-- | A type describing a role played by a unit in one or more +-- transactions. Examples include roles such as Trader, +-- Collateral, Confirmation, Settlement, etc. This can be +-- extended to provide custom roles.+data BusinessUnitRole = BusinessUnitRole Scheme BusinessUnitRoleAttributes deriving (Eq,Show)+data BusinessUnitRoleAttributes = BusinessUnitRoleAttributes+ { busUnitRoleAttrib_unitRoleScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType BusinessUnitRole where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "unitRoleScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ BusinessUnitRole v (BusinessUnitRoleAttributes a0)+ schemaTypeToXML s (BusinessUnitRole bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "unitRoleScheme") $ busUnitRoleAttrib_unitRoleScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension BusinessUnitRole Scheme where+ supertype (BusinessUnitRole s _) = s+ +-- | A type describing a role played by a person in one or more +-- transactions. Examples include roles such as Trader, +-- Broker, MiddleOffice, Legal, etc. This can be extended to +-- provide custom roles.+data PersonRole = PersonRole Scheme PersonRoleAttributes deriving (Eq,Show)+data PersonRoleAttributes = PersonRoleAttributes+ { personRoleAttrib_personRoleScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType PersonRole where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "personRoleScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ PersonRole v (PersonRoleAttributes a0)+ schemaTypeToXML s (PersonRole bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "personRoleScheme") $ personRoleAttrib_personRoleScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension PersonRole Scheme where+ supertype (PersonRole s _) = s+ +-- | A type defining a date (referred to as the derived date) as +-- a relative offset from another date (referred to as the +-- anchor date). If the anchor date is itself an adjustable +-- date then the offset is assumed to be calculated from the +-- adjusted anchor date. A number of different scenarios can +-- be supported, namely; 1) the derived date may simply be a +-- number of calendar periods (days, weeks, months or years) +-- preceding or following the anchor date; 2) the unadjusted +-- derived date may be a number of calendar periods (days, +-- weeks, months or years) preceding or following the anchor +-- date with the resulting unadjusted derived date subject to +-- adjustment in accordance with a specified business day +-- convention, i.e. the derived date must fall on a good +-- business day; 3) the derived date may be a number of +-- business days preceding or following the anchor date. Note +-- that the businessDayConvention specifies any required +-- adjustment to the unadjusted derived date. A negative or +-- positive value in the periodMultiplier indicates whether +-- the unadjusted derived precedes or follows the anchor date. +-- The businessDayConvention should contain a value NONE if +-- the day type element contains a value of Business (since +-- specifying a negative or positive business days offset +-- would already guarantee that the derived date would fall on +-- a good business day in the specified business centers).+data RelativeDateOffset = RelativeDateOffset+ { relatDateOffset_ID :: Maybe Xsd.ID+ , relatDateOffset_periodMultiplier :: Xsd.Integer+ -- ^ A time period multiplier, e.g. 1, 2 or 3 etc. A negative + -- value can be used when specifying an offset relative to + -- another date, e.g. -2 days.+ , relatDateOffset_period :: PeriodEnum+ -- ^ A time period, e.g. a day, week, month or year of the + -- stream. If the periodMultiplier value is 0 (zero) then + -- period must contain the value D (day).+ , relatDateOffset_dayType :: Maybe DayTypeEnum+ -- ^ In the case of an offset specified as a number of days, + -- this element defines whether consideration is given as to + -- whether a day is a good business day or not. If a day type + -- of business days is specified then non-business days are + -- ignored when calculating the offset. The financial business + -- centers to use for determination of business days are + -- implied by the context in which this element is used. This + -- element must only be included when the offset is specified + -- as a number of days. If the offset is zero days then the + -- dayType element should not be included.+ , relatDateOffset_businessDayConvention :: Maybe BusinessDayConventionEnum+ -- ^ The convention for adjusting a date if it would otherwise + -- fall on a day that is not a business day.+ , relatDateOffset_choice4 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to a set of financial + -- business centers defined elsewhere in the document. + -- This set of business centers is used to determine + -- whether a particular day is a business day or not.+ -- + -- (2) businessCenters+ , relatDateOffset_dateRelativeTo :: Maybe DateReference+ -- ^ Specifies the anchor as an href attribute. The href + -- attribute value is a pointer style reference to the element + -- or component elsewhere in the document where the anchor + -- date is defined.+ , relatDateOffset_adjustedDate :: Maybe IdentifiedDate+ -- ^ The date once the adjustment has been performed. (Note that + -- this date may change if the business center holidays + -- change).+ }+ deriving (Eq,Show)+instance SchemaType RelativeDateOffset where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (RelativeDateOffset a0)+ `apply` parseSchemaType "periodMultiplier"+ `apply` parseSchemaType "period"+ `apply` optional (parseSchemaType "dayType")+ `apply` optional (parseSchemaType "businessDayConvention")+ `apply` optional (oneOf' [ ("BusinessCentersReference", fmap OneOf2 (parseSchemaType "businessCentersReference"))+ , ("BusinessCenters", fmap TwoOf2 (parseSchemaType "businessCenters"))+ ])+ `apply` optional (parseSchemaType "dateRelativeTo")+ `apply` optional (parseSchemaType "adjustedDate")+ schemaTypeToXML s x@RelativeDateOffset{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ relatDateOffset_ID x+ ]+ [ schemaTypeToXML "periodMultiplier" $ relatDateOffset_periodMultiplier x+ , schemaTypeToXML "period" $ relatDateOffset_period x+ , maybe [] (schemaTypeToXML "dayType") $ relatDateOffset_dayType x+ , maybe [] (schemaTypeToXML "businessDayConvention") $ relatDateOffset_businessDayConvention x+ , maybe [] (foldOneOf2 (schemaTypeToXML "businessCentersReference")+ (schemaTypeToXML "businessCenters")+ ) $ relatDateOffset_choice4 x+ , maybe [] (schemaTypeToXML "dateRelativeTo") $ relatDateOffset_dateRelativeTo x+ , maybe [] (schemaTypeToXML "adjustedDate") $ relatDateOffset_adjustedDate x+ ]+instance Extension RelativeDateOffset Offset where+ supertype (RelativeDateOffset a0 e0 e1 e2 e3 e4 e5 e6) =+ Offset a0 e0 e1 e2+instance Extension RelativeDateOffset Period where+ supertype = (supertype :: Offset -> Period)+ . (supertype :: RelativeDateOffset -> Offset)+ + +-- | A type describing a set of dates defined as relative to +-- another set of dates.+data RelativeDates = RelativeDates+ { relatDates_ID :: Maybe Xsd.ID+ , relatDates_periodMultiplier :: Xsd.Integer+ -- ^ A time period multiplier, e.g. 1, 2 or 3 etc. A negative + -- value can be used when specifying an offset relative to + -- another date, e.g. -2 days.+ , relatDates_period :: PeriodEnum+ -- ^ A time period, e.g. a day, week, month or year of the + -- stream. If the periodMultiplier value is 0 (zero) then + -- period must contain the value D (day).+ , relatDates_dayType :: Maybe DayTypeEnum+ -- ^ In the case of an offset specified as a number of days, + -- this element defines whether consideration is given as to + -- whether a day is a good business day or not. If a day type + -- of business days is specified then non-business days are + -- ignored when calculating the offset. The financial business + -- centers to use for determination of business days are + -- implied by the context in which this element is used. This + -- element must only be included when the offset is specified + -- as a number of days. If the offset is zero days then the + -- dayType element should not be included.+ , relatDates_businessDayConvention :: Maybe BusinessDayConventionEnum+ -- ^ The convention for adjusting a date if it would otherwise + -- fall on a day that is not a business day.+ , relatDates_choice4 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to a set of financial + -- business centers defined elsewhere in the document. + -- This set of business centers is used to determine + -- whether a particular day is a business day or not.+ -- + -- (2) businessCenters+ , relatDates_dateRelativeTo :: Maybe DateReference+ -- ^ Specifies the anchor as an href attribute. The href + -- attribute value is a pointer style reference to the element + -- or component elsewhere in the document where the anchor + -- date is defined.+ , relatDates_adjustedDate :: Maybe IdentifiedDate+ -- ^ The date once the adjustment has been performed. (Note that + -- this date may change if the business center holidays + -- change).+ , relatDates_periodSkip :: Maybe Xsd.PositiveInteger+ -- ^ The number of periods in the referenced date schedule that + -- are between each date in the relative date schedule. Thus a + -- skip of 2 would mean that dates are relative to every + -- second date in the referenced schedule. If present this + -- should have a value greater than 1.+ , relatDates_scheduleBounds :: Maybe DateRange+ -- ^ The first and last dates of a schedule. This can be used to + -- restrict the range of values in a reference series of + -- dates.+ }+ deriving (Eq,Show)+instance SchemaType RelativeDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (RelativeDates a0)+ `apply` parseSchemaType "periodMultiplier"+ `apply` parseSchemaType "period"+ `apply` optional (parseSchemaType "dayType")+ `apply` optional (parseSchemaType "businessDayConvention")+ `apply` optional (oneOf' [ ("BusinessCentersReference", fmap OneOf2 (parseSchemaType "businessCentersReference"))+ , ("BusinessCenters", fmap TwoOf2 (parseSchemaType "businessCenters"))+ ])+ `apply` optional (parseSchemaType "dateRelativeTo")+ `apply` optional (parseSchemaType "adjustedDate")+ `apply` optional (parseSchemaType "periodSkip")+ `apply` optional (parseSchemaType "scheduleBounds")+ schemaTypeToXML s x@RelativeDates{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ relatDates_ID x+ ]+ [ schemaTypeToXML "periodMultiplier" $ relatDates_periodMultiplier x+ , schemaTypeToXML "period" $ relatDates_period x+ , maybe [] (schemaTypeToXML "dayType") $ relatDates_dayType x+ , maybe [] (schemaTypeToXML "businessDayConvention") $ relatDates_businessDayConvention x+ , maybe [] (foldOneOf2 (schemaTypeToXML "businessCentersReference")+ (schemaTypeToXML "businessCenters")+ ) $ relatDates_choice4 x+ , maybe [] (schemaTypeToXML "dateRelativeTo") $ relatDates_dateRelativeTo x+ , maybe [] (schemaTypeToXML "adjustedDate") $ relatDates_adjustedDate x+ , maybe [] (schemaTypeToXML "periodSkip") $ relatDates_periodSkip x+ , maybe [] (schemaTypeToXML "scheduleBounds") $ relatDates_scheduleBounds x+ ]+instance Extension RelativeDates RelativeDateOffset where+ supertype (RelativeDates a0 e0 e1 e2 e3 e4 e5 e6 e7 e8) =+ RelativeDateOffset a0 e0 e1 e2 e3 e4 e5 e6+instance Extension RelativeDates Offset where+ supertype = (supertype :: RelativeDateOffset -> Offset)+ . (supertype :: RelativeDates -> RelativeDateOffset)+ +instance Extension RelativeDates Period where+ supertype = (supertype :: Offset -> Period)+ . (supertype :: RelativeDateOffset -> Offset)+ . (supertype :: RelativeDates -> RelativeDateOffset)+ + +-- | A type describing a date when this date is defined in +-- reference to another date through one or several date +-- offsets.+data RelativeDateSequence = RelativeDateSequence+ { relatDateSequen_dateRelativeTo :: Maybe DateReference+ -- ^ Specifies the anchor as an href attribute. The href + -- attribute value is a pointer style reference to the element + -- or component elsewhere in the document where the anchor + -- date is defined.+ , relatDateSequen_dateOffset :: [DateOffset]+ , relatDateSequen_choice2 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))+ -- ^ Choice between:+ -- + -- (1) A pointer style reference to a set of financial + -- business centers defined elsewhere in the document. + -- This set of business centers is used to determine + -- whether a particular day is a business day or not.+ -- + -- (2) businessCenters+ }+ deriving (Eq,Show)+instance SchemaType RelativeDateSequence where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return RelativeDateSequence+ `apply` optional (parseSchemaType "dateRelativeTo")+ `apply` many (parseSchemaType "dateOffset")+ `apply` optional (oneOf' [ ("BusinessCentersReference", fmap OneOf2 (parseSchemaType "businessCentersReference"))+ , ("BusinessCenters", fmap TwoOf2 (parseSchemaType "businessCenters"))+ ])+ schemaTypeToXML s x@RelativeDateSequence{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "dateRelativeTo") $ relatDateSequen_dateRelativeTo x+ , concatMap (schemaTypeToXML "dateOffset") $ relatDateSequen_dateOffset x+ , maybe [] (foldOneOf2 (schemaTypeToXML "businessCentersReference")+ (schemaTypeToXML "businessCenters")+ ) $ relatDateSequen_choice2 x+ ]+ +-- | A date with a required identifier which can be referenced +-- elsewhere.+data RequiredIdentifierDate = RequiredIdentifierDate Xsd.Date RequiredIdentifierDateAttributes deriving (Eq,Show)+data RequiredIdentifierDateAttributes = RequiredIdentifierDateAttributes+ { requirIdentDateAttrib_ID :: Xsd.ID+ }+ deriving (Eq,Show)+instance SchemaType RequiredIdentifierDate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- getAttribute "id" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ RequiredIdentifierDate v (RequiredIdentifierDateAttributes a0)+ schemaTypeToXML s (RequiredIdentifierDate bt at) =+ addXMLAttributes [ toXMLAttribute "id" $ requirIdentDateAttrib_ID at+ ]+ $ schemaTypeToXML s bt+instance Extension RequiredIdentifierDate Xsd.Date where+ supertype (RequiredIdentifierDate s _) = s+ +-- | A type defining the reset frequency. In the case of a +-- weekly reset, also specifies the day of the week that the +-- reset occurs. If the reset frequency is greater than the +-- calculation period frequency the this implies that more or +-- more reset dates is established for each calculation period +-- and some form of rate averaginhg is applicable. The +-- specific averaging method of calculation is specified in +-- FloatingRateCalculation. In case the reset frequency is of +-- value T (term), the period is defined by the +-- swap\swapStream\calculationPerioDates\effectiveDate and the +-- swap\swapStream\calculationPerioDates\terminationDate.+data ResetFrequency = ResetFrequency+ { resetFrequ_ID :: Maybe Xsd.ID+ , resetFrequ_periodMultiplier :: Maybe Xsd.PositiveInteger+ -- ^ A time period multiplier, e.g. 1, 2 or 3 etc. If the period + -- value is T (Term) then periodMultiplier must contain the + -- value 1.+ , resetFrequ_period :: Maybe PeriodExtendedEnum+ -- ^ A time period, e.g. a day, week, month, year or term of the + -- stream.+ , resetFrequ_weeklyRollConvention :: Maybe WeeklyRollConventionEnum+ -- ^ The day of the week on which a weekly reset date occurs. + -- This element must be included if the reset frequency is + -- defined as weekly and not otherwise.+ }+ deriving (Eq,Show)+instance SchemaType ResetFrequency where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ResetFrequency a0)+ `apply` optional (parseSchemaType "periodMultiplier")+ `apply` optional (parseSchemaType "period")+ `apply` optional (parseSchemaType "weeklyRollConvention")+ schemaTypeToXML s x@ResetFrequency{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ resetFrequ_ID x+ ]+ [ maybe [] (schemaTypeToXML "periodMultiplier") $ resetFrequ_periodMultiplier x+ , maybe [] (schemaTypeToXML "period") $ resetFrequ_period x+ , maybe [] (schemaTypeToXML "weeklyRollConvention") $ resetFrequ_weeklyRollConvention x+ ]+instance Extension ResetFrequency Frequency where+ supertype (ResetFrequency a0 e0 e1 e2) =+ Frequency a0 e0 e1+ +data RequestedAction = RequestedAction Scheme RequestedActionAttributes deriving (Eq,Show)+data RequestedActionAttributes = RequestedActionAttributes+ { requesActionAttrib_requestedActionScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType RequestedAction where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "requestedActionScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ RequestedAction v (RequestedActionAttributes a0)+ schemaTypeToXML s (RequestedAction bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "requestedActionScheme") $ requesActionAttrib_requestedActionScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension RequestedAction Scheme where+ supertype (RequestedAction s _) = s+ +-- | Describes the resource that contains the media +-- representation of a business event (i.e used for stating +-- the Publicly Available Information). For example, can +-- describe a file or a URL that represents the event. This +-- type is an extended version of a type defined by RIXML +-- (www.rixml.org).+data Resource = Resource+ { resource_id :: Maybe ResourceId+ -- ^ The unique identifier of the resource within the event.+ , resource_type :: Maybe ResourceType+ -- ^ A description of the type of the resource, e.g. a + -- confirmation.+ , resource_language :: Maybe Language+ -- ^ Indicates the language of the resource, described using the + -- ISO 639-2/T Code.+ , resource_sizeInBytes :: Maybe Xsd.Decimal+ -- ^ Indicates the size of the resource in bytes. It could be + -- used by the end user to estimate the download time and + -- storage needs.+ , resource_length :: Maybe ResourceLength+ -- ^ Indicates the length of the resource. For example, if the + -- resource were a PDF file, the length would be in pages.+ , resource_mimeType :: Maybe MimeType+ -- ^ Indicates the type of media used to store the content. + -- mimeType is used to determine the software product(s) that + -- can read the content. MIME Types are described in RFC 2046.+ , resource_name :: Maybe Xsd.NormalizedString+ -- ^ The name of the resource.+ , resource_comments :: Maybe Xsd.XsdString+ -- ^ Any additional comments that are deemed necessary. For + -- example, which software version is required to open the + -- document? Or, how does this resource relate to the others + -- for this event?+ , resource_choice8 :: (Maybe (OneOf4 Xsd.XsdString Xsd.HexBinary Xsd.Base64Binary Xsd.AnyURI))+ -- ^ Choice between:+ -- + -- (1) Provides extra information as string. In case the extra + -- information is in XML format, a CDATA section must be + -- placed around the source message to prevent its + -- interpretation as XML content.+ -- + -- (2) Provides extra information as binary contents coded in + -- hexadecimal.+ -- + -- (3) Provides extra information as binary contents coded in + -- base64.+ -- + -- (4) Indicates where the resource can be found, as a URL + -- that references the information on a web server + -- accessible to the message recipient.+ }+ deriving (Eq,Show)+instance SchemaType Resource where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Resource+ `apply` optional (parseSchemaType "resourceId")+ `apply` optional (parseSchemaType "resourceType")+ `apply` optional (parseSchemaType "language")+ `apply` optional (parseSchemaType "sizeInBytes")+ `apply` optional (parseSchemaType "length")+ `apply` optional (parseSchemaType "mimeType")+ `apply` optional (parseSchemaType "name")+ `apply` optional (parseSchemaType "comments")+ `apply` optional (oneOf' [ ("Xsd.XsdString", fmap OneOf4 (parseSchemaType "string"))+ , ("Xsd.HexBinary", fmap TwoOf4 (parseSchemaType "hexadecimalBinary"))+ , ("Xsd.Base64Binary", fmap ThreeOf4 (parseSchemaType "base64Binary"))+ , ("Xsd.AnyURI", fmap FourOf4 (parseSchemaType "url"))+ ])+ schemaTypeToXML s x@Resource{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "resourceId") $ resource_id x+ , maybe [] (schemaTypeToXML "resourceType") $ resource_type x+ , maybe [] (schemaTypeToXML "language") $ resource_language x+ , maybe [] (schemaTypeToXML "sizeInBytes") $ resource_sizeInBytes x+ , maybe [] (schemaTypeToXML "length") $ resource_length x+ , maybe [] (schemaTypeToXML "mimeType") $ resource_mimeType x+ , maybe [] (schemaTypeToXML "name") $ resource_name x+ , maybe [] (schemaTypeToXML "comments") $ resource_comments x+ , maybe [] (foldOneOf4 (schemaTypeToXML "string")+ (schemaTypeToXML "hexadecimalBinary")+ (schemaTypeToXML "base64Binary")+ (schemaTypeToXML "url")+ ) $ resource_choice8 x+ ]+ +-- | The data type used for resource identifiers.+data ResourceId = ResourceId Scheme ResourceIdAttributes deriving (Eq,Show)+data ResourceIdAttributes = ResourceIdAttributes+ { resourIdAttrib_resourceIdScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ResourceId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "resourceIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ResourceId v (ResourceIdAttributes a0)+ schemaTypeToXML s (ResourceId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "resourceIdScheme") $ resourIdAttrib_resourceIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ResourceId Scheme where+ supertype (ResourceId s _) = s+ +-- | The type that indicates the length of the resource.+data ResourceLength = ResourceLength+ { resourLength_lengthUnit :: Maybe LengthUnitEnum+ -- ^ The length unit of the resource. For example, pages (pdf, + -- text documents) or time (audio, video files).+ , resourLength_lengthValue :: Maybe Xsd.Decimal+ -- ^ The length value of the resource.+ }+ deriving (Eq,Show)+instance SchemaType ResourceLength where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ResourceLength+ `apply` optional (parseSchemaType "lengthUnit")+ `apply` optional (parseSchemaType "lengthValue")+ schemaTypeToXML s x@ResourceLength{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "lengthUnit") $ resourLength_lengthUnit x+ , maybe [] (schemaTypeToXML "lengthValue") $ resourLength_lengthValue x+ ]+ +-- | The data type used for describing the type or purpose of a +-- resource, e.g. "Confirmation".+data ResourceType = ResourceType Scheme ResourceTypeAttributes deriving (Eq,Show)+data ResourceTypeAttributes = ResourceTypeAttributes+ { resourTypeAttrib_resourceTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ResourceType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "resourceTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ResourceType v (ResourceTypeAttributes a0)+ schemaTypeToXML s (ResourceType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "resourceTypeScheme") $ resourTypeAttrib_resourceTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ResourceType Scheme where+ supertype (ResourceType s _) = s+ +-- | A reference to the return swap notional amount.+data ReturnSwapNotionalAmountReference = ReturnSwapNotionalAmountReference+ { returnSwapNotionAmountRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType ReturnSwapNotionalAmountReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (ReturnSwapNotionalAmountReference a0)+ schemaTypeToXML s x@ReturnSwapNotionalAmountReference{} =+ toXMLElement s [ toXMLAttribute "href" $ returnSwapNotionAmountRef_href x+ ]+ []+instance Extension ReturnSwapNotionalAmountReference Reference where+ supertype v = Reference_ReturnSwapNotionalAmountReference v+ +-- | A type defining a rounding direction and precision to be +-- used in the rounding of a rate.+data Rounding = Rounding+ { rounding_direction :: Maybe RoundingDirectionEnum+ -- ^ Specifies the rounding direction.+ , rounding_precision :: Maybe Xsd.NonNegativeInteger+ -- ^ Specifies the rounding precision in terms of a number of + -- decimal places. Note how a percentage rate rounding of 5 + -- decimal places is expressed as a rounding precision of 7 in + -- the FpML document since the percentage is expressed as a + -- decimal, e.g. 9.876543% (or 0.09876543) being rounded to + -- the nearest 5 decimal places is 9.87654% (or 0.0987654).+ }+ deriving (Eq,Show)+instance SchemaType Rounding where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Rounding+ `apply` optional (parseSchemaType "roundingDirection")+ `apply` optional (parseSchemaType "precision")+ schemaTypeToXML s x@Rounding{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "roundingDirection") $ rounding_direction x+ , maybe [] (schemaTypeToXML "precision") $ rounding_precision x+ ]+ +-- | A type that provides three alternative ways of identifying +-- a party involved in the routing of a payment. The +-- identification may use payment system identifiers only; +-- actual name, address and other reference information; or a +-- combination of both.+data Routing = Routing+ { routing_choice0 :: (Maybe (OneOf3 RoutingIds RoutingExplicitDetails RoutingIdsAndExplicitDetails))+ -- ^ Choice between:+ -- + -- (1) A set of unique identifiers for a party, eachone + -- identifying the party within a payment system. The + -- assumption is that each party will not have more than + -- one identifier within the same payment system.+ -- + -- (2) A set of details that is used to identify a party + -- involved in the routing of a payment when the party + -- does not have a code that identifies it within one of + -- the recognized payment systems.+ -- + -- (3) A combination of coded payment system identifiers and + -- details for physical addressing for a party involved in + -- the routing of a payment.+ }+ deriving (Eq,Show)+instance SchemaType Routing where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Routing+ `apply` optional (oneOf' [ ("RoutingIds", fmap OneOf3 (parseSchemaType "routingIds"))+ , ("RoutingExplicitDetails", fmap TwoOf3 (parseSchemaType "routingExplicitDetails"))+ , ("RoutingIdsAndExplicitDetails", fmap ThreeOf3 (parseSchemaType "routingIdsAndExplicitDetails"))+ ])+ schemaTypeToXML s x@Routing{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "routingIds")+ (schemaTypeToXML "routingExplicitDetails")+ (schemaTypeToXML "routingIdsAndExplicitDetails")+ ) $ routing_choice0 x+ ]+ +-- | A type that models name, address and supplementary textual +-- information for the purposes of identifying a party +-- involved in the routing of a payment.+data RoutingExplicitDetails = RoutingExplicitDetails+ { routingExplicDetails_routingName :: Maybe Xsd.XsdString+ -- ^ A real name that is used to identify a party involved in + -- the routing of a payment.+ , routingExplicDetails_routingAddress :: Maybe Address+ -- ^ A physical postal address via which a payment can be + -- routed.+ , routingExplicDetails_routingAccountNumber :: Maybe Xsd.XsdString+ -- ^ An account number via which a payment can be routed.+ , routingExplicDetails_routingReferenceText :: [Xsd.XsdString]+ -- ^ A piece of free-format text used to assist the + -- identification of a party involved in the routing of a + -- payment.+ }+ deriving (Eq,Show)+instance SchemaType RoutingExplicitDetails where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return RoutingExplicitDetails+ `apply` optional (parseSchemaType "routingName")+ `apply` optional (parseSchemaType "routingAddress")+ `apply` optional (parseSchemaType "routingAccountNumber")+ `apply` many (parseSchemaType "routingReferenceText")+ schemaTypeToXML s x@RoutingExplicitDetails{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "routingName") $ routingExplicDetails_routingName x+ , maybe [] (schemaTypeToXML "routingAddress") $ routingExplicDetails_routingAddress x+ , maybe [] (schemaTypeToXML "routingAccountNumber") $ routingExplicDetails_routingAccountNumber x+ , concatMap (schemaTypeToXML "routingReferenceText") $ routingExplicDetails_routingReferenceText x+ ]+ +data RoutingId = RoutingId Scheme RoutingIdAttributes deriving (Eq,Show)+data RoutingIdAttributes = RoutingIdAttributes+ { routingIdAttrib_routingIdCodeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType RoutingId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "routingIdCodeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ RoutingId v (RoutingIdAttributes a0)+ schemaTypeToXML s (RoutingId bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "routingIdCodeScheme") $ routingIdAttrib_routingIdCodeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension RoutingId Scheme where+ supertype (RoutingId s _) = s+ +-- | A type that provides for identifying a party involved in +-- the routing of a payment by means of one or more standard +-- identification codes. For example, both a SWIFT BIC code +-- and a national bank identifier may be required.+data RoutingIds = RoutingIds+ { routingIds_routingId :: [RoutingId]+ -- ^ A unique identifier for party that is a participant in a + -- recognized payment system.+ }+ deriving (Eq,Show)+instance SchemaType RoutingIds where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return RoutingIds+ `apply` many (parseSchemaType "routingId")+ schemaTypeToXML s x@RoutingIds{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "routingId") $ routingIds_routingId x+ ]+ +-- | A type that provides a combination of payment system +-- identification codes with physical postal address details, +-- for the purposes of identifying a party involved in the +-- routing of a payment.+data RoutingIdsAndExplicitDetails = RoutingIdsAndExplicitDetails+ { routingIdsAndExplicDetails_routingIds :: [RoutingIds]+ -- ^ A set of unique identifiers for a party, eachone + -- identifying the party within a payment system. The + -- assumption is that each party will not have more than one + -- identifier within the same payment system.+ , routingIdsAndExplicDetails_routingName :: Maybe Xsd.XsdString+ -- ^ A real name that is used to identify a party involved in + -- the routing of a payment.+ , routingIdsAndExplicDetails_routingAddress :: Maybe Address+ -- ^ A physical postal address via which a payment can be + -- routed.+ , routingIdsAndExplicDetails_routingAccountNumber :: Maybe Xsd.XsdString+ -- ^ An account number via which a payment can be routed.+ , routingIdsAndExplicDetails_routingReferenceText :: [Xsd.XsdString]+ -- ^ A piece of free-format text used to assist the + -- identification of a party involved in the routing of a + -- payment.+ }+ deriving (Eq,Show)+instance SchemaType RoutingIdsAndExplicitDetails where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return RoutingIdsAndExplicitDetails+ `apply` many (parseSchemaType "routingIds")+ `apply` optional (parseSchemaType "routingName")+ `apply` optional (parseSchemaType "routingAddress")+ `apply` optional (parseSchemaType "routingAccountNumber")+ `apply` many (parseSchemaType "routingReferenceText")+ schemaTypeToXML s x@RoutingIdsAndExplicitDetails{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "routingIds") $ routingIdsAndExplicDetails_routingIds x+ , maybe [] (schemaTypeToXML "routingName") $ routingIdsAndExplicDetails_routingName x+ , maybe [] (schemaTypeToXML "routingAddress") $ routingIdsAndExplicDetails_routingAddress x+ , maybe [] (schemaTypeToXML "routingAccountNumber") $ routingIdsAndExplicDetails_routingAccountNumber x+ , concatMap (schemaTypeToXML "routingReferenceText") $ routingIdsAndExplicDetails_routingReferenceText x+ ]+ +-- | A type defining a schedule of rates or amounts in terms of +-- an initial value and then a series of step date and value +-- pairs. On each step date the rate or amount changes to the +-- new step value. The series of step date and value pairs are +-- optional. If not specified, this implies that the initial +-- value remains unchanged over time.+data Schedule = Schedule+ { schedule_ID :: Maybe Xsd.ID+ , schedule_initialValue :: Xsd.Decimal+ -- ^ The initial rate or amount, as the case may be. An initial + -- rate of 5% would be represented as 0.05.+ , schedule_step :: [Step]+ -- ^ The schedule of step date and value pairs. On each step + -- date the associated step value becomes effective A list of + -- steps may be ordered in the document by ascending step + -- date. An FpML document containing an unordered list of + -- steps is still regarded as a conformant document.+ }+ deriving (Eq,Show)+instance SchemaType Schedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Schedule a0)+ `apply` parseSchemaType "initialValue"+ `apply` many (parseSchemaType "step")+ schemaTypeToXML s x@Schedule{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ schedule_ID x+ ]+ [ schemaTypeToXML "initialValue" $ schedule_initialValue x+ , concatMap (schemaTypeToXML "step") $ schedule_step x+ ]+ +-- | Reference to a schedule of rates or amounts.+data ScheduleReference = ScheduleReference+ { schedRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType ScheduleReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (ScheduleReference a0)+ schemaTypeToXML s x@ScheduleReference{} =+ toXMLElement s [ toXMLAttribute "href" $ schedRef_href x+ ]+ []+instance Extension ScheduleReference Reference where+ supertype v = Reference_ScheduleReference v+ +-- | A type that represents the choice of methods for settling a +-- potential currency payment resulting from a trade: by means +-- of a standard settlement instruction, by netting it out +-- with other payments, or with an explicit settlement +-- instruction.+data SettlementInformation = SettlementInformation+ { settlInfo_choice0 :: (Maybe (OneOf2 StandardSettlementStyleEnum SettlementInstruction))+ -- ^ Choice between:+ -- + -- (1) An optional element used to describe how a trade will + -- settle. This defines a scheme and is used for + -- identifying trades that are identified as settling + -- standard and/or flagged for settlement netting.+ -- + -- (2) An explicit specification of how a currency payment is + -- to be made, when the payment is not netted and the + -- route is other than the recipient's standard settlement + -- instruction.+ }+ deriving (Eq,Show)+instance SchemaType SettlementInformation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SettlementInformation+ `apply` optional (oneOf' [ ("StandardSettlementStyleEnum", fmap OneOf2 (parseSchemaType "standardSettlementStyle"))+ , ("SettlementInstruction", fmap TwoOf2 (parseSchemaType "settlementInstruction"))+ ])+ schemaTypeToXML s x@SettlementInformation{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "standardSettlementStyle")+ (schemaTypeToXML "settlementInstruction")+ ) $ settlInfo_choice0 x+ ]+ +-- | A type that models a complete instruction for settling a +-- currency payment, including the settlement method to be +-- used, the correspondent bank, any intermediary banks and +-- the ultimate beneficary.+data SettlementInstruction = SettlementInstruction+ { settlInstr_settlementMethod :: Maybe SettlementMethod+ -- ^ The mechanism by which settlement is to be made. The scheme + -- of domain values will include standard mechanisms such as + -- CLS, Fedwire, Chips ABA, Chips UID, SWIFT, CHAPS and DDA.+ , settlInstr_correspondentInformation :: Maybe CorrespondentInformation+ -- ^ The information required to identify the correspondent bank + -- that will make delivery of the funds on the paying bank's + -- behalf in the country where the payment is to be made+ , settlInstr_intermediaryInformation :: [IntermediaryInformation]+ -- ^ Information to identify an intermediary through which + -- payment will be made by the correspondent bank to the + -- ultimate beneficiary of the funds.+ , settlInstr_beneficiaryBank :: Maybe Beneficiary+ -- ^ The bank that acts for the ultimate beneficiary of the + -- funds in receiving payments.+ , settlInstr_beneficiary :: Maybe Beneficiary+ -- ^ The ultimate beneficiary of the funds. The beneficiary can + -- be identified either by an account at the beneficiaryBank + -- (qv) or by explicit routingInformation. This element + -- provides for the latter.+ , settlInstr_depositoryPartyReference :: Maybe PartyReference+ -- ^ Reference to the depository of the settlement.+ , settlInstr_splitSettlement :: [SplitSettlement]+ -- ^ The set of individual payments that are to be made when a + -- currency payment settling a trade needs to be split between + -- a number of ultimate beneficiaries. Each split payment may + -- need to have its own routing information.+ }+ deriving (Eq,Show)+instance SchemaType SettlementInstruction where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SettlementInstruction+ `apply` optional (parseSchemaType "settlementMethod")+ `apply` optional (parseSchemaType "correspondentInformation")+ `apply` many (parseSchemaType "intermediaryInformation")+ `apply` optional (parseSchemaType "beneficiaryBank")+ `apply` optional (parseSchemaType "beneficiary")+ `apply` optional (parseSchemaType "depositoryPartyReference")+ `apply` many (parseSchemaType "splitSettlement")+ schemaTypeToXML s x@SettlementInstruction{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "settlementMethod") $ settlInstr_settlementMethod x+ , maybe [] (schemaTypeToXML "correspondentInformation") $ settlInstr_correspondentInformation x+ , concatMap (schemaTypeToXML "intermediaryInformation") $ settlInstr_intermediaryInformation x+ , maybe [] (schemaTypeToXML "beneficiaryBank") $ settlInstr_beneficiaryBank x+ , maybe [] (schemaTypeToXML "beneficiary") $ settlInstr_beneficiary x+ , maybe [] (schemaTypeToXML "depositoryPartyReference") $ settlInstr_depositoryPartyReference x+ , concatMap (schemaTypeToXML "splitSettlement") $ settlInstr_splitSettlement x+ ]+ +data SettlementMethod = SettlementMethod Scheme SettlementMethodAttributes deriving (Eq,Show)+data SettlementMethodAttributes = SettlementMethodAttributes+ { settlMethodAttrib_settlementMethodScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType SettlementMethod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "settlementMethodScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ SettlementMethod v (SettlementMethodAttributes a0)+ schemaTypeToXML s (SettlementMethod bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "settlementMethodScheme") $ settlMethodAttrib_settlementMethodScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension SettlementMethod Scheme where+ supertype (SettlementMethod s _) = s+ +-- | Coding scheme that specifies the settlement price default +-- election.+data SettlementPriceDefaultElection = SettlementPriceDefaultElection Scheme SettlementPriceDefaultElectionAttributes deriving (Eq,Show)+data SettlementPriceDefaultElectionAttributes = SettlementPriceDefaultElectionAttributes+ { spdea_settlementPriceDefaultElectionScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType SettlementPriceDefaultElection where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "settlementPriceDefaultElectionScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ SettlementPriceDefaultElection v (SettlementPriceDefaultElectionAttributes a0)+ schemaTypeToXML s (SettlementPriceDefaultElection bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "settlementPriceDefaultElectionScheme") $ spdea_settlementPriceDefaultElectionScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension SettlementPriceDefaultElection Scheme where+ supertype (SettlementPriceDefaultElection s _) = s+ +-- | The source from which the settlement price is to be +-- obtained, e.g. a Reuters page, Prezzo di Riferimento, etc.+data SettlementPriceSource = SettlementPriceSource Scheme SettlementPriceSourceAttributes deriving (Eq,Show)+data SettlementPriceSourceAttributes = SettlementPriceSourceAttributes+ { settlPriceSourceAttrib_settlementPriceSourceScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType SettlementPriceSource where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "settlementPriceSourceScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ SettlementPriceSource v (SettlementPriceSourceAttributes a0)+ schemaTypeToXML s (SettlementPriceSource bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "settlementPriceSourceScheme") $ settlPriceSourceAttrib_settlementPriceSourceScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension SettlementPriceSource Scheme where+ supertype (SettlementPriceSource s _) = s+ +-- | A type describing the method for obtaining a settlement +-- rate.+data SettlementRateSource = SettlementRateSource+ { settlRateSource_choice0 :: (Maybe (OneOf2 InformationSource CashSettlementReferenceBanks))+ -- ^ Choice between:+ -- + -- (1) The information source where a published or displayed + -- market rate will be obtained, e.g. Telerate Page 3750.+ -- + -- (2) A container for a set of reference institutions. These + -- reference institutions may be called upon to provide + -- rate quotations as part of the method to determine the + -- applicable cash settlement amount. If institutions are + -- not specified, it is assumed that reference + -- institutions will be agreed between the parties on the + -- exercise date, or in the case of swap transaction to + -- which mandatory early termination is applicable, the + -- cash settlement valuation date.+ }+ deriving (Eq,Show)+instance SchemaType SettlementRateSource where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SettlementRateSource+ `apply` optional (oneOf' [ ("InformationSource", fmap OneOf2 (parseSchemaType "informationSource"))+ , ("CashSettlementReferenceBanks", fmap TwoOf2 (parseSchemaType "cashSettlementReferenceBanks"))+ ])+ schemaTypeToXML s x@SettlementRateSource{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "informationSource")+ (schemaTypeToXML "cashSettlementReferenceBanks")+ ) $ settlRateSource_choice0 x+ ]+ +-- | TBA+data SharedAmericanExercise = SharedAmericanExercise+ { sharedAmericExerc_ID :: Maybe Xsd.ID+ , sharedAmericExerc_commencementDate :: Maybe AdjustableOrRelativeDate+ -- ^ The first day of the exercise period for an American style + -- option.+ , sharedAmericExerc_expirationDate :: Maybe AdjustableOrRelativeDate+ -- ^ The last day within an exercise period for an American + -- style option. For a European style option it is the only + -- day within the exercise period.+ , sharedAmericExerc_choice2 :: (Maybe (OneOf2 BusinessCenterTime DeterminationMethod))+ -- ^ Choice between latest exercise time expressed as literal + -- time, or using a determination method.+ -- + -- Choice between:+ -- + -- (1) For a Bermuda or American style option, the latest time + -- on an exercise business day (excluding the expiration + -- date) within the exercise period that notice can be + -- given by the buyer to the seller or seller's agent. + -- Notice of exercise given after this time will be deemed + -- to have been given on the next exercise business day.+ -- + -- (2) Latest exercise time determination method.+ }+ deriving (Eq,Show)+instance SchemaType SharedAmericanExercise where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (SharedAmericanExercise a0)+ `apply` optional (parseSchemaType "commencementDate")+ `apply` optional (parseSchemaType "expirationDate")+ `apply` optional (oneOf' [ ("BusinessCenterTime", fmap OneOf2 (parseSchemaType "latestExerciseTime"))+ , ("DeterminationMethod", fmap TwoOf2 (parseSchemaType "latestExerciseTimeDetermination"))+ ])+ schemaTypeToXML s x@SharedAmericanExercise{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ sharedAmericExerc_ID x+ ]+ [ maybe [] (schemaTypeToXML "commencementDate") $ sharedAmericExerc_commencementDate x+ , maybe [] (schemaTypeToXML "expirationDate") $ sharedAmericExerc_expirationDate x+ , maybe [] (foldOneOf2 (schemaTypeToXML "latestExerciseTime")+ (schemaTypeToXML "latestExerciseTimeDetermination")+ ) $ sharedAmericExerc_choice2 x+ ]+instance Extension SharedAmericanExercise Exercise where+ supertype v = Exercise_SharedAmericanExercise v+ +-- | A complex type to specified payments in a simpler fashion +-- than the Payment type. This construct should be used from +-- the version 4.3 onwards.+data SimplePayment = SimplePayment+ { simplePayment_ID :: Maybe Xsd.ID+ , simplePayment_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , simplePayment_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , simplePayment_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , simplePayment_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , simplePayment_paymentAmount :: Maybe NonNegativeMoney+ , simplePayment_paymentDate :: Maybe AdjustableOrRelativeDate+ -- ^ The payment date. This date is subject to adjustment in + -- accordance with any applicable business day convention.+ }+ deriving (Eq,Show)+instance SchemaType SimplePayment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (SimplePayment a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "paymentAmount")+ `apply` optional (parseSchemaType "paymentDate")+ schemaTypeToXML s x@SimplePayment{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ simplePayment_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ simplePayment_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ simplePayment_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ simplePayment_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ simplePayment_receiverAccountReference x+ , maybe [] (schemaTypeToXML "paymentAmount") $ simplePayment_paymentAmount x+ , maybe [] (schemaTypeToXML "paymentDate") $ simplePayment_paymentDate x+ ]+instance Extension SimplePayment PaymentBase where+ supertype v = PaymentBase_SimplePayment v+ +-- | A type that supports the division of a gross settlement +-- amount into a number of split settlements, each requiring +-- its own settlement instruction.+data SplitSettlement = SplitSettlement+ { splitSettlement_amount :: Maybe Money+ -- ^ One of the monetary amounts in a split settlement payment.+ , splitSettl_beneficiaryBank :: Maybe Routing+ -- ^ The bank that acts for the ultimate beneficiary of the + -- funds in receiving payments.+ , splitSettl_beneficiary :: Maybe Routing+ -- ^ The ultimate beneficiary of the funds. The beneficiary can + -- be identified either by an account at the beneficiaryBank + -- (qv) or by explicit routingInformation. This element + -- provides for the latter.+ }+ deriving (Eq,Show)+instance SchemaType SplitSettlement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SplitSettlement+ `apply` optional (parseSchemaType "splitSettlementAmount")+ `apply` optional (parseSchemaType "beneficiaryBank")+ `apply` optional (parseSchemaType "beneficiary")+ schemaTypeToXML s x@SplitSettlement{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "splitSettlementAmount") $ splitSettlement_amount x+ , maybe [] (schemaTypeToXML "beneficiaryBank") $ splitSettl_beneficiaryBank x+ , maybe [] (schemaTypeToXML "beneficiary") $ splitSettl_beneficiary x+ ]+ +-- | Adds an optional spread type element to the Schedule to +-- identify a long or short spread value.+data SpreadSchedule = SpreadSchedule+ { spreadSched_ID :: Maybe Xsd.ID+ , spreadSched_initialValue :: Xsd.Decimal+ -- ^ The initial rate or amount, as the case may be. An initial + -- rate of 5% would be represented as 0.05.+ , spreadSched_step :: [Step]+ -- ^ The schedule of step date and value pairs. On each step + -- date the associated step value becomes effective A list of + -- steps may be ordered in the document by ascending step + -- date. An FpML document containing an unordered list of + -- steps is still regarded as a conformant document.+ , spreadSched_type :: Maybe SpreadScheduleType+ }+ deriving (Eq,Show)+instance SchemaType SpreadSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (SpreadSchedule a0)+ `apply` parseSchemaType "initialValue"+ `apply` many (parseSchemaType "step")+ `apply` optional (parseSchemaType "type")+ schemaTypeToXML s x@SpreadSchedule{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ spreadSched_ID x+ ]+ [ schemaTypeToXML "initialValue" $ spreadSched_initialValue x+ , concatMap (schemaTypeToXML "step") $ spreadSched_step x+ , maybe [] (schemaTypeToXML "type") $ spreadSched_type x+ ]+instance Extension SpreadSchedule Schedule where+ supertype (SpreadSchedule a0 e0 e1 e2) =+ Schedule a0 e0 e1+ +-- | Provides a reference to a spread schedule.+data SpreadScheduleReference = SpreadScheduleReference+ { spreadSchedRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType SpreadScheduleReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (SpreadScheduleReference a0)+ schemaTypeToXML s x@SpreadScheduleReference{} =+ toXMLElement s [ toXMLAttribute "href" $ spreadSchedRef_href x+ ]+ []+instance Extension SpreadScheduleReference Reference where+ supertype v = Reference_SpreadScheduleReference v+ +-- | Defines a Spread Type Scheme to identify a long or short +-- spread value.+data SpreadScheduleType = SpreadScheduleType Scheme SpreadScheduleTypeAttributes deriving (Eq,Show)+data SpreadScheduleTypeAttributes = SpreadScheduleTypeAttributes+ { spreadSchedTypeAttrib_spreadScheduleTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType SpreadScheduleType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "spreadScheduleTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ SpreadScheduleType v (SpreadScheduleTypeAttributes a0)+ schemaTypeToXML s (SpreadScheduleType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "spreadScheduleTypeScheme") $ spreadSchedTypeAttrib_spreadScheduleTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension SpreadScheduleType Scheme where+ supertype (SpreadScheduleType s _) = s+ +-- | A type defining a step date and step value pair. This step +-- definitions are used to define varying rate or amount +-- schedules, e.g. a notional amortization or a step-up coupon +-- schedule.+data Step = Step+ { step_ID :: Maybe Xsd.ID+ , step_date :: Maybe Xsd.Date+ -- ^ The date on which the associated stepValue becomes + -- effective. This day may be subject to adjustment in + -- accordance with a business day convention.+ , step_value :: Maybe Xsd.Decimal+ -- ^ The rate or amount which becomes effective on the + -- associated stepDate. A rate of 5% would be represented as + -- 0.05.+ }+ deriving (Eq,Show)+instance SchemaType Step where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Step a0)+ `apply` optional (parseSchemaType "stepDate")+ `apply` optional (parseSchemaType "stepValue")+ schemaTypeToXML s x@Step{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ step_ID x+ ]+ [ maybe [] (schemaTypeToXML "stepDate") $ step_date x+ , maybe [] (schemaTypeToXML "stepValue") $ step_value x+ ]+instance Extension Step StepBase where+ supertype v = StepBase_Step v+ +-- | A type defining a step date and step value pair. This step +-- definitions are used to define varying rate or amount +-- schedules, e.g. a notional amortization or a step-up coupon +-- schedule.+data StepBase+ = StepBase_Step Step+ | StepBase_PositiveStep PositiveStep+ | StepBase_NonNegativeStep NonNegativeStep+ + deriving (Eq,Show)+instance SchemaType StepBase where+ parseSchemaType s = do+ (fmap StepBase_Step $ parseSchemaType s)+ `onFail`+ (fmap StepBase_PositiveStep $ parseSchemaType s)+ `onFail`+ (fmap StepBase_NonNegativeStep $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of StepBase,\n\+\ namely one of:\n\+\Step,PositiveStep,NonNegativeStep"+ schemaTypeToXML _s (StepBase_Step x) = schemaTypeToXML "step" x+ schemaTypeToXML _s (StepBase_PositiveStep x) = schemaTypeToXML "positiveStep" x+ schemaTypeToXML _s (StepBase_NonNegativeStep x) = schemaTypeToXML "nonNegativeStep" x+ +-- | A type that describes the set of street and building number +-- information that identifies a postal address within a city.+data StreetAddress = StreetAddress+ { streetAddress_streetLine :: [Xsd.XsdString]+ -- ^ An individual line of street and building number + -- information, forming part of a postal address.+ }+ deriving (Eq,Show)+instance SchemaType StreetAddress where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return StreetAddress+ `apply` many (parseSchemaType "streetLine")+ schemaTypeToXML s x@StreetAddress{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "streetLine") $ streetAddress_streetLine x+ ]+ +-- | A type describing a single cap or floor rate.+data Strike = Strike+ { strike_ID :: Maybe Xsd.ID+ , strike_rate :: Maybe Xsd.Decimal+ -- ^ The rate for a cap or floor.+ , strike_buyer :: Maybe IdentifiedPayerReceiver+ -- ^ The buyer of the option+ , strike_seller :: Maybe IdentifiedPayerReceiver+ -- ^ The party that has sold.+ }+ deriving (Eq,Show)+instance SchemaType Strike where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Strike a0)+ `apply` optional (parseSchemaType "strikeRate")+ `apply` optional (parseSchemaType "buyer")+ `apply` optional (parseSchemaType "seller")+ schemaTypeToXML s x@Strike{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ strike_ID x+ ]+ [ maybe [] (schemaTypeToXML "strikeRate") $ strike_rate x+ , maybe [] (schemaTypeToXML "buyer") $ strike_buyer x+ , maybe [] (schemaTypeToXML "seller") $ strike_seller x+ ]+ +-- | A type describing a schedule of cap or floor rates.+data StrikeSchedule = StrikeSchedule+ { strikeSched_ID :: Maybe Xsd.ID+ , strikeSched_initialValue :: Xsd.Decimal+ -- ^ The initial rate or amount, as the case may be. An initial + -- rate of 5% would be represented as 0.05.+ , strikeSched_step :: [Step]+ -- ^ The schedule of step date and value pairs. On each step + -- date the associated step value becomes effective A list of + -- steps may be ordered in the document by ascending step + -- date. An FpML document containing an unordered list of + -- steps is still regarded as a conformant document.+ , strikeSched_buyer :: Maybe IdentifiedPayerReceiver+ -- ^ The buyer of the option+ , strikeSched_seller :: Maybe IdentifiedPayerReceiver+ -- ^ The party that has sold.+ }+ deriving (Eq,Show)+instance SchemaType StrikeSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (StrikeSchedule a0)+ `apply` parseSchemaType "initialValue"+ `apply` many (parseSchemaType "step")+ `apply` optional (parseSchemaType "buyer")+ `apply` optional (parseSchemaType "seller")+ schemaTypeToXML s x@StrikeSchedule{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ strikeSched_ID x+ ]+ [ schemaTypeToXML "initialValue" $ strikeSched_initialValue x+ , concatMap (schemaTypeToXML "step") $ strikeSched_step x+ , maybe [] (schemaTypeToXML "buyer") $ strikeSched_buyer x+ , maybe [] (schemaTypeToXML "seller") $ strikeSched_seller x+ ]+instance Extension StrikeSchedule Schedule where+ supertype (StrikeSchedule a0 e0 e1 e2 e3) =+ Schedule a0 e0 e1+ +-- | A type defining how a stub calculation period amount is +-- calculated and the start and end date of the stub. A single +-- floating rate tenor different to that used for the regular +-- part of the calculation periods schedule may be specified, +-- or two floating rate tenors many be specified. If two +-- floating rate tenors are specified then Linear +-- Interpolation (in accordance with the 2000 ISDA +-- Definitions, Section 8.3 Interpolation) is assumed to +-- apply. Alternatively, an actual known stub rate or stub +-- amount may be specified.+data Stub = Stub+ { stub_choice0 :: (Maybe (OneOf3 [FloatingRate] Xsd.Decimal Money))+ -- ^ Choice between:+ -- + -- (1) The rates to be applied to the initial or final stub + -- may be the linear interpolation of two different rates. + -- While the majority of the time, the rate indices will + -- be the same as that specified in the stream and only + -- the tenor itself will be different, it is possible to + -- specift two different rates. For example, a 2 month + -- stub period may use the linear interpolation of a 1 + -- month and 3 month rate. The different rates would be + -- specified in this component. Note that a maximum of two + -- rates can be specified. If a stub period uses the same + -- floating rate index, including tenor, as the regular + -- calculation periods then this should not be specified + -- again within this component, i.e. the stub calculation + -- period amount component may not need to be specified + -- even if there is an initial or final stub period. If a + -- stub period uses a different floating rate index + -- compared to the regular calculation periods then this + -- should be specified within this component. If specified + -- here, they are likely to have id attributes, allowing + -- them to be referenced from within the cashflows + -- component.+ -- + -- (2) An actual rate to apply for the initial or final stub + -- period may have been agreed between the principal + -- parties (in a similar way to how an initial rate may + -- have been agreed for the first regular period). If an + -- actual stub rate has been agreed then it would be + -- included in this component. It will be a per annum + -- rate, expressed as a decimal. A stub rate of 5% would + -- be represented as 0.05.+ -- + -- (3) An actual amount to apply for the initial or final stub + -- period may have been agreed between th two parties. If + -- an actual stub amount has been agreed then it would be + -- included in this component.+ , stub_startDate :: Maybe AdjustableOrRelativeDate+ -- ^ Start date of stub period. This was created to support use + -- of the InterestRateStream within the Equity Derivative + -- sphere, and this element is not expected to be produced in + -- the representation of Interest Rate products.+ , stub_endDate :: Maybe AdjustableOrRelativeDate+ -- ^ End date of stub period. This was created to support use of + -- the InterestRateStream within the Equity Derivative sphere, + -- and this element is not expected to be produced in the + -- representation of Interest Rate products.+ }+ deriving (Eq,Show)+instance SchemaType Stub where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Stub+ `apply` optional (oneOf' [ ("[FloatingRate]", fmap OneOf3 (between (Occurs (Just 1) (Just 2))+ (parseSchemaType "floatingRate")))+ , ("Xsd.Decimal", fmap TwoOf3 (parseSchemaType "stubRate"))+ , ("Money", fmap ThreeOf3 (parseSchemaType "stubAmount"))+ ])+ `apply` optional (parseSchemaType "stubStartDate")+ `apply` optional (parseSchemaType "stubEndDate")+ schemaTypeToXML s x@Stub{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (concatMap (schemaTypeToXML "floatingRate"))+ (schemaTypeToXML "stubRate")+ (schemaTypeToXML "stubAmount")+ ) $ stub_choice0 x+ , maybe [] (schemaTypeToXML "stubStartDate") $ stub_startDate x+ , maybe [] (schemaTypeToXML "stubEndDate") $ stub_endDate x+ ]+instance Extension Stub StubValue where+ supertype (Stub e0 e1 e2) =+ StubValue e0+ +-- | A type defining how a stub calculation period amount is +-- calculated. A single floating rate tenor different to that +-- used for the regular part of the calculation periods +-- schedule may be specified, or two floating rate tenors many +-- be specified. If two floating rate tenors are specified +-- then Linear Interpolation (in accordance with the 2000 ISDA +-- Definitions, Section 8.3 Interpolation) is assumed to +-- apply. Alternatively, an actual known stub rate or stub +-- amount may be specified.+data StubValue = StubValue+ { stubValue_choice0 :: (Maybe (OneOf3 [FloatingRate] Xsd.Decimal Money))+ -- ^ Choice between:+ -- + -- (1) The rates to be applied to the initial or final stub + -- may be the linear interpolation of two different rates. + -- While the majority of the time, the rate indices will + -- be the same as that specified in the stream and only + -- the tenor itself will be different, it is possible to + -- specift two different rates. For example, a 2 month + -- stub period may use the linear interpolation of a 1 + -- month and 3 month rate. The different rates would be + -- specified in this component. Note that a maximum of two + -- rates can be specified. If a stub period uses the same + -- floating rate index, including tenor, as the regular + -- calculation periods then this should not be specified + -- again within this component, i.e. the stub calculation + -- period amount component may not need to be specified + -- even if there is an initial or final stub period. If a + -- stub period uses a different floating rate index + -- compared to the regular calculation periods then this + -- should be specified within this component. If specified + -- here, they are likely to have id attributes, allowing + -- them to be referenced from within the cashflows + -- component.+ -- + -- (2) An actual rate to apply for the initial or final stub + -- period may have been agreed between the principal + -- parties (in a similar way to how an initial rate may + -- have been agreed for the first regular period). If an + -- actual stub rate has been agreed then it would be + -- included in this component. It will be a per annum + -- rate, expressed as a decimal. A stub rate of 5% would + -- be represented as 0.05.+ -- + -- (3) An actual amount to apply for the initial or final stub + -- period may have been agreed between th two parties. If + -- an actual stub amount has been agreed then it would be + -- included in this component.+ }+ deriving (Eq,Show)+instance SchemaType StubValue where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return StubValue+ `apply` optional (oneOf' [ ("[FloatingRate]", fmap OneOf3 (between (Occurs (Just 1) (Just 2))+ (parseSchemaType "floatingRate")))+ , ("Xsd.Decimal", fmap TwoOf3 (parseSchemaType "stubRate"))+ , ("Money", fmap ThreeOf3 (parseSchemaType "stubAmount"))+ ])+ schemaTypeToXML s x@StubValue{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (concatMap (schemaTypeToXML "floatingRate"))+ (schemaTypeToXML "stubRate")+ (schemaTypeToXML "stubAmount")+ ) $ stubValue_choice0 x+ ]+ +-- | A geophraphic location for the purposes of defining a +-- prevailing time according to the tz database.+data TimezoneLocation = TimezoneLocation Scheme TimezoneLocationAttributes deriving (Eq,Show)+data TimezoneLocationAttributes = TimezoneLocationAttributes+ { timezLocatAttrib_timezoneLocationScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType TimezoneLocation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "timezoneLocationScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ TimezoneLocation v (TimezoneLocationAttributes a0)+ schemaTypeToXML s (TimezoneLocation bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "timezoneLocationScheme") $ timezLocatAttrib_timezoneLocationScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension TimezoneLocation Scheme where+ supertype (TimezoneLocation s _) = s+ +-- | The parameters for defining the exercise period for an +-- American style option together with any rules governing the +-- notional amount of the underlying which can be exercised on +-- any given exercise date and any associated exercise fees.+elementAmericanExercise :: XMLParser AmericanExercise+elementAmericanExercise = parseSchemaType "americanExercise"+elementToXMLAmericanExercise :: AmericanExercise -> [Content ()]+elementToXMLAmericanExercise = schemaTypeToXML "americanExercise"+ +-- | The parameters for defining the exercise period for a +-- Bermuda style option together with any rules governing the +-- notional amount of the underlying which can be exercised on +-- any given exercise date and any associated exercise fees.+elementBermudaExercise :: XMLParser BermudaExercise+elementBermudaExercise = parseSchemaType "bermudaExercise"+elementToXMLBermudaExercise :: BermudaExercise -> [Content ()]+elementToXMLBermudaExercise = schemaTypeToXML "bermudaExercise"+ +-- | The parameters for defining the exercise period for a +-- European style option together with any rules governing the +-- notional amount of the underlying which can be exercised on +-- any given exercise date and any associated exercise fees.+elementEuropeanExercise :: XMLParser EuropeanExercise+elementEuropeanExercise = parseSchemaType "europeanExercise"+elementToXMLEuropeanExercise :: EuropeanExercise -> [Content ()]+elementToXMLEuropeanExercise = schemaTypeToXML "europeanExercise"+ +-- | An placeholder for the actual option exercise definitions.+elementExercise :: XMLParser Exercise+elementExercise = fmap supertype elementEuropeanExercise+ `onFail`+ fmap supertype elementBermudaExercise+ `onFail`+ fmap supertype elementAmericanExercise+ `onFail` fail "Parse failed when expecting an element in the substitution group for\n\+\ <exercise>,\n\+\ namely one of:\n\+\<europeanExercise>, <bermudaExercise>, <americanExercise>"+elementToXMLExercise :: Exercise -> [Content ()]+elementToXMLExercise = schemaTypeToXML "exercise"+ +-- | An abstract element used as a place holder for the +-- substituting product elements.+elementProduct :: XMLParser Product+elementProduct = fmap supertype elementStandardProduct -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementSwaption -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementSwap -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementFra -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementCapFloor -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementBulletPayment -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementNonSchemaProduct -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementGenericProduct -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementTermDeposit -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementFxDigitalOption -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementFxOption -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementFxSwap -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementFxSingleLeg -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementReturnSwap -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementStrategy -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementInstrumentTradeDetails -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementDividendSwapTransactionSupplement -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementCorrelationSwap -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementCommoditySwaption -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementCommoditySwap -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementCommodityOption -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementCommodityForward -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementCreditDefaultSwapOption -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementCreditDefaultSwap -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementBondOption -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementEquitySwapTransactionSupplement -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementEquityOptionTransactionSupplement -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementEquityOption -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementEquityForward -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementBrokerEquityOption -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementVarianceSwapTransactionSupplement -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementVarianceSwap -- FIXME: element is forward-declared+ `onFail`+ fmap supertype elementVarianceOptionTransactionSupplement -- FIXME: element is forward-declared+ `onFail` fail "Parse failed when expecting an element in the substitution group for\n\+\ <product>,\n\+\ namely one of:\n\+\<standardProduct>, <swaption>, <swap>, <fra>, <capFloor>, <bulletPayment>, <nonSchemaProduct>, <genericProduct>, <termDeposit>, <fxDigitalOption>, <fxOption>, <fxSwap>, <fxSingleLeg>, <returnSwap>, <strategy>, <instrumentTradeDetails>, <dividendSwapTransactionSupplement>, <correlationSwap>, <commoditySwaption>, <commoditySwap>, <commodityOption>, <commodityForward>, <creditDefaultSwapOption>, <creditDefaultSwap>, <bondOption>, <equitySwapTransactionSupplement>, <equityOptionTransactionSupplement>, <equityOption>, <equityForward>, <brokerEquityOption>, <varianceSwapTransactionSupplement>, <varianceSwap>, <varianceOptionTransactionSupplement>"+elementToXMLProduct :: Product -> [Content ()]+elementToXMLProduct = schemaTypeToXML "product"+ + + + + + + + + + +-- | A code that describes what type of role an organization +-- plays, for example a SwapsDealer, a Major Swaps +-- Participant, or Other+data OrganizationType = OrganizationType Xsd.Token OrganizationTypeAttributes deriving (Eq,Show)+data OrganizationTypeAttributes = OrganizationTypeAttributes+ { organTypeAttrib_organizationTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType OrganizationType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "organizationTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ OrganizationType v (OrganizationTypeAttributes a0)+ schemaTypeToXML s (OrganizationType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "organizationTypeScheme") $ organTypeAttrib_organizationTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension OrganizationType Xsd.Token where+ supertype (OrganizationType s _) = s+ + + + + + + + +
@@ -0,0 +1,2163 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Shared+ ( module Data.FpML.V53.Shared+ , module Data.FpML.V53.Enum+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Enum+ +-- | A type defining a number specified as a decimal between -1 +-- and 1 inclusive. +newtype CorrelationValue = CorrelationValue Xsd.Decimal+instance Eq CorrelationValue+instance Show CorrelationValue+instance Restricts CorrelationValue Xsd.Decimal+instance SchemaType CorrelationValue+instance SimpleType CorrelationValue+ +-- | A type defining a time specified in hh:mm:ss format where +-- the second component must be '00', e.g. 11am would be +-- represented as 11:00:00. +newtype HourMinuteTime = HourMinuteTime Xsd.Time+instance Eq HourMinuteTime+instance Show HourMinuteTime+instance Restricts HourMinuteTime Xsd.Time+instance SchemaType HourMinuteTime+instance SimpleType HourMinuteTime+ +-- | A type defining a number specified as non negative decimal +-- greater than 0 inclusive. +newtype NonNegativeDecimal = NonNegativeDecimal Xsd.Decimal+instance Eq NonNegativeDecimal+instance Show NonNegativeDecimal+instance Restricts NonNegativeDecimal Xsd.Decimal+instance SchemaType NonNegativeDecimal+instance SimpleType NonNegativeDecimal+ +-- | A type defining a number specified as positive decimal +-- greater than 0 exclusive. +newtype PositiveDecimal = PositiveDecimal Xsd.Decimal+instance Eq PositiveDecimal+instance Show PositiveDecimal+instance Restricts PositiveDecimal Xsd.Decimal+instance SchemaType PositiveDecimal+instance SimpleType PositiveDecimal+ +-- | A type defining a percentage specified as decimal from 0 to +-- 1. A percentage of 5% would be represented as 0.05. +newtype RestrictedPercentage = RestrictedPercentage Xsd.Decimal+instance Eq RestrictedPercentage+instance Show RestrictedPercentage+instance Restricts RestrictedPercentage Xsd.Decimal+instance SchemaType RestrictedPercentage+instance SimpleType RestrictedPercentage+ +-- | The base class for all types which define coding schemes. +newtype Scheme = Scheme Xsd.NormalizedString+instance Eq Scheme+instance Show Scheme+instance Restricts Scheme Xsd.NormalizedString+instance SchemaType Scheme+instance SimpleType Scheme+ +-- | A type defining a token of length between 1 and 60 +-- characters inclusive. +newtype Token60 = Token60 Xsd.Token+instance Eq Token60+instance Show Token60+instance Restricts Token60 Xsd.Token+instance SchemaType Token60+instance SimpleType Token60+ +-- | A generic account that represents any party's account at +-- another party. Parties may be identified by the account at +-- another party. +data Account+instance Eq Account+instance Show Account+instance SchemaType Account+ +-- | The data type used for account identifiers. +data AccountId+data AccountIdAttributes+instance Eq AccountId+instance Eq AccountIdAttributes+instance Show AccountId+instance Show AccountIdAttributes+instance SchemaType AccountId+instance Extension AccountId Scheme+ +-- | The data type used for the name of the account. +data AccountName+data AccountNameAttributes+instance Eq AccountName+instance Eq AccountNameAttributes+instance Show AccountName+instance Show AccountNameAttributes+instance SchemaType AccountName+instance Extension AccountName Scheme+ +-- | Reference to an account. +data AccountReference+instance Eq AccountReference+instance Show AccountReference+instance SchemaType AccountReference+instance Extension AccountReference Reference+ +-- | A type that represents a physical postal address. +data Address+instance Eq Address+instance Show Address+instance SchemaType Address+ +-- | A type that represents information about a unit within an +-- organization. +data BusinessUnit+instance Eq BusinessUnit+instance Show BusinessUnit+instance SchemaType BusinessUnit+ +-- | A type that represents information about a person connected +-- with a trade or business process. +data Person+instance Eq Person+instance Show Person+instance SchemaType Person+ +newtype Initial = Initial Xsd.NormalizedString+instance Eq Initial+instance Show Initial+instance Restricts Initial Xsd.NormalizedString+instance SchemaType Initial+instance SimpleType Initial+ +-- | An identifier used to identify an individual person. +data PersonId+data PersonIdAttributes+instance Eq PersonId+instance Eq PersonIdAttributes+instance Show PersonId+instance Show PersonIdAttributes+instance SchemaType PersonId+instance Extension PersonId Scheme+ +-- | A type used to record information about a unit, +-- subdivision, desk, or other similar business entity. +data Unit+data UnitAttributes+instance Eq Unit+instance Eq UnitAttributes+instance Show Unit+instance Show UnitAttributes+instance SchemaType Unit+instance Extension Unit Scheme+ +-- | A type that represents how to contact an individual or +-- organization. +data ContactInformation+instance Eq ContactInformation+instance Show ContactInformation+instance SchemaType ContactInformation+ +-- | A type that represents a telephonic contact. +data TelephoneNumber+instance Eq TelephoneNumber+instance Show TelephoneNumber+instance SchemaType TelephoneNumber+ +-- | A type for defining a date that shall be subject to +-- adjustment if it would otherwise fall on a day that is not +-- a business day in the specified business centers, together +-- with the convention for adjusting the date. +data AdjustableDate+instance Eq AdjustableDate+instance Show AdjustableDate+instance SchemaType AdjustableDate+ +-- | A type that is different from AdjustableDate in two +-- regards. First, date adjustments can be specified with +-- either a dateAdjustments element or a reference to an +-- existing dateAdjustments element. Second, it does not +-- require the specification of date adjustments. +data AdjustableDate2+instance Eq AdjustableDate2+instance Show AdjustableDate2+instance SchemaType AdjustableDate2+ +-- | A type for defining a series of dates that shall be subject +-- to adjustment if they would otherwise fall on a day that is +-- not a business day in the specified business centers, +-- together with the convention for adjusting the dates. +data AdjustableDates+instance Eq AdjustableDates+instance Show AdjustableDates+instance SchemaType AdjustableDates+ +-- | A type for defining a series of dates, either as a list of +-- adjustable dates, or a as a repeating sequence from a base +-- date +data AdjustableDatesOrRelativeDateOffset+instance Eq AdjustableDatesOrRelativeDateOffset+instance Show AdjustableDatesOrRelativeDateOffset+instance SchemaType AdjustableDatesOrRelativeDateOffset+ +-- | A type for defining a date that shall be subject to +-- adjustment if it would otherwise fall on a day that is not +-- a business day in the specified business centers, together +-- with the convention for adjusting the date. +data AdjustableOrAdjustedDate+instance Eq AdjustableOrAdjustedDate+instance Show AdjustableOrAdjustedDate+instance SchemaType AdjustableOrAdjustedDate+ +-- | A type giving the choice between defining a date as an +-- explicit date together with applicable adjustments or as +-- relative to some other (anchor) date. +data AdjustableOrRelativeDate+instance Eq AdjustableOrRelativeDate+instance Show AdjustableOrRelativeDate+instance SchemaType AdjustableOrRelativeDate+ +-- | A type giving the choice between defining a series of dates +-- as an explicit list of dates together with applicable +-- adjustments or as relative to some other series of (anchor) +-- dates. +data AdjustableOrRelativeDates+instance Eq AdjustableOrRelativeDates+instance Show AdjustableOrRelativeDates+instance SchemaType AdjustableOrRelativeDates+ +data AdjustableRelativeOrPeriodicDates+instance Eq AdjustableRelativeOrPeriodicDates+instance Show AdjustableRelativeOrPeriodicDates+instance SchemaType AdjustableRelativeOrPeriodicDates+ +-- | A type giving the choice between defining a series of dates +-- as an explicit list of dates together with applicable +-- adjustments, or as relative to some other series of +-- (anchor) dates, or as a set of factors to specify periodic +-- occurences. +data AdjustableRelativeOrPeriodicDates2+instance Eq AdjustableRelativeOrPeriodicDates2+instance Show AdjustableRelativeOrPeriodicDates2+instance SchemaType AdjustableRelativeOrPeriodicDates2+ +-- | A type defining a date (referred to as the derived date) as +-- a relative offset from another date (referred to as the +-- anchor date) plus optional date adjustments. +data AdjustedRelativeDateOffset+instance Eq AdjustedRelativeDateOffset+instance Show AdjustedRelativeDateOffset+instance SchemaType AdjustedRelativeDateOffset+instance Extension AdjustedRelativeDateOffset RelativeDateOffset+instance Extension AdjustedRelativeDateOffset Offset+instance Extension AdjustedRelativeDateOffset Period+ +data AgreementType+data AgreementTypeAttributes+instance Eq AgreementType+instance Eq AgreementTypeAttributes+instance Show AgreementType+instance Show AgreementTypeAttributes+instance SchemaType AgreementType+instance Extension AgreementType Scheme+ +data AgreementVersion+data AgreementVersionAttributes+instance Eq AgreementVersion+instance Eq AgreementVersionAttributes+instance Show AgreementVersion+instance Show AgreementVersionAttributes+instance SchemaType AgreementVersion+instance Extension AgreementVersion Scheme+ +-- | A type defining the exercise period for an American style +-- option together with any rules governing the notional +-- amount of the underlying which can be exercised on any +-- given exercise date and any associated exercise fees. +data AmericanExercise+instance Eq AmericanExercise+instance Show AmericanExercise+instance SchemaType AmericanExercise+instance Extension AmericanExercise Exercise+ +-- | Specifies a reference to a monetary amount. +data AmountReference+instance Eq AmountReference+instance Show AmountReference+instance SchemaType AmountReference+instance Extension AmountReference Reference+ +-- | A type defining a currency amount or a currency amount +-- schedule. +data AmountSchedule+instance Eq AmountSchedule+instance Show AmountSchedule+instance SchemaType AmountSchedule+instance Extension AmountSchedule Schedule+ +data AssetClass+data AssetClassAttributes+instance Eq AssetClass+instance Eq AssetClassAttributes+instance Show AssetClass+instance Show AssetClassAttributes+instance SchemaType AssetClass+instance Extension AssetClass Scheme+ +-- | A type to define automatic exercise of a swaption. With +-- automatic exercise the option is deemed to have exercised +-- if it is in the money by more than the threshold amount on +-- the exercise date. +data AutomaticExercise+instance Eq AutomaticExercise+instance Show AutomaticExercise+instance SchemaType AutomaticExercise+ +-- | To indicate the limitation percentage and limitation +-- period. +data AverageDailyTradingVolumeLimit+instance Eq AverageDailyTradingVolumeLimit+instance Show AverageDailyTradingVolumeLimit+instance SchemaType AverageDailyTradingVolumeLimit+ +-- | A type defining the beneficiary of the funds. +data Beneficiary+instance Eq Beneficiary+instance Show Beneficiary+instance SchemaType Beneficiary+ +-- | A type defining the Bermuda option exercise dates and the +-- expiration date together with any rules govenerning the +-- notional amount of the underlying which can be exercised on +-- any given exercise date and any associated exercise fee. +data BermudaExercise+instance Eq BermudaExercise+instance Show BermudaExercise+instance SchemaType BermudaExercise+instance Extension BermudaExercise Exercise+ +-- | Identifies the market sector in which the trade has been +-- arranged. +data BrokerConfirmation+instance Eq BrokerConfirmation+instance Show BrokerConfirmation+instance SchemaType BrokerConfirmation+ +-- | Identifies the market sector in which the trade has been +-- arranged. +data BrokerConfirmationType+data BrokerConfirmationTypeAttributes+instance Eq BrokerConfirmationType+instance Eq BrokerConfirmationTypeAttributes+instance Show BrokerConfirmationType+instance Show BrokerConfirmationTypeAttributes+instance SchemaType BrokerConfirmationType+instance Extension BrokerConfirmationType Scheme+ +-- | A code identifying a business day calendar location. A +-- business day calendar location is drawn from the list +-- identified by the business day calendar location scheme. +data BusinessCenter+data BusinessCenterAttributes+instance Eq BusinessCenter+instance Eq BusinessCenterAttributes+instance Show BusinessCenter+instance Show BusinessCenterAttributes+instance SchemaType BusinessCenter+instance Extension BusinessCenter Scheme+ +-- | A type for defining business day calendar used in +-- determining whether a day is a business day or not. A list +-- of business day calendar locations may be ordered in the +-- document alphabetically based on business day calendar +-- location code. An FpML document containing an unordered +-- business day calendar location list is still regarded as a +-- conformant document. +data BusinessCenters+instance Eq BusinessCenters+instance Show BusinessCenters+instance SchemaType BusinessCenters+ +-- | A pointer style reference to a set of business day calendar +-- defined elsewhere in the document. +data BusinessCentersReference+instance Eq BusinessCentersReference+instance Show BusinessCentersReference+instance SchemaType BusinessCentersReference+instance Extension BusinessCentersReference Reference+ +-- | A type for defining a time with respect to a business day +-- calendar location. For example, 11:00am London time. +data BusinessCenterTime+instance Eq BusinessCenterTime+instance Show BusinessCenterTime+instance SchemaType BusinessCenterTime+ +-- | A type defining a range of contiguous business days by +-- defining an unadjusted first date, an unadjusted last date +-- and a business day convention and business centers for +-- adjusting the first and last dates if they would otherwise +-- fall on a non business day in the specified business +-- centers. The days between the first and last date must also +-- be good business days in the specified centers to be +-- counted in the range. +data BusinessDateRange+instance Eq BusinessDateRange+instance Show BusinessDateRange+instance SchemaType BusinessDateRange+instance Extension BusinessDateRange DateRange+ +-- | A type defining the business day convention and financial +-- business centers used for adjusting any relevant date if it +-- would otherwise fall on a day that is not a business day in +-- the specified business centers. +data BusinessDayAdjustments+instance Eq BusinessDayAdjustments+instance Show BusinessDayAdjustments+instance SchemaType BusinessDayAdjustments+ +-- | Reference to a business day adjustments structure. +data BusinessDayAdjustmentsReference+instance Eq BusinessDayAdjustmentsReference+instance Show BusinessDayAdjustmentsReference+instance SchemaType BusinessDayAdjustmentsReference+instance Extension BusinessDayAdjustmentsReference Reference+ +-- | A type defining the ISDA calculation agent responsible for +-- performing duties as defined in the applicable product +-- definitions. +data CalculationAgent+instance Eq CalculationAgent+instance Show CalculationAgent+instance SchemaType CalculationAgent+ +-- | A type defining the frequency at which calculation period +-- end dates occur within the regular part of the calculation +-- period schedule and thier roll date convention. In case the +-- calculation frequency is of value T (term), the period is +-- defined by the +-- swap\swapStream\calculationPerioDates\effectiveDate and the +-- swap\swapStream\calculationPerioDates\terminationDate. +data CalculationPeriodFrequency+instance Eq CalculationPeriodFrequency+instance Show CalculationPeriodFrequency+instance SchemaType CalculationPeriodFrequency+instance Extension CalculationPeriodFrequency Frequency+ +-- | An identifier used to identify a single component cashflow. +data CashflowId+data CashflowIdAttributes+instance Eq CashflowId+instance Eq CashflowIdAttributes+instance Show CashflowId+instance Show CashflowIdAttributes+instance SchemaType CashflowId+instance Extension CashflowId Scheme+ +-- | The notional/principal value/quantity/volume used to +-- compute the cashflow. +data CashflowNotional+instance Eq CashflowNotional+instance Show CashflowNotional+instance SchemaType CashflowNotional+ +-- | A coding scheme used to describe the type or purpose of a +-- cash flow or cash flow component. +data CashflowType+data CashflowTypeAttributes+instance Eq CashflowType+instance Eq CashflowTypeAttributes+instance Show CashflowType+instance Show CashflowTypeAttributes+instance SchemaType CashflowType+instance Extension CashflowType Scheme+ +-- | A type defining the list of reference institutions polled +-- for relevant rates or prices when determining the cash +-- settlement amount for a product where cash settlement is +-- applicable. +data CashSettlementReferenceBanks+instance Eq CashSettlementReferenceBanks+instance Show CashSettlementReferenceBanks+instance SchemaType CashSettlementReferenceBanks+ +-- | Unless otherwise specified, the principal clearance system +-- customarily used for settling trades in the relevant +-- underlying. +data ClearanceSystem+data ClearanceSystemAttributes+instance Eq ClearanceSystem+instance Eq ClearanceSystemAttributes+instance Show ClearanceSystem+instance Show ClearanceSystemAttributes+instance SchemaType ClearanceSystem+instance Extension ClearanceSystem Scheme+ +-- | The definitions, such as those published by ISDA, that will +-- define the terms of the trade. +data ContractualDefinitions+data ContractualDefinitionsAttributes+instance Eq ContractualDefinitions+instance Eq ContractualDefinitionsAttributes+instance Show ContractualDefinitions+instance Show ContractualDefinitionsAttributes+instance SchemaType ContractualDefinitions+instance Extension ContractualDefinitions Scheme+ +data ContractualMatrix+instance Eq ContractualMatrix+instance Show ContractualMatrix+instance SchemaType ContractualMatrix+ +-- | A contractual supplement (such as those published by ISDA) +-- that will apply to the trade. +data ContractualSupplement+data ContractualSupplementAttributes+instance Eq ContractualSupplement+instance Eq ContractualSupplementAttributes+instance Show ContractualSupplement+instance Show ContractualSupplementAttributes+instance SchemaType ContractualSupplement+instance Extension ContractualSupplement Scheme+ +-- | A contractual supplement (such as those published by ISDA) +-- and its publication date that will apply to the trade. +data ContractualTermsSupplement+instance Eq ContractualTermsSupplement+instance Show ContractualTermsSupplement+instance SchemaType ContractualTermsSupplement+ +-- | A type that describes the information to identify a +-- correspondent bank that will make delivery of the funds on +-- the paying bank's behalf in the country where the payment +-- is to be made. +data CorrespondentInformation+instance Eq CorrespondentInformation+instance Show CorrespondentInformation+instance SchemaType CorrespondentInformation+ +-- | The code representation of a country or an area of special +-- sovereignty. By default it is a valid 2 character country +-- code as defined by the ISO standard 3166-1 alpha-2 - Codes +-- for representation of countries +-- http://www.niso.org/standards/resources/3166.html. +data CountryCode+data CountryCodeAttributes+instance Eq CountryCode+instance Eq CountryCodeAttributes+instance Show CountryCode+instance Show CountryCodeAttributes+instance SchemaType CountryCode+instance Extension CountryCode Xsd.Token+ +-- | The repayment precedence of a debt instrument. +data CreditSeniority+data CreditSeniorityAttributes+instance Eq CreditSeniority+instance Eq CreditSeniorityAttributes+instance Show CreditSeniority+instance Show CreditSeniorityAttributes+instance SchemaType CreditSeniority+instance Extension CreditSeniority Scheme+ +-- | The agreement executed between the parties and intended to +-- govern collateral arrangement for all OTC derivatives +-- transactions between those parties. +data CreditSupportAgreement+instance Eq CreditSupportAgreement+instance Show CreditSupportAgreement+instance SchemaType CreditSupportAgreement+ +data CreditSupportAgreementIdentifier+data CreditSupportAgreementIdentifierAttributes+instance Eq CreditSupportAgreementIdentifier+instance Eq CreditSupportAgreementIdentifierAttributes+instance Show CreditSupportAgreementIdentifier+instance Show CreditSupportAgreementIdentifierAttributes+instance SchemaType CreditSupportAgreementIdentifier+instance Extension CreditSupportAgreementIdentifier Scheme+ +data CreditSupportAgreementType+data CreditSupportAgreementTypeAttributes+instance Eq CreditSupportAgreementType+instance Eq CreditSupportAgreementTypeAttributes+instance Show CreditSupportAgreementType+instance Show CreditSupportAgreementTypeAttributes+instance SchemaType CreditSupportAgreementType+instance Extension CreditSupportAgreementType Scheme+ +-- | A party's credit rating. +data CreditRating+data CreditRatingAttributes+instance Eq CreditRating+instance Eq CreditRatingAttributes+instance Show CreditRating+instance Show CreditRatingAttributes+instance SchemaType CreditRating+instance Extension CreditRating Scheme+ +-- | The code representation of a currency or fund. By default +-- it is a valid currency code as defined by the ISO standard +-- 4217 - Codes for representation of currencies and funds +-- http://www.iso.org/iso/en/prods-services/popstds/currencycodeslist.html. +data Currency+data CurrencyAttributes+instance Eq Currency+instance Eq CurrencyAttributes+instance Show Currency+instance Show CurrencyAttributes+instance SchemaType Currency+instance Extension Currency Scheme+ +-- | List of Dates +data DateList+instance Eq DateList+instance Show DateList+instance SchemaType DateList+ +-- | A type defining an offset used in calculating a date when +-- this date is defined in reference to another date through a +-- date offset. The type includes the convention for adjusting +-- the date and an optional sequence element to indicate the +-- order in a sequence of multiple date offsets. +data DateOffset+instance Eq DateOffset+instance Show DateOffset+instance SchemaType DateOffset+instance Extension DateOffset Offset+instance Extension DateOffset Period+ +-- | A type defining a contiguous series of calendar dates. The +-- date range is defined as all the dates between and +-- including the first and the last date. The first date must +-- fall before the last date. +data DateRange+instance Eq DateRange+instance Show DateRange+instance SchemaType DateRange+ +-- | Reference to an identified date or a complex date +-- structure. +data DateReference+instance Eq DateReference+instance Show DateReference+instance SchemaType DateReference+instance Extension DateReference Reference+ +-- | List of DateTimes +data DateTimeList+instance Eq DateTimeList+instance Show DateTimeList+instance SchemaType DateTimeList+ +-- | The specification for how the number of days between two +-- dates is calculated for purposes of calculation of a fixed +-- or floating payment amount and the basis for how many days +-- are assumed to be in a year. Day Count Fraction is an ISDA +-- term. The equivalent AFB (Association Francaise de Banques) +-- term is Calculation Basis. +data DayCountFraction+data DayCountFractionAttributes+instance Eq DayCountFraction+instance Eq DayCountFractionAttributes+instance Show DayCountFraction+instance Show DayCountFractionAttributes+instance SchemaType DayCountFraction+instance Extension DayCountFraction Scheme+ +-- | Coding scheme that specifies the method according to which +-- an amount or a date is determined. +data DeterminationMethod+data DeterminationMethodAttributes+instance Eq DeterminationMethod+instance Eq DeterminationMethodAttributes+instance Show DeterminationMethod+instance Show DeterminationMethodAttributes+instance SchemaType DeterminationMethod+instance Extension DeterminationMethod Scheme+ +-- | A reference to the return swap notional determination +-- method. +data DeterminationMethodReference+instance Eq DeterminationMethodReference+instance Show DeterminationMethodReference+instance SchemaType DeterminationMethodReference+instance Extension DeterminationMethodReference Reference+ +-- | An entity for defining the definitions that govern the +-- document and should include the year and type of +-- definitions referenced, along with any relevant +-- documentation (such as master agreement) and the date it +-- was signed. +data Documentation+instance Eq Documentation+instance Show Documentation+instance SchemaType Documentation+ +-- | A for holding information about documents external to the +-- FpML. +data ExternalDocument+instance Eq ExternalDocument+instance Show ExternalDocument+instance SchemaType ExternalDocument+ +-- | A special type that allows references to HTTP attachments +-- identified with an HTTP "Content-ID" header, as is done +-- with SOAP with Attachments +-- (http://www.w3.org/TR/SOAP-attachments). Unlike with a +-- normal FpML @href, the type is not IDREF, as the target is +-- not identified by an XML @id attribute. +data HTTPAttachmentReference+instance Eq HTTPAttachmentReference+instance Show HTTPAttachmentReference+instance SchemaType HTTPAttachmentReference+instance Extension HTTPAttachmentReference Reference+ +-- | A special type meant to be used for elements with no +-- content and no attributes. +data Empty+instance Eq Empty+instance Show Empty+instance SchemaType Empty+ +-- | A legal entity identifier (e.g. RED entity code). +data EntityId+data EntityIdAttributes+instance Eq EntityId+instance Eq EntityIdAttributes+instance Show EntityId+instance Show EntityIdAttributes+instance SchemaType EntityId+instance Extension EntityId Scheme+ +-- | The name of the reference entity. A free format string. +-- FpML does not define usage rules for this element. +data EntityName+data EntityNameAttributes+instance Eq EntityName+instance Eq EntityNameAttributes+instance Show EntityName+instance Show EntityNameAttributes+instance SchemaType EntityName+instance Extension EntityName Scheme+ +-- | A type defining the exercise period for a European style +-- option together with any rules governing the notional +-- amount of the underlying which can be exercised on any +-- given exercise date and any associated exercise fees. +data EuropeanExercise+instance Eq EuropeanExercise+instance Show EuropeanExercise+instance SchemaType EuropeanExercise+instance Extension EuropeanExercise Exercise+ +-- | A short form unique identifier for an exchange. If the +-- element is not present then the exchange shall be the +-- primary exchange on which the underlying is listed. The +-- term "Exchange" is assumed to have the meaning as defined +-- in the ISDA 2002 Equity Derivatives Definitions. +data ExchangeId+data ExchangeIdAttributes+instance Eq ExchangeId+instance Eq ExchangeIdAttributes+instance Show ExchangeId+instance Show ExchangeIdAttributes+instance SchemaType ExchangeId+instance Extension ExchangeId Scheme+ +-- | The abstract base class for all types which define way in +-- which options may be exercised. +data Exercise+instance Eq Exercise+instance Show Exercise+instance SchemaType Exercise+ +-- | A type defining the fee payable on exercise of an option. +-- This fee may be defined as an amount or a percentage of the +-- notional exercised. +data ExerciseFee+instance Eq ExerciseFee+instance Show ExerciseFee+instance SchemaType ExerciseFee+ +-- | A type to define a fee or schedule of fees to be payable on +-- the exercise of an option. This fee may be defined as an +-- amount or a percentage of the notional exercised. +data ExerciseFeeSchedule+instance Eq ExerciseFeeSchedule+instance Show ExerciseFeeSchedule+instance SchemaType ExerciseFeeSchedule+ +-- | A type defining to whom and where notice of execution +-- should be given. The partyReference refers to one of the +-- principal parties of the trade. If present the +-- exerciseNoticePartyReference refers to a party, other than +-- the principal party, to whome notice should be given. +data ExerciseNotice+instance Eq ExerciseNotice+instance Show ExerciseNotice+instance SchemaType ExerciseNotice+ +-- | A type describing how notice of exercise should be given. +-- This can be either manual or automatic. +data ExerciseProcedure+instance Eq ExerciseProcedure+instance Show ExerciseProcedure+instance SchemaType ExerciseProcedure+ +-- | A type describing how notice of exercise should be given. +-- This can be either manual or automatic. +data ExerciseProcedureOption+instance Eq ExerciseProcedureOption+instance Show ExerciseProcedureOption+instance SchemaType ExerciseProcedureOption+ +-- | A type defining a floating rate. +data FloatingRate+instance Eq FloatingRate+instance Show FloatingRate+instance SchemaType FloatingRate+instance Extension FloatingRate Rate+ +-- | A type defining the floating rate and definitions relating +-- to the calculation of floating rate amounts. +data FloatingRateCalculation+instance Eq FloatingRateCalculation+instance Show FloatingRateCalculation+instance SchemaType FloatingRateCalculation+instance Extension FloatingRateCalculation FloatingRate+instance Extension FloatingRateCalculation Rate+ +-- | The ISDA Floating Rate Option, i.e. the floating rate +-- index. +data FloatingRateIndex+data FloatingRateIndexAttributes+instance Eq FloatingRateIndex+instance Eq FloatingRateIndexAttributes+instance Show FloatingRateIndex+instance Show FloatingRateIndexAttributes+instance SchemaType FloatingRateIndex+instance Extension FloatingRateIndex Scheme+ +-- | A type defining a rate index. +data ForecastRateIndex+instance Eq ForecastRateIndex+instance Show ForecastRateIndex+instance SchemaType ForecastRateIndex+ +-- | A type describing a financial formula, with its description +-- and components. +data Formula+instance Eq Formula+instance Show Formula+instance SchemaType Formula+ +-- | Elements describing the components of the formula. The name +-- attribute points to a value used in the math element. The +-- href attribute points to a numeric value defined elsewhere +-- in the document that is used by the formula component. +data FormulaComponent+instance Eq FormulaComponent+instance Show FormulaComponent+instance SchemaType FormulaComponent+ +-- | A type defining a time frequency, e.g. one day, three +-- months. Used for specifying payment or calculation +-- frequencies at which the value T (Term) is applicable. +data Frequency+instance Eq Frequency+instance Show Frequency+instance SchemaType Frequency+ +-- | A type defining a currency amount as at a future value +-- date. +data FutureValueAmount+instance Eq FutureValueAmount+instance Show FutureValueAmount+instance SchemaType FutureValueAmount+instance Extension FutureValueAmount NonNegativeMoney+instance Extension FutureValueAmount MoneyBase+ +-- | A type that specifies the source for and timing of a fixing +-- of an exchange rate. This is used in the agreement of +-- non-deliverable forward trades as well as various types of +-- FX OTC options that require observations against a +-- particular rate. +data FxFixing+instance Eq FxFixing+instance Show FxFixing+instance SchemaType FxFixing+ +-- | A type that is used for describing cash settlement of an +-- option / non deliverable forward. It includes the currency +-- to settle into together with the fixings required to +-- calculate the currency amount. +data FxCashSettlement+instance Eq FxCashSettlement+instance Show FxCashSettlement+instance SchemaType FxCashSettlement+ +-- | A type describing the rate of a currency conversion: pair +-- of currency, quotation mode and exchange rate. +data FxRate+instance Eq FxRate+instance Show FxRate+instance SchemaType FxRate+ +-- | A type defining the source and time for an fx rate. +data FxSpotRateSource+instance Eq FxSpotRateSource+instance Show FxSpotRateSource+instance SchemaType FxSpotRateSource+ +-- | An entity for defining a generic agreement executed between +-- two parties for any purpose. +data GenericAgreement+instance Eq GenericAgreement+instance Show GenericAgreement+instance SchemaType GenericAgreement+ +-- | Identification of the law governing the transaction. +data GoverningLaw+data GoverningLawAttributes+instance Eq GoverningLaw+instance Eq GoverningLawAttributes+instance Show GoverningLaw+instance Show GoverningLawAttributes+instance SchemaType GoverningLaw+instance Extension GoverningLaw Scheme+ +-- | A payment component owed from one party to the other for +-- the cash flow date. This payment component should by of +-- only a single type, e.g. a fee or a cashflow from a +-- cashflow stream. +data GrossCashflow+instance Eq GrossCashflow+instance Show GrossCashflow+instance SchemaType GrossCashflow+ +-- | Specifies Currency with ID attribute. +data IdentifiedCurrency+data IdentifiedCurrencyAttributes+instance Eq IdentifiedCurrency+instance Eq IdentifiedCurrencyAttributes+instance Show IdentifiedCurrency+instance Show IdentifiedCurrencyAttributes+instance SchemaType IdentifiedCurrency+instance Extension IdentifiedCurrency Currency+ +-- | Reference to a currency with ID attribute +data IdentifiedCurrencyReference+instance Eq IdentifiedCurrencyReference+instance Show IdentifiedCurrencyReference+instance SchemaType IdentifiedCurrencyReference+instance Extension IdentifiedCurrencyReference Reference+ +-- | A date which can be referenced elsewhere. +data IdentifiedDate+data IdentifiedDateAttributes+instance Eq IdentifiedDate+instance Eq IdentifiedDateAttributes+instance Show IdentifiedDate+instance Show IdentifiedDateAttributes+instance SchemaType IdentifiedDate+instance Extension IdentifiedDate Xsd.Date+ +-- | A type extending the PayerReceiverEnum type wih an id +-- attribute. +data IdentifiedPayerReceiver+data IdentifiedPayerReceiverAttributes+instance Eq IdentifiedPayerReceiver+instance Eq IdentifiedPayerReceiverAttributes+instance Show IdentifiedPayerReceiver+instance Show IdentifiedPayerReceiverAttributes+instance SchemaType IdentifiedPayerReceiver+instance Extension IdentifiedPayerReceiver PayerReceiverEnum+ +-- | A party's industry sector classification. +data IndustryClassification+data IndustryClassificationAttributes+instance Eq IndustryClassification+instance Eq IndustryClassificationAttributes+instance Show IndustryClassification+instance Show IndustryClassificationAttributes+instance SchemaType IndustryClassification+instance Extension IndustryClassification Scheme+ +data InformationProvider+data InformationProviderAttributes+instance Eq InformationProvider+instance Eq InformationProviderAttributes+instance Show InformationProvider+instance Show InformationProviderAttributes+instance SchemaType InformationProvider+instance Extension InformationProvider Scheme+ +-- | A type defining the source for a piece of information (e.g. +-- a rate refix or an fx fixing). +data InformationSource+instance Eq InformationSource+instance Show InformationSource+instance SchemaType InformationSource+ +-- | A short form unique identifier for a security. +data InstrumentId+data InstrumentIdAttributes+instance Eq InstrumentId+instance Eq InstrumentIdAttributes+instance Show InstrumentId+instance Show InstrumentIdAttributes+instance SchemaType InstrumentId+instance Extension InstrumentId Scheme+ +-- | A type defining the way in which interests are accrued: the +-- applicable rate (fixed or floating reference) and the +-- compounding method. +data InterestAccrualsCompoundingMethod+instance Eq InterestAccrualsCompoundingMethod+instance Show InterestAccrualsCompoundingMethod+instance SchemaType InterestAccrualsCompoundingMethod+instance Extension InterestAccrualsCompoundingMethod InterestAccrualsMethod+ +-- | A type describing the method for accruing interests on +-- dividends. Can be either a fixed rate reference or a +-- floating rate reference. +data InterestAccrualsMethod+instance Eq InterestAccrualsMethod+instance Show InterestAccrualsMethod+instance SchemaType InterestAccrualsMethod+ +-- | A type that describes the information to identify an +-- intermediary through which payment will be made by the +-- correspondent bank to the ultimate beneficiary of the +-- funds. +data IntermediaryInformation+instance Eq IntermediaryInformation+instance Show IntermediaryInformation+instance SchemaType IntermediaryInformation+ +-- | The type of interpolation used. +data InterpolationMethod+data InterpolationMethodAttributes+instance Eq InterpolationMethod+instance Eq InterpolationMethodAttributes+instance Show InterpolationMethod+instance Show InterpolationMethodAttributes+instance SchemaType InterpolationMethod+instance Extension InterpolationMethod Scheme+ +-- | The data type used for indicating the language of the +-- resource, described using the ISO 639-2/T Code. +data Language+data LanguageAttributes+instance Eq Language+instance Eq LanguageAttributes+instance Show Language+instance Show LanguageAttributes+instance SchemaType Language+instance Extension Language Scheme+ +-- | A supertype of leg. All swap legs extend this type. +data Leg+instance Eq Leg+instance Show Leg+instance SchemaType Leg+ +-- | A type defining a legal entity. +data LegalEntity+instance Eq LegalEntity+instance Show LegalEntity+instance SchemaType LegalEntity+ +-- | References a credit entity defined elsewhere in the +-- document. +data LegalEntityReference+instance Eq LegalEntityReference+instance Show LegalEntityReference+instance SchemaType LegalEntityReference+instance Extension LegalEntityReference Reference+ +-- | A type to define the main publication source. +data MainPublication+data MainPublicationAttributes+instance Eq MainPublication+instance Eq MainPublicationAttributes+instance Show MainPublication+instance Show MainPublicationAttributes+instance SchemaType MainPublication+instance Extension MainPublication Scheme+ +-- | A type defining manual exercise, i.e. that the option buyer +-- counterparty must give notice to the option seller of +-- exercise. +data ManualExercise+instance Eq ManualExercise+instance Show ManualExercise+instance SchemaType ManualExercise+ +-- | An entity for defining the agreement executed between the +-- parties and intended to govern all OTC derivatives +-- transactions between those parties. +data MasterAgreement+instance Eq MasterAgreement+instance Show MasterAgreement+instance SchemaType MasterAgreement+ +data MasterAgreementType+data MasterAgreementTypeAttributes+instance Eq MasterAgreementType+instance Eq MasterAgreementTypeAttributes+instance Show MasterAgreementType+instance Show MasterAgreementTypeAttributes+instance SchemaType MasterAgreementType+instance Extension MasterAgreementType Scheme+ +data MasterAgreementVersion+data MasterAgreementVersionAttributes+instance Eq MasterAgreementVersion+instance Eq MasterAgreementVersionAttributes+instance Show MasterAgreementVersion+instance Show MasterAgreementVersionAttributes+instance SchemaType MasterAgreementVersion+instance Extension MasterAgreementVersion Scheme+ +-- | An entity for defining the master confirmation agreement +-- executed between the parties. +data MasterConfirmation+instance Eq MasterConfirmation+instance Show MasterConfirmation+instance SchemaType MasterConfirmation+ +data MasterConfirmationAnnexType+data MasterConfirmationAnnexTypeAttributes+instance Eq MasterConfirmationAnnexType+instance Eq MasterConfirmationAnnexTypeAttributes+instance Show MasterConfirmationAnnexType+instance Show MasterConfirmationAnnexTypeAttributes+instance SchemaType MasterConfirmationAnnexType+instance Extension MasterConfirmationAnnexType Scheme+ +data MasterConfirmationType+data MasterConfirmationTypeAttributes+instance Eq MasterConfirmationType+instance Eq MasterConfirmationTypeAttributes+instance Show MasterConfirmationType+instance Show MasterConfirmationTypeAttributes+instance SchemaType MasterConfirmationType+instance Extension MasterConfirmationType Scheme+ +-- | An identifier used to identify matched cashflows. +data MatchId+data MatchIdAttributes+instance Eq MatchId+instance Eq MatchIdAttributes+instance Show MatchId+instance Show MatchIdAttributes+instance SchemaType MatchId+instance Extension MatchId Scheme+ +-- | A type defining a mathematical expression. +data Math+instance Eq Math+instance Show Math+instance SchemaType Math+ +data MatrixType+data MatrixTypeAttributes+instance Eq MatrixType+instance Eq MatrixTypeAttributes+instance Show MatrixType+instance Show MatrixTypeAttributes+instance SchemaType MatrixType+instance Extension MatrixType Scheme+ +data MatrixTerm+data MatrixTermAttributes+instance Eq MatrixTerm+instance Eq MatrixTermAttributes+instance Show MatrixTerm+instance Show MatrixTermAttributes+instance SchemaType MatrixTerm+instance Extension MatrixTerm Scheme+ +-- | The type that indicates the type of media used to store the +-- content. MimeType is used to determine the software +-- product(s) that can read the content. MIME types are +-- described in RFC 2046. +data MimeType+data MimeTypeAttributes+instance Eq MimeType+instance Eq MimeTypeAttributes+instance Show MimeType+instance Show MimeTypeAttributes+instance SchemaType MimeType+instance Extension MimeType Scheme+ +-- | A type defining a currency amount. +data Money+instance Eq Money+instance Show Money+instance SchemaType Money+instance Extension Money MoneyBase+ +-- | Abstract base class for all money types. +data MoneyBase+instance Eq MoneyBase+instance Show MoneyBase+instance SchemaType MoneyBase+ +-- | A type defining multiple exercises. As defining in the 2000 +-- ISDA Definitions, Section 12.4. Multiple Exercise, the +-- buyer of the option has the right to exercise all or less +-- than all the unexercised notional amount of the underlying +-- swap on one or more days in the exercise period, but on any +-- such day may not exercise less than the minimum notional +-- amount or more than the maximum notional amount, and if an +-- integral multiple amount is specified, the notional +-- exercised must be equal to or, be an integral multiple of, +-- the integral multiple amount. +data MultipleExercise+instance Eq MultipleExercise+instance Show MultipleExercise+instance SchemaType MultipleExercise+ +-- | A type defining a currency amount or a currency amount +-- schedule. +data NonNegativeAmountSchedule+instance Eq NonNegativeAmountSchedule+instance Show NonNegativeAmountSchedule+instance SchemaType NonNegativeAmountSchedule+instance Extension NonNegativeAmountSchedule NonNegativeSchedule+ +-- | A type defining a non negative money amount. +data NonNegativeMoney+instance Eq NonNegativeMoney+instance Show NonNegativeMoney+instance SchemaType NonNegativeMoney+instance Extension NonNegativeMoney MoneyBase+ +-- | A complex type to specify non negative payments. +data NonNegativePayment+instance Eq NonNegativePayment+instance Show NonNegativePayment+instance SchemaType NonNegativePayment+instance Extension NonNegativePayment PaymentBaseExtended+instance Extension NonNegativePayment PaymentBase+ +-- | A type defining a schedule of non-negative rates or amounts +-- in terms of an initial value and then a series of step date +-- and value pairs. On each step date the rate or amount +-- changes to the new step value. The series of step date and +-- value pairs are optional. If not specified, this implies +-- that the initial value remains unchanged over time. +data NonNegativeSchedule+instance Eq NonNegativeSchedule+instance Show NonNegativeSchedule+instance SchemaType NonNegativeSchedule+ +-- | A type defining a step date and non-negative step value +-- pair. This step definitions are used to define varying rate +-- or amount schedules, e.g. a notional amortization or a +-- step-up coupon schedule. +data NonNegativeStep+instance Eq NonNegativeStep+instance Show NonNegativeStep+instance SchemaType NonNegativeStep+instance Extension NonNegativeStep StepBase+ +-- | A complex type to specify the notional amount. +data NotionalAmount+instance Eq NotionalAmount+instance Show NotionalAmount+instance SchemaType NotionalAmount+instance Extension NotionalAmount NonNegativeMoney+instance Extension NotionalAmount MoneyBase+ +-- | A reference to the notional amount. +data NotionalAmountReference+instance Eq NotionalAmountReference+instance Show NotionalAmountReference+instance SchemaType NotionalAmountReference+instance Extension NotionalAmountReference Reference+ +-- | A reference to the notional amount. +data NotionalReference+instance Eq NotionalReference+instance Show NotionalReference+instance SchemaType NotionalReference+instance Extension NotionalReference Reference+ +-- | A type defining an offset used in calculating a new date +-- relative to a reference date. Currently, the only offsets +-- defined are expected to be expressed as either calendar or +-- business day offsets. +data Offset+instance Eq Offset+instance Show Offset+instance SchemaType Offset+instance Extension Offset Period+ +-- | Allows the specification of a time that may be on a day +-- prior or subsequent to the day in question. This type is +-- intended for use with a day of the week (i.e. where no +-- actual date is specified) as part of, for example, a period +-- that runs from 23:00-07:00 on a series of days and where +-- holidays on the actual days would affect the entire time +-- period. +data OffsetPrevailingTime+instance Eq OffsetPrevailingTime+instance Show OffsetPrevailingTime+instance SchemaType OffsetPrevailingTime+ +data OnBehalfOf+instance Eq OnBehalfOf+instance Show OnBehalfOf+instance SchemaType OnBehalfOf+ +data OriginatingEvent+data OriginatingEventAttributes+instance Eq OriginatingEvent+instance Eq OriginatingEventAttributes+instance Show OriginatingEvent+instance Show OriginatingEventAttributes+instance SchemaType OriginatingEvent+instance Extension OriginatingEvent Scheme+ +-- | A type defining partial exercise. As defined in the 2000 +-- ISDA Definitions, Section 12.3 Partial Exercise, the buyer +-- of the option may exercise all or less than all the +-- notional amount of the underlying swap but may not be less +-- than the minimum notional amount (if specified) and must be +-- an integral multiple of the integral multiple amount if +-- specified. +data PartialExercise+instance Eq PartialExercise+instance Show PartialExercise+instance SchemaType PartialExercise+ +data Party+instance Eq Party+instance Show Party+instance SchemaType Party+ +-- | The data type used for party identifiers. +data PartyId+data PartyIdAttributes+instance Eq PartyId+instance Eq PartyIdAttributes+instance Show PartyId+instance Show PartyIdAttributes+instance SchemaType PartyId+instance Extension PartyId Scheme+ +-- | The data type used for the legal name of an organization. +data PartyName+data PartyNameAttributes+instance Eq PartyName+instance Eq PartyNameAttributes+instance Show PartyName+instance Show PartyNameAttributes+instance SchemaType PartyName+instance Extension PartyName Scheme+ +-- | Reference to a party. +data PartyReference+instance Eq PartyReference+instance Show PartyReference+instance SchemaType PartyReference+instance Extension PartyReference Reference+ +data PartyRelationship+instance Eq PartyRelationship+instance Show PartyRelationship+instance SchemaType PartyRelationship+ +-- | A description of the legal agreement(s) and definitions +-- that document a party's relationships with other parties +data PartyRelationshipDocumentation+instance Eq PartyRelationshipDocumentation+instance Show PartyRelationshipDocumentation+instance SchemaType PartyRelationshipDocumentation+ +-- | A type describing a role played by a party in one or more +-- transactions. Examples include roles such as guarantor, +-- custodian, confirmation service provider, etc. This can be +-- extended to provide custom roles. +data PartyRole+data PartyRoleAttributes+instance Eq PartyRole+instance Eq PartyRoleAttributes+instance Show PartyRole+instance Show PartyRoleAttributes+instance SchemaType PartyRole+instance Extension PartyRole Scheme+ +-- | A type refining the role a role played by a party in one or +-- more transactions. Examples include "AllPositions" and +-- "SomePositions" for Guarantor. This can be extended to +-- provide custom types. +data PartyRoleType+data PartyRoleTypeAttributes+instance Eq PartyRoleType+instance Eq PartyRoleTypeAttributes+instance Show PartyRoleType+instance Show PartyRoleTypeAttributes+instance SchemaType PartyRoleType+instance Extension PartyRoleType Scheme+ +-- | Reference to an organizational unit. +data BusinessUnitReference+instance Eq BusinessUnitReference+instance Show BusinessUnitReference+instance SchemaType BusinessUnitReference+instance Extension BusinessUnitReference Reference+ +-- | Reference to an individual. +data PersonReference+instance Eq PersonReference+instance Show PersonReference+instance SchemaType PersonReference+instance Extension PersonReference Reference+ +-- | A reference to a partyTradeIdentifier object. +data PartyTradeIdentifierReference+instance Eq PartyTradeIdentifierReference+instance Show PartyTradeIdentifierReference+instance SchemaType PartyTradeIdentifierReference+instance Extension PartyTradeIdentifierReference Reference+ +-- | A type for defining payments +data Payment+instance Eq Payment+instance Show Payment+instance SchemaType Payment+instance Extension Payment PaymentBase+ +-- | An abstract base class for payment types. +data PaymentBase+instance Eq PaymentBase+instance Show PaymentBase+instance SchemaType PaymentBase+ +-- | Base type for payments. +data PaymentBaseExtended+instance Eq PaymentBaseExtended+instance Show PaymentBaseExtended+instance SchemaType PaymentBaseExtended+instance Extension PaymentBaseExtended PaymentBase+ +-- | Details on the referenced payment. e.g. Its cashflow +-- components, settlement details. +data PaymentDetails+instance Eq PaymentDetails+instance Show PaymentDetails+instance SchemaType PaymentDetails+ + +-- | An identifier used to identify a matchable payment. +data PaymentId+data PaymentIdAttributes+instance Eq PaymentId+instance Eq PaymentIdAttributes+instance Show PaymentId+instance Show PaymentIdAttributes+instance SchemaType PaymentId+instance Extension PaymentId Scheme+ +-- | Reference to a payment. +data PaymentReference+instance Eq PaymentReference+instance Show PaymentReference+instance SchemaType PaymentReference+instance Extension PaymentReference Reference+ +data PaymentType+data PaymentTypeAttributes+instance Eq PaymentType+instance Eq PaymentTypeAttributes+instance Show PaymentType+instance Show PaymentTypeAttributes+instance SchemaType PaymentType+instance Extension PaymentType Scheme+ +-- | A type to define recurring periods or time offsets. +data Period+instance Eq Period+instance Show Period+instance SchemaType Period+ +data PeriodicDates+instance Eq PeriodicDates+instance Show PeriodicDates+instance SchemaType PeriodicDates+ +-- | A type defining a currency amount or a currency amount +-- schedule. +data PositiveAmountSchedule+instance Eq PositiveAmountSchedule+instance Show PositiveAmountSchedule+instance SchemaType PositiveAmountSchedule+instance Extension PositiveAmountSchedule PositiveSchedule+ +-- | A type defining a positive money amount +data PositiveMoney+instance Eq PositiveMoney+instance Show PositiveMoney+instance SchemaType PositiveMoney+instance Extension PositiveMoney MoneyBase+ +-- | A complex type to specify positive payments. +data PositivePayment+instance Eq PositivePayment+instance Show PositivePayment+instance SchemaType PositivePayment+instance Extension PositivePayment PaymentBaseExtended+instance Extension PositivePayment PaymentBase+ +-- | A type defining a schedule of strictly-postive rates or +-- amounts in terms of an initial value and then a series of +-- step date and value pairs. On each step date the rate or +-- amount changes to the new step value. The series of step +-- date and value pairs are optional. If not specified, this +-- implies that the initial value remains unchanged over time. +data PositiveSchedule+instance Eq PositiveSchedule+instance Show PositiveSchedule+instance SchemaType PositiveSchedule+ +-- | A type defining a step date and strictly-positive step +-- value pair. This step definitions are used to define +-- varying rate or amount schedules, e.g. a notional +-- amortization or a step-up coupon schedule. +data PositiveStep+instance Eq PositiveStep+instance Show PositiveStep+instance SchemaType PositiveStep+instance Extension PositiveStep StepBase+ +-- | A type for defining a time with respect to a geographic +-- location, for example 11:00 Phoenix, USA. This type should +-- be used where a wider range of locations than those +-- available as business centres is required. +data PrevailingTime+instance Eq PrevailingTime+instance Show PrevailingTime+instance SchemaType PrevailingTime+ +-- | An abstract pricing structure base type. Used as a base for +-- structures such as yield curves and volatility matrices. +data PricingStructure+instance Eq PricingStructure+instance Show PricingStructure+instance SchemaType PricingStructure+ +-- | Reference to a pricing structure or any derived components +-- (i.e. yield curve). +data PricingStructureReference+instance Eq PricingStructureReference+instance Show PricingStructureReference+instance SchemaType PricingStructureReference+instance Extension PricingStructureReference Reference+ +-- | A type defining which principal exchanges occur for the +-- stream. +data PrincipalExchanges+instance Eq PrincipalExchanges+instance Show PrincipalExchanges+instance SchemaType PrincipalExchanges+ +-- | The base type which all FpML products extend. +data Product+instance Eq Product+instance Show Product+instance SchemaType Product+ +data ProductId+data ProductIdAttributes+instance Eq ProductId+instance Eq ProductIdAttributes+instance Show ProductId+instance Show ProductIdAttributes+instance SchemaType ProductId+instance Extension ProductId Scheme+ +-- | Reference to a full FpML product. +data ProductReference+instance Eq ProductReference+instance Show ProductReference+instance SchemaType ProductReference+instance Extension ProductReference Reference+ +data ProductType+data ProductTypeAttributes+instance Eq ProductType+instance Eq ProductTypeAttributes+instance Show ProductType+instance Show ProductTypeAttributes+instance SchemaType ProductType+instance Extension ProductType Scheme+ +-- | A type that describes the composition of a rate that has +-- been quoted or is to be quoted. This includes the two +-- currencies and the quotation relationship between the two +-- currencies and is used as a building block throughout the +-- FX specification. +data QuotedCurrencyPair+instance Eq QuotedCurrencyPair+instance Show QuotedCurrencyPair+instance SchemaType QuotedCurrencyPair+ +-- | The abstract base class for all types which define interest +-- rate streams. +data Rate+instance Eq Rate+instance Show Rate+instance SchemaType Rate+ +-- | Reference to any rate (floating, inflation) derived from +-- the abstract Rate component. +data RateReference+instance Eq RateReference+instance Show RateReference+instance SchemaType RateReference+ +-- | A type defining parameters associated with an individual +-- observation or fixing. This type forms part of the cashflow +-- representation of a stream. +data RateObservation+instance Eq RateObservation+instance Show RateObservation+instance SchemaType RateObservation+ +data RateSourcePage+data RateSourcePageAttributes+instance Eq RateSourcePage+instance Eq RateSourcePageAttributes+instance Show RateSourcePage+instance Show RateSourcePageAttributes+instance SchemaType RateSourcePage+instance Extension RateSourcePage Scheme+ +-- | The abstract base class for all types which define +-- intra-document pointers. +data Reference+instance Eq Reference+instance Show Reference+instance SchemaType Reference+ +-- | Specifies the reference amount using a scheme. +data ReferenceAmount+data ReferenceAmountAttributes+instance Eq ReferenceAmount+instance Eq ReferenceAmountAttributes+instance Show ReferenceAmount+instance Show ReferenceAmountAttributes+instance SchemaType ReferenceAmount+instance Extension ReferenceAmount Scheme+ +-- | A type to describe an institution (party) identified by +-- means of a coding scheme and an optional name. +data ReferenceBank+instance Eq ReferenceBank+instance Show ReferenceBank+instance SchemaType ReferenceBank+ +data ReferenceBankId+data ReferenceBankIdAttributes+instance Eq ReferenceBankId+instance Eq ReferenceBankIdAttributes+instance Show ReferenceBankId+instance Show ReferenceBankIdAttributes+instance SchemaType ReferenceBankId+instance Extension ReferenceBankId Scheme+ +data RelatedBusinessUnit+instance Eq RelatedBusinessUnit+instance Show RelatedBusinessUnit+instance SchemaType RelatedBusinessUnit+ +data RelatedParty+instance Eq RelatedParty+instance Show RelatedParty+instance SchemaType RelatedParty+ +data RelatedPerson+instance Eq RelatedPerson+instance Show RelatedPerson+instance SchemaType RelatedPerson+ +-- | A type describing a role played by a unit in one or more +-- transactions. Examples include roles such as Trader, +-- Collateral, Confirmation, Settlement, etc. This can be +-- extended to provide custom roles. +data BusinessUnitRole+data BusinessUnitRoleAttributes+instance Eq BusinessUnitRole+instance Eq BusinessUnitRoleAttributes+instance Show BusinessUnitRole+instance Show BusinessUnitRoleAttributes+instance SchemaType BusinessUnitRole+instance Extension BusinessUnitRole Scheme+ +-- | A type describing a role played by a person in one or more +-- transactions. Examples include roles such as Trader, +-- Broker, MiddleOffice, Legal, etc. This can be extended to +-- provide custom roles. +data PersonRole+data PersonRoleAttributes+instance Eq PersonRole+instance Eq PersonRoleAttributes+instance Show PersonRole+instance Show PersonRoleAttributes+instance SchemaType PersonRole+instance Extension PersonRole Scheme+ +-- | A type defining a date (referred to as the derived date) as +-- a relative offset from another date (referred to as the +-- anchor date). If the anchor date is itself an adjustable +-- date then the offset is assumed to be calculated from the +-- adjusted anchor date. A number of different scenarios can +-- be supported, namely; 1) the derived date may simply be a +-- number of calendar periods (days, weeks, months or years) +-- preceding or following the anchor date; 2) the unadjusted +-- derived date may be a number of calendar periods (days, +-- weeks, months or years) preceding or following the anchor +-- date with the resulting unadjusted derived date subject to +-- adjustment in accordance with a specified business day +-- convention, i.e. the derived date must fall on a good +-- business day; 3) the derived date may be a number of +-- business days preceding or following the anchor date. Note +-- that the businessDayConvention specifies any required +-- adjustment to the unadjusted derived date. A negative or +-- positive value in the periodMultiplier indicates whether +-- the unadjusted derived precedes or follows the anchor date. +-- The businessDayConvention should contain a value NONE if +-- the day type element contains a value of Business (since +-- specifying a negative or positive business days offset +-- would already guarantee that the derived date would fall on +-- a good business day in the specified business centers). +data RelativeDateOffset+instance Eq RelativeDateOffset+instance Show RelativeDateOffset+instance SchemaType RelativeDateOffset+instance Extension RelativeDateOffset Offset+instance Extension RelativeDateOffset Period+ +-- | A type describing a set of dates defined as relative to +-- another set of dates. +data RelativeDates+instance Eq RelativeDates+instance Show RelativeDates+instance SchemaType RelativeDates+instance Extension RelativeDates RelativeDateOffset+instance Extension RelativeDates Offset+instance Extension RelativeDates Period+ +-- | A type describing a date when this date is defined in +-- reference to another date through one or several date +-- offsets. +data RelativeDateSequence+instance Eq RelativeDateSequence+instance Show RelativeDateSequence+instance SchemaType RelativeDateSequence+ +-- | A date with a required identifier which can be referenced +-- elsewhere. +data RequiredIdentifierDate+data RequiredIdentifierDateAttributes+instance Eq RequiredIdentifierDate+instance Eq RequiredIdentifierDateAttributes+instance Show RequiredIdentifierDate+instance Show RequiredIdentifierDateAttributes+instance SchemaType RequiredIdentifierDate+instance Extension RequiredIdentifierDate Xsd.Date+ +-- | A type defining the reset frequency. In the case of a +-- weekly reset, also specifies the day of the week that the +-- reset occurs. If the reset frequency is greater than the +-- calculation period frequency the this implies that more or +-- more reset dates is established for each calculation period +-- and some form of rate averaginhg is applicable. The +-- specific averaging method of calculation is specified in +-- FloatingRateCalculation. In case the reset frequency is of +-- value T (term), the period is defined by the +-- swap\swapStream\calculationPerioDates\effectiveDate and the +-- swap\swapStream\calculationPerioDates\terminationDate. +data ResetFrequency+instance Eq ResetFrequency+instance Show ResetFrequency+instance SchemaType ResetFrequency+instance Extension ResetFrequency Frequency+ +data RequestedAction+data RequestedActionAttributes+instance Eq RequestedAction+instance Eq RequestedActionAttributes+instance Show RequestedAction+instance Show RequestedActionAttributes+instance SchemaType RequestedAction+instance Extension RequestedAction Scheme+ +-- | Describes the resource that contains the media +-- representation of a business event (i.e used for stating +-- the Publicly Available Information). For example, can +-- describe a file or a URL that represents the event. This +-- type is an extended version of a type defined by RIXML +-- (www.rixml.org). +data Resource+instance Eq Resource+instance Show Resource+instance SchemaType Resource+ +-- | The data type used for resource identifiers. +data ResourceId+data ResourceIdAttributes+instance Eq ResourceId+instance Eq ResourceIdAttributes+instance Show ResourceId+instance Show ResourceIdAttributes+instance SchemaType ResourceId+instance Extension ResourceId Scheme+ +-- | The type that indicates the length of the resource. +data ResourceLength+instance Eq ResourceLength+instance Show ResourceLength+instance SchemaType ResourceLength+ +-- | The data type used for describing the type or purpose of a +-- resource, e.g. "Confirmation". +data ResourceType+data ResourceTypeAttributes+instance Eq ResourceType+instance Eq ResourceTypeAttributes+instance Show ResourceType+instance Show ResourceTypeAttributes+instance SchemaType ResourceType+instance Extension ResourceType Scheme+ +-- | A reference to the return swap notional amount. +data ReturnSwapNotionalAmountReference+instance Eq ReturnSwapNotionalAmountReference+instance Show ReturnSwapNotionalAmountReference+instance SchemaType ReturnSwapNotionalAmountReference+instance Extension ReturnSwapNotionalAmountReference Reference+ +-- | A type defining a rounding direction and precision to be +-- used in the rounding of a rate. +data Rounding+instance Eq Rounding+instance Show Rounding+instance SchemaType Rounding+ +-- | A type that provides three alternative ways of identifying +-- a party involved in the routing of a payment. The +-- identification may use payment system identifiers only; +-- actual name, address and other reference information; or a +-- combination of both. +data Routing+instance Eq Routing+instance Show Routing+instance SchemaType Routing+ +-- | A type that models name, address and supplementary textual +-- information for the purposes of identifying a party +-- involved in the routing of a payment. +data RoutingExplicitDetails+instance Eq RoutingExplicitDetails+instance Show RoutingExplicitDetails+instance SchemaType RoutingExplicitDetails+ +data RoutingId+data RoutingIdAttributes+instance Eq RoutingId+instance Eq RoutingIdAttributes+instance Show RoutingId+instance Show RoutingIdAttributes+instance SchemaType RoutingId+instance Extension RoutingId Scheme+ +-- | A type that provides for identifying a party involved in +-- the routing of a payment by means of one or more standard +-- identification codes. For example, both a SWIFT BIC code +-- and a national bank identifier may be required. +data RoutingIds+instance Eq RoutingIds+instance Show RoutingIds+instance SchemaType RoutingIds+ +-- | A type that provides a combination of payment system +-- identification codes with physical postal address details, +-- for the purposes of identifying a party involved in the +-- routing of a payment. +data RoutingIdsAndExplicitDetails+instance Eq RoutingIdsAndExplicitDetails+instance Show RoutingIdsAndExplicitDetails+instance SchemaType RoutingIdsAndExplicitDetails+ +-- | A type defining a schedule of rates or amounts in terms of +-- an initial value and then a series of step date and value +-- pairs. On each step date the rate or amount changes to the +-- new step value. The series of step date and value pairs are +-- optional. If not specified, this implies that the initial +-- value remains unchanged over time. +data Schedule+instance Eq Schedule+instance Show Schedule+instance SchemaType Schedule+ +-- | Reference to a schedule of rates or amounts. +data ScheduleReference+instance Eq ScheduleReference+instance Show ScheduleReference+instance SchemaType ScheduleReference+instance Extension ScheduleReference Reference+ +-- | A type that represents the choice of methods for settling a +-- potential currency payment resulting from a trade: by means +-- of a standard settlement instruction, by netting it out +-- with other payments, or with an explicit settlement +-- instruction. +data SettlementInformation+instance Eq SettlementInformation+instance Show SettlementInformation+instance SchemaType SettlementInformation+ +-- | A type that models a complete instruction for settling a +-- currency payment, including the settlement method to be +-- used, the correspondent bank, any intermediary banks and +-- the ultimate beneficary. +data SettlementInstruction+instance Eq SettlementInstruction+instance Show SettlementInstruction+instance SchemaType SettlementInstruction+ +data SettlementMethod+data SettlementMethodAttributes+instance Eq SettlementMethod+instance Eq SettlementMethodAttributes+instance Show SettlementMethod+instance Show SettlementMethodAttributes+instance SchemaType SettlementMethod+instance Extension SettlementMethod Scheme+ +-- | Coding scheme that specifies the settlement price default +-- election. +data SettlementPriceDefaultElection+data SettlementPriceDefaultElectionAttributes+instance Eq SettlementPriceDefaultElection+instance Eq SettlementPriceDefaultElectionAttributes+instance Show SettlementPriceDefaultElection+instance Show SettlementPriceDefaultElectionAttributes+instance SchemaType SettlementPriceDefaultElection+instance Extension SettlementPriceDefaultElection Scheme+ +-- | The source from which the settlement price is to be +-- obtained, e.g. a Reuters page, Prezzo di Riferimento, etc. +data SettlementPriceSource+data SettlementPriceSourceAttributes+instance Eq SettlementPriceSource+instance Eq SettlementPriceSourceAttributes+instance Show SettlementPriceSource+instance Show SettlementPriceSourceAttributes+instance SchemaType SettlementPriceSource+instance Extension SettlementPriceSource Scheme+ +-- | A type describing the method for obtaining a settlement +-- rate. +data SettlementRateSource+instance Eq SettlementRateSource+instance Show SettlementRateSource+instance SchemaType SettlementRateSource+ +-- | TBA +data SharedAmericanExercise+instance Eq SharedAmericanExercise+instance Show SharedAmericanExercise+instance SchemaType SharedAmericanExercise+instance Extension SharedAmericanExercise Exercise+ +-- | A complex type to specified payments in a simpler fashion +-- than the Payment type. This construct should be used from +-- the version 4.3 onwards. +data SimplePayment+instance Eq SimplePayment+instance Show SimplePayment+instance SchemaType SimplePayment+instance Extension SimplePayment PaymentBase+ +-- | A type that supports the division of a gross settlement +-- amount into a number of split settlements, each requiring +-- its own settlement instruction. +data SplitSettlement+instance Eq SplitSettlement+instance Show SplitSettlement+instance SchemaType SplitSettlement+ +-- | Adds an optional spread type element to the Schedule to +-- identify a long or short spread value. +data SpreadSchedule+instance Eq SpreadSchedule+instance Show SpreadSchedule+instance SchemaType SpreadSchedule+instance Extension SpreadSchedule Schedule+ +-- | Provides a reference to a spread schedule. +data SpreadScheduleReference+instance Eq SpreadScheduleReference+instance Show SpreadScheduleReference+instance SchemaType SpreadScheduleReference+instance Extension SpreadScheduleReference Reference+ +-- | Defines a Spread Type Scheme to identify a long or short +-- spread value. +data SpreadScheduleType+data SpreadScheduleTypeAttributes+instance Eq SpreadScheduleType+instance Eq SpreadScheduleTypeAttributes+instance Show SpreadScheduleType+instance Show SpreadScheduleTypeAttributes+instance SchemaType SpreadScheduleType+instance Extension SpreadScheduleType Scheme+ +-- | A type defining a step date and step value pair. This step +-- definitions are used to define varying rate or amount +-- schedules, e.g. a notional amortization or a step-up coupon +-- schedule. +data Step+instance Eq Step+instance Show Step+instance SchemaType Step+instance Extension Step StepBase+ +-- | A type defining a step date and step value pair. This step +-- definitions are used to define varying rate or amount +-- schedules, e.g. a notional amortization or a step-up coupon +-- schedule. +data StepBase+instance Eq StepBase+instance Show StepBase+instance SchemaType StepBase+ +-- | A type that describes the set of street and building number +-- information that identifies a postal address within a city. +data StreetAddress+instance Eq StreetAddress+instance Show StreetAddress+instance SchemaType StreetAddress+ +-- | A type describing a single cap or floor rate. +data Strike+instance Eq Strike+instance Show Strike+instance SchemaType Strike+ +-- | A type describing a schedule of cap or floor rates. +data StrikeSchedule+instance Eq StrikeSchedule+instance Show StrikeSchedule+instance SchemaType StrikeSchedule+instance Extension StrikeSchedule Schedule+ +-- | A type defining how a stub calculation period amount is +-- calculated and the start and end date of the stub. A single +-- floating rate tenor different to that used for the regular +-- part of the calculation periods schedule may be specified, +-- or two floating rate tenors many be specified. If two +-- floating rate tenors are specified then Linear +-- Interpolation (in accordance with the 2000 ISDA +-- Definitions, Section 8.3 Interpolation) is assumed to +-- apply. Alternatively, an actual known stub rate or stub +-- amount may be specified. +data Stub+instance Eq Stub+instance Show Stub+instance SchemaType Stub+instance Extension Stub StubValue+ +-- | A type defining how a stub calculation period amount is +-- calculated. A single floating rate tenor different to that +-- used for the regular part of the calculation periods +-- schedule may be specified, or two floating rate tenors many +-- be specified. If two floating rate tenors are specified +-- then Linear Interpolation (in accordance with the 2000 ISDA +-- Definitions, Section 8.3 Interpolation) is assumed to +-- apply. Alternatively, an actual known stub rate or stub +-- amount may be specified. +data StubValue+instance Eq StubValue+instance Show StubValue+instance SchemaType StubValue+ +-- | A geophraphic location for the purposes of defining a +-- prevailing time according to the tz database. +data TimezoneLocation+data TimezoneLocationAttributes+instance Eq TimezoneLocation+instance Eq TimezoneLocationAttributes+instance Show TimezoneLocation+instance Show TimezoneLocationAttributes+instance SchemaType TimezoneLocation+instance Extension TimezoneLocation Scheme+ +-- | The parameters for defining the exercise period for an +-- American style option together with any rules governing the +-- notional amount of the underlying which can be exercised on +-- any given exercise date and any associated exercise fees. +elementAmericanExercise :: XMLParser AmericanExercise+elementToXMLAmericanExercise :: AmericanExercise -> [Content ()]+ +-- | The parameters for defining the exercise period for a +-- Bermuda style option together with any rules governing the +-- notional amount of the underlying which can be exercised on +-- any given exercise date and any associated exercise fees. +elementBermudaExercise :: XMLParser BermudaExercise+elementToXMLBermudaExercise :: BermudaExercise -> [Content ()]+ +-- | The parameters for defining the exercise period for a +-- European style option together with any rules governing the +-- notional amount of the underlying which can be exercised on +-- any given exercise date and any associated exercise fees. +elementEuropeanExercise :: XMLParser EuropeanExercise+elementToXMLEuropeanExercise :: EuropeanExercise -> [Content ()]+ +-- | An placeholder for the actual option exercise definitions. +elementExercise :: XMLParser Exercise+ +elementProduct :: XMLParser Product+elementToXMLProduct :: Product -> [Content ()]+ + + + + + + + + + +-- | A code that describes what type of role an organization +-- plays, for example a SwapsDealer, a Major Swaps +-- Participant, or Other +data OrganizationType+data OrganizationTypeAttributes+instance Eq OrganizationType+instance Eq OrganizationTypeAttributes+instance Show OrganizationType+instance Show OrganizationTypeAttributes+instance SchemaType OrganizationType+instance Extension OrganizationType Xsd.Token+ + + + + + + + +
@@ -0,0 +1,2483 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Shared.EQ+ ( module Data.FpML.V53.Shared.EQ+ , module Data.FpML.V53.Shared.Option+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import Text.XML.HaXml.OneOfN+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import Data.FpML.V53.Shared.Option+ +-- Some hs-boot imports are required, for fwd-declaring types.+import {-# SOURCE #-} Data.FpML.V53.Swaps.Correlation ( CorrelationAmount )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Variance ( VarianceAmount )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Dividend ( FixedPaymentLeg )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Dividend ( DividendLeg )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Correlation ( CorrelationLeg )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Variance ( VarianceLeg )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Dividend ( DividendPeriodPayment )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Correlation ( CorrelationSwap )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Variance ( VarianceSwap )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Return ( EquitySwapTransactionSupplement )+ +-- | A type for defining ISDA 2002 Equity Derivative Additional +-- Disruption Events.+data AdditionalDisruptionEvents = AdditionalDisruptionEvents+ { addDisrupEvents_changeInLaw :: Maybe Xsd.Boolean+ -- ^ If true, then change in law is applicable.+ , addDisrupEvents_failureToDeliver :: Maybe Xsd.Boolean+ -- ^ Where the underlying is shares and the transaction is + -- physically settled, then, if true, a failure to deliver the + -- shares on the settlement date will not be an event of + -- default for the purposes of the master agreement.+ , addDisrupEvents_insolvencyFiling :: Maybe Xsd.Boolean+ -- ^ If true, then insolvency filing is applicable.+ , addDisrupEvents_hedgingDisruption :: Maybe Xsd.Boolean+ -- ^ If true, then hedging disruption is applicable.+ , addDisrupEvents_lossOfStockBorrow :: Maybe Xsd.Boolean+ -- ^ If true, then loss of stock borrow is applicable.+ , addDisrupEvents_maximumStockLoanRate :: Maybe RestrictedPercentage+ -- ^ Specifies the maximum stock loan rate for Loss of Stock + -- Borrow.+ , addDisrupEvents_increasedCostOfStockBorrow :: Maybe Xsd.Boolean+ -- ^ If true, then increased cost of stock borrow is applicable.+ , addDisrupEvents_initialStockLoanRate :: Maybe RestrictedPercentage+ -- ^ Specifies the initial stock loan rate for Increased Cost of + -- Stock Borrow.+ , addDisrupEvents_increasedCostOfHedging :: Maybe Xsd.Boolean+ -- ^ If true, then increased cost of hedging is applicable.+ , addDisrupEvents_determiningPartyReference :: Maybe PartyReference+ -- ^ A reference to the party which determines additional + -- disruption events.+ , addDisrupEvents_foreignOwnershipEvent :: Maybe Xsd.Boolean+ -- ^ If true, then foreign ownership event is applicable.+ }+ deriving (Eq,Show)+instance SchemaType AdditionalDisruptionEvents where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return AdditionalDisruptionEvents+ `apply` optional (parseSchemaType "changeInLaw")+ `apply` optional (parseSchemaType "failureToDeliver")+ `apply` optional (parseSchemaType "insolvencyFiling")+ `apply` optional (parseSchemaType "hedgingDisruption")+ `apply` optional (parseSchemaType "lossOfStockBorrow")+ `apply` optional (parseSchemaType "maximumStockLoanRate")+ `apply` optional (parseSchemaType "increasedCostOfStockBorrow")+ `apply` optional (parseSchemaType "initialStockLoanRate")+ `apply` optional (parseSchemaType "increasedCostOfHedging")+ `apply` optional (parseSchemaType "determiningPartyReference")+ `apply` optional (parseSchemaType "foreignOwnershipEvent")+ schemaTypeToXML s x@AdditionalDisruptionEvents{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "changeInLaw") $ addDisrupEvents_changeInLaw x+ , maybe [] (schemaTypeToXML "failureToDeliver") $ addDisrupEvents_failureToDeliver x+ , maybe [] (schemaTypeToXML "insolvencyFiling") $ addDisrupEvents_insolvencyFiling x+ , maybe [] (schemaTypeToXML "hedgingDisruption") $ addDisrupEvents_hedgingDisruption x+ , maybe [] (schemaTypeToXML "lossOfStockBorrow") $ addDisrupEvents_lossOfStockBorrow x+ , maybe [] (schemaTypeToXML "maximumStockLoanRate") $ addDisrupEvents_maximumStockLoanRate x+ , maybe [] (schemaTypeToXML "increasedCostOfStockBorrow") $ addDisrupEvents_increasedCostOfStockBorrow x+ , maybe [] (schemaTypeToXML "initialStockLoanRate") $ addDisrupEvents_initialStockLoanRate x+ , maybe [] (schemaTypeToXML "increasedCostOfHedging") $ addDisrupEvents_increasedCostOfHedging x+ , maybe [] (schemaTypeToXML "determiningPartyReference") $ addDisrupEvents_determiningPartyReference x+ , maybe [] (schemaTypeToXML "foreignOwnershipEvent") $ addDisrupEvents_foreignOwnershipEvent x+ ]+ +-- | Specifies the amount of the fee along with, when +-- applicable, the formula that supports its determination.+data AdditionalPaymentAmount = AdditionalPaymentAmount+ { addPaymentAmount_paymentAmount :: Maybe NonNegativeMoney+ -- ^ The currency amount of the payment.+ , addPaymentAmount_formula :: Maybe Formula+ -- ^ Specifies a formula, with its description and components.+ }+ deriving (Eq,Show)+instance SchemaType AdditionalPaymentAmount where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return AdditionalPaymentAmount+ `apply` optional (parseSchemaType "paymentAmount")+ `apply` optional (parseSchemaType "formula")+ schemaTypeToXML s x@AdditionalPaymentAmount{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "paymentAmount") $ addPaymentAmount_paymentAmount x+ , maybe [] (schemaTypeToXML "formula") $ addPaymentAmount_formula x+ ]+ +-- | A type describing a date defined as subject to adjustment +-- or defined in reference to another date through one or +-- several date offsets.+data AdjustableDateOrRelativeDateSequence = AdjustableDateOrRelativeDateSequence+ { adords_ID :: Maybe Xsd.ID+ , adords_choice0 :: (Maybe (OneOf2 AdjustableDate RelativeDateSequence))+ -- ^ Choice between:+ -- + -- (1) A date that shall be subject to adjustment if it would + -- otherwise fall on a day that is not a business day in + -- the specified business centers, together with the + -- convention for adjusting the date.+ -- + -- (2) A date specified in relation to some other date defined + -- in the document (the anchor date), where there is the + -- opportunity to specify a combination of offset rules. + -- This component will typically be used for defining the + -- valuation date in relation to the payment date, as both + -- the currency and the exchange holiday calendars need to + -- be considered.+ }+ deriving (Eq,Show)+instance SchemaType AdjustableDateOrRelativeDateSequence where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (AdjustableDateOrRelativeDateSequence a0)+ `apply` optional (oneOf' [ ("AdjustableDate", fmap OneOf2 (parseSchemaType "adjustableDate"))+ , ("RelativeDateSequence", fmap TwoOf2 (parseSchemaType "relativeDateSequence"))+ ])+ schemaTypeToXML s x@AdjustableDateOrRelativeDateSequence{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ adords_ID x+ ]+ [ maybe [] (foldOneOf2 (schemaTypeToXML "adjustableDate")+ (schemaTypeToXML "relativeDateSequence")+ ) $ adords_choice0 x+ ]+ +-- | A type describing correlation bounds, which form a cap and +-- a floor on the realized correlation.+data BoundedCorrelation = BoundedCorrelation+ { boundedCorrel_minimumBoundaryPercent :: Maybe Xsd.Decimal+ -- ^ Minimum Boundary as a percentage of the Strike Price.+ , boundedCorrel_maximumBoundaryPercent :: Maybe Xsd.Decimal+ -- ^ Maximum Boundary as a percentage of the Strike Price.+ }+ deriving (Eq,Show)+instance SchemaType BoundedCorrelation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return BoundedCorrelation+ `apply` optional (parseSchemaType "minimumBoundaryPercent")+ `apply` optional (parseSchemaType "maximumBoundaryPercent")+ schemaTypeToXML s x@BoundedCorrelation{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "minimumBoundaryPercent") $ boundedCorrel_minimumBoundaryPercent x+ , maybe [] (schemaTypeToXML "maximumBoundaryPercent") $ boundedCorrel_maximumBoundaryPercent x+ ]+ +-- | A type describing variance bounds, which are used to +-- exclude money price values outside of the specified range +-- In a Up Conditional Swap Underlyer price must be equal to +-- or higher than Lower Barrier In a Down Conditional Swap +-- Underlyer price must be equal to or lower than Upper +-- Barrier In a Corridor Conditional Swap Underlyer price must +-- be equal to or higher than Lower Barrier and must be equal +-- to or lower than Upper Barrier.+data BoundedVariance = BoundedVariance+ { boundedVarian_realisedVarianceMethod :: Maybe RealisedVarianceMethodEnum+ -- ^ The contract specifies whether which price must satisfy the + -- boundary condition.+ , boundedVarian_daysInRangeAdjustment :: Maybe Xsd.Boolean+ -- ^ The contract specifies whether the notional should be + -- scaled by the Number of Days in Range divided by the + -- Expected N. The number of Days in Ranges refers to the + -- number of returns that contribute to the realized + -- volatility.+ , boundedVarian_upperBarrier :: Maybe NonNegativeDecimal+ -- ^ All observations above this price level will be excluded + -- from the variance calculation.+ , boundedVarian_lowerBarrier :: Maybe NonNegativeDecimal+ -- ^ All observations below this price level will be excluded + -- from the variance calculation.+ }+ deriving (Eq,Show)+instance SchemaType BoundedVariance where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return BoundedVariance+ `apply` optional (parseSchemaType "realisedVarianceMethod")+ `apply` optional (parseSchemaType "daysInRangeAdjustment")+ `apply` optional (parseSchemaType "upperBarrier")+ `apply` optional (parseSchemaType "lowerBarrier")+ schemaTypeToXML s x@BoundedVariance{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "realisedVarianceMethod") $ boundedVarian_realisedVarianceMethod x+ , maybe [] (schemaTypeToXML "daysInRangeAdjustment") $ boundedVarian_daysInRangeAdjustment x+ , maybe [] (schemaTypeToXML "upperBarrier") $ boundedVarian_upperBarrier x+ , maybe [] (schemaTypeToXML "lowerBarrier") $ boundedVarian_lowerBarrier x+ ]+ +-- | An abstract base class for all calculated money amounts, +-- which are in the currency of the cash multiplier of the +-- calculation.+data CalculatedAmount+ = CalculatedAmount_CorrelationAmount CorrelationAmount+ | CalculatedAmount_VarianceAmount VarianceAmount+ + deriving (Eq,Show)+instance SchemaType CalculatedAmount where+ parseSchemaType s = do+ (fmap CalculatedAmount_CorrelationAmount $ parseSchemaType s)+ `onFail`+ (fmap CalculatedAmount_VarianceAmount $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of CalculatedAmount,\n\+\ namely one of:\n\+\CorrelationAmount,VarianceAmount"+ schemaTypeToXML _s (CalculatedAmount_CorrelationAmount x) = schemaTypeToXML "correlationAmount" x+ schemaTypeToXML _s (CalculatedAmount_VarianceAmount x) = schemaTypeToXML "varianceAmount" x+ +-- | Abstract base class for all calculation from observed +-- values.+data CalculationFromObservation+ = CalculationFromObservation_Variance Variance+ | CalculationFromObservation_Correlation Correlation+ + deriving (Eq,Show)+instance SchemaType CalculationFromObservation where+ parseSchemaType s = do+ (fmap CalculationFromObservation_Variance $ parseSchemaType s)+ `onFail`+ (fmap CalculationFromObservation_Correlation $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of CalculationFromObservation,\n\+\ namely one of:\n\+\Variance,Correlation"+ schemaTypeToXML _s (CalculationFromObservation_Variance x) = schemaTypeToXML "variance" x+ schemaTypeToXML _s (CalculationFromObservation_Correlation x) = schemaTypeToXML "correlation" x+ +-- | Specifies the compounding method and the compounding rate.+data Compounding = Compounding+ { compounding_method :: Maybe CompoundingMethodEnum+ -- ^ If more that one calculation period contributes to a single + -- payment amount this element specifies whether compounding + -- is applicable, and if so, what compounding method is to be + -- used. This element must only be included when more that one + -- calculation period contributes to a single payment amount.+ , compounding_rate :: Maybe CompoundingRate+ -- ^ Defines a compounding rate. The compounding interest can + -- either point back to the interest calculation node on the + -- Interest Leg, or be defined specifically.+ , compounding_spread :: Maybe Xsd.Decimal+ -- ^ Defines the spread to be used for compounding. This field + -- should be used in scenarios where the interest payment is + -- based on a compounding formula that uses a compounding + -- spread in addition to the regular spread.+ , compounding_dates :: Maybe AdjustableRelativeOrPeriodicDates2+ -- ^ Defines the compounding dates.+ }+ deriving (Eq,Show)+instance SchemaType Compounding where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Compounding+ `apply` optional (parseSchemaType "compoundingMethod")+ `apply` optional (parseSchemaType "compoundingRate")+ `apply` optional (parseSchemaType "compoundingSpread")+ `apply` optional (parseSchemaType "compoundingDates")+ schemaTypeToXML s x@Compounding{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "compoundingMethod") $ compounding_method x+ , maybe [] (schemaTypeToXML "compoundingRate") $ compounding_rate x+ , maybe [] (schemaTypeToXML "compoundingSpread") $ compounding_spread x+ , maybe [] (schemaTypeToXML "compoundingDates") $ compounding_dates x+ ]+ +-- | A type defining a compounding rate. The compounding +-- interest can either point back to the floating rate +-- calculation of interest calculation node on the Interest +-- Leg, or be defined specifically.+data CompoundingRate = CompoundingRate+ { compoRate_choice0 :: (Maybe (OneOf2 FloatingRateCalculationReference InterestAccrualsMethod))+ -- ^ Choice between:+ -- + -- (1) Reference to the floating rate calculation of interest + -- calculation node on the Interest Leg.+ -- + -- (2) Defines a specific rate.+ }+ deriving (Eq,Show)+instance SchemaType CompoundingRate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CompoundingRate+ `apply` optional (oneOf' [ ("FloatingRateCalculationReference", fmap OneOf2 (parseSchemaType "interestLegRate"))+ , ("InterestAccrualsMethod", fmap TwoOf2 (parseSchemaType "specificRate"))+ ])+ schemaTypeToXML s x@CompoundingRate{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "interestLegRate")+ (schemaTypeToXML "specificRate")+ ) $ compoRate_choice0 x+ ]+ +-- | A type describing the correlation amount of a correlation +-- swap.+data Correlation = Correlation+ { correlation_choice0 :: (Maybe (OneOf3 Xsd.Decimal Xsd.Boolean Xsd.Boolean))+ -- ^ Choice between:+ -- + -- (1) Contract will strike off this initial level.+ -- + -- (2) If true this contract will strike off the closing level + -- of the default exchange traded contract.+ -- + -- (3) If true this contract will strike off the expiring + -- level of the default exchange traded contract.+ , correlation_expectedN :: Maybe Xsd.PositiveInteger+ -- ^ Expected number of trading days.+ , correlation_notionalAmount :: Maybe NonNegativeMoney+ -- ^ Notional amount, which is a cash multiplier.+ , correlation_strikePrice :: Maybe CorrelationValue+ -- ^ Correlation Strike Price.+ , correlation_boundedCorrelation :: Maybe BoundedCorrelation+ -- ^ Bounded Correlation.+ , correlation_numberOfDataSeries :: Maybe Xsd.PositiveInteger+ -- ^ Number of data series, normal market practice is that + -- correlation data sets are drawn from geographic market + -- areas, such as America, Europe and Asia Pacific, each of + -- these geographic areas will have its own data series to + -- avoid contagion.+ }+ deriving (Eq,Show)+instance SchemaType Correlation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Correlation+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf3 (parseSchemaType "initialLevel"))+ , ("Xsd.Boolean", fmap TwoOf3 (parseSchemaType "closingLevel"))+ , ("Xsd.Boolean", fmap ThreeOf3 (parseSchemaType "expiringLevel"))+ ])+ `apply` optional (parseSchemaType "expectedN")+ `apply` optional (parseSchemaType "notionalAmount")+ `apply` optional (parseSchemaType "correlationStrikePrice")+ `apply` optional (parseSchemaType "boundedCorrelation")+ `apply` optional (parseSchemaType "numberOfDataSeries")+ schemaTypeToXML s x@Correlation{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "initialLevel")+ (schemaTypeToXML "closingLevel")+ (schemaTypeToXML "expiringLevel")+ ) $ correlation_choice0 x+ , maybe [] (schemaTypeToXML "expectedN") $ correlation_expectedN x+ , maybe [] (schemaTypeToXML "notionalAmount") $ correlation_notionalAmount x+ , maybe [] (schemaTypeToXML "correlationStrikePrice") $ correlation_strikePrice x+ , maybe [] (schemaTypeToXML "boundedCorrelation") $ correlation_boundedCorrelation x+ , maybe [] (schemaTypeToXML "numberOfDataSeries") $ correlation_numberOfDataSeries x+ ]+instance Extension Correlation CalculationFromObservation where+ supertype v = CalculationFromObservation_Correlation v+ +-- | An abstract base class for all directional leg types with +-- effective date, termination date, where a payer makes a +-- stream of payments of greater than zero value to a +-- receiver.+data DirectionalLeg+ = DirectionalLeg_ReturnSwapLegUnderlyer ReturnSwapLegUnderlyer+ | DirectionalLeg_InterestLeg InterestLeg+ | DirectionalLeg_DirectionalLegUnderlyer DirectionalLegUnderlyer+ | DirectionalLeg_FixedPaymentLeg FixedPaymentLeg+ + deriving (Eq,Show)+instance SchemaType DirectionalLeg where+ parseSchemaType s = do+ (fmap DirectionalLeg_ReturnSwapLegUnderlyer $ parseSchemaType s)+ `onFail`+ (fmap DirectionalLeg_InterestLeg $ parseSchemaType s)+ `onFail`+ (fmap DirectionalLeg_DirectionalLegUnderlyer $ parseSchemaType s)+ `onFail`+ (fmap DirectionalLeg_FixedPaymentLeg $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of DirectionalLeg,\n\+\ namely one of:\n\+\ReturnSwapLegUnderlyer,InterestLeg,DirectionalLegUnderlyer,FixedPaymentLeg"+ schemaTypeToXML _s (DirectionalLeg_ReturnSwapLegUnderlyer x) = schemaTypeToXML "returnSwapLegUnderlyer" x+ schemaTypeToXML _s (DirectionalLeg_InterestLeg x) = schemaTypeToXML "interestLeg" x+ schemaTypeToXML _s (DirectionalLeg_DirectionalLegUnderlyer x) = schemaTypeToXML "directionalLegUnderlyer" x+ schemaTypeToXML _s (DirectionalLeg_FixedPaymentLeg x) = schemaTypeToXML "fixedPaymentLeg" x+instance Extension DirectionalLeg Leg where+ supertype v = Leg_DirectionalLeg v+ +-- | An abstract base class for all directional leg types with +-- effective date, termination date, and underlyer where a +-- payer makes a stream of payments of greater than zero value +-- to a receiver.+data DirectionalLegUnderlyer+ = DirectionalLegUnderlyer_DirectionalLegUnderlyerValuation DirectionalLegUnderlyerValuation+ | DirectionalLegUnderlyer_DividendLeg DividendLeg+ + deriving (Eq,Show)+instance SchemaType DirectionalLegUnderlyer where+ parseSchemaType s = do+ (fmap DirectionalLegUnderlyer_DirectionalLegUnderlyerValuation $ parseSchemaType s)+ `onFail`+ (fmap DirectionalLegUnderlyer_DividendLeg $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of DirectionalLegUnderlyer,\n\+\ namely one of:\n\+\DirectionalLegUnderlyerValuation,DividendLeg"+ schemaTypeToXML _s (DirectionalLegUnderlyer_DirectionalLegUnderlyerValuation x) = schemaTypeToXML "directionalLegUnderlyerValuation" x+ schemaTypeToXML _s (DirectionalLegUnderlyer_DividendLeg x) = schemaTypeToXML "dividendLeg" x+instance Extension DirectionalLegUnderlyer DirectionalLeg where+ supertype v = DirectionalLeg_DirectionalLegUnderlyer v+ +-- | An abstract base class for all directional leg types with +-- effective date, termination date, and underlyer, where a +-- payer makes a stream of payments of greater than zero value +-- to a receiver.+data DirectionalLegUnderlyerValuation+ = DirectionalLegUnderlyerValuation_CorrelationLeg CorrelationLeg+ | DirectionalLegUnderlyerValuation_VarianceLeg VarianceLeg+ + deriving (Eq,Show)+instance SchemaType DirectionalLegUnderlyerValuation where+ parseSchemaType s = do+ (fmap DirectionalLegUnderlyerValuation_CorrelationLeg $ parseSchemaType s)+ `onFail`+ (fmap DirectionalLegUnderlyerValuation_VarianceLeg $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of DirectionalLegUnderlyerValuation,\n\+\ namely one of:\n\+\CorrelationLeg,VarianceLeg"+ schemaTypeToXML _s (DirectionalLegUnderlyerValuation_CorrelationLeg x) = schemaTypeToXML "correlationLeg" x+ schemaTypeToXML _s (DirectionalLegUnderlyerValuation_VarianceLeg x) = schemaTypeToXML "varianceLeg" x+instance Extension DirectionalLegUnderlyerValuation DirectionalLegUnderlyer where+ supertype v = DirectionalLegUnderlyer_DirectionalLegUnderlyerValuation v+ +-- | Container for Dividend Adjustment Periods, which are used +-- to calculate the Deviation between Expected Dividend and +-- Actual Dividend in that Period.+data DividendAdjustment = DividendAdjustment+ { dividAdjust_dividendPeriod :: [DividendPeriodDividend]+ -- ^ A single Dividend Adjustment Period.+ }+ deriving (Eq,Show)+instance SchemaType DividendAdjustment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DividendAdjustment+ `apply` many (parseSchemaType "dividendPeriod")+ schemaTypeToXML s x@DividendAdjustment{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "dividendPeriod") $ dividAdjust_dividendPeriod x+ ]+ +-- | A type describing the conditions governing the payment of +-- dividends to the receiver of the equity return. With the +-- exception of the dividend payout ratio, which is defined +-- for each of the underlying components.+data DividendConditions = DividendConditions+ { dividCondit_dividendReinvestment :: Maybe Xsd.Boolean+ -- ^ Boolean element that defines whether the dividend will be + -- reinvested or not.+ , dividCondit_dividendEntitlement :: Maybe DividendEntitlementEnum+ -- ^ Defines the date on which the receiver on the equity return + -- is entitled to the dividend.+ , dividCondit_dividendAmount :: Maybe DividendAmountTypeEnum+ , dividCondit_dividendPaymentDate :: Maybe DividendPaymentDate+ -- ^ Specifies when the dividend will be paid to the receiver of + -- the equity return. Has the meaning as defined in the ISDA + -- 2002 Equity Derivatives Definitions. Is not applicable in + -- the case of a dividend reinvestment election.+ , dividCondit_choice4 :: (Maybe (OneOf2 ((Maybe (DateReference)),(Maybe (DateReference))) DividendPeriodEnum))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * Dividend period has the meaning as defined in the + -- ISDA 2002 Equity Derivatives Definitions. This + -- element specifies the date on which the dividend + -- period will commence.+ -- + -- * Dividend period has the meaning as defined in the + -- ISDA 2002 Equity Derivatives Definitions. This + -- element specifies the date on which the dividend + -- period will end. It includes a boolean attribute + -- for defining whether this end date is included or + -- excluded from the dividend period.+ -- + -- (2) Defines the First Period or the Second Period, as + -- defined in the 2002 ISDA Equity Derivatives + -- Definitions.+ , dividCondit_extraOrdinaryDividends :: Maybe PartyReference+ -- ^ Reference to the party which determines if dividends are + -- extraordinary in relation to normal levels.+ , dividCondit_excessDividendAmount :: Maybe DividendAmountTypeEnum+ -- ^ Determination of Gross Cash Dividend per Share.+ , dividCondit_choice7 :: (Maybe (OneOf3 IdentifiedCurrency DeterminationMethod IdentifiedCurrencyReference))+ -- ^ Choice between:+ -- + -- (1) The currency in which an amount is denominated.+ -- + -- (2) Specifies the method according to which an amount or a + -- date is determined.+ -- + -- (3) Reference to a currency defined elsewhere in the + -- document+ , dividCondit_dividendFxTriggerDate :: Maybe DividendPaymentDate+ -- ^ Specifies the date on which the FX rate will be considered + -- in the case of a Composite FX swap.+ , dividCondit_interestAccrualsMethod :: Maybe InterestAccrualsCompoundingMethod+ , dividCondit_numberOfIndexUnits :: Maybe NonNegativeDecimal+ -- ^ Defines the Number Of Index Units applicable to a Dividend.+ , dividCondit_declaredCashDividendPercentage :: Maybe NonNegativeDecimal+ -- ^ Declared Cash Dividend Percentage.+ , dividCondit_declaredCashEquivalentDividendPercentage :: Maybe NonNegativeDecimal+ -- ^ Declared Cash Equivalent Dividend Percentage.+ , dividCondit_nonCashDividendTreatment :: Maybe NonCashDividendTreatmentEnum+ -- ^ Defines treatment of Non-Cash Dividends.+ , dividCondit_dividendComposition :: Maybe DividendCompositionEnum+ -- ^ Defines how the composition of Dividends is to be + -- determined.+ , dividCondit_specialDividends :: Maybe Xsd.Boolean+ -- ^ Specifies the method according to which special dividends + -- are determined.+ }+ deriving (Eq,Show)+instance SchemaType DividendConditions where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DividendConditions+ `apply` optional (parseSchemaType "dividendReinvestment")+ `apply` optional (parseSchemaType "dividendEntitlement")+ `apply` optional (parseSchemaType "dividendAmount")+ `apply` optional (parseSchemaType "dividendPaymentDate")+ `apply` optional (oneOf' [ ("Maybe DateReference Maybe DateReference", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "dividendPeriodEffectiveDate")+ `apply` optional (parseSchemaType "dividendPeriodEndDate")))+ , ("DividendPeriodEnum", fmap TwoOf2 (parseSchemaType "dividendPeriod"))+ ])+ `apply` optional (parseSchemaType "extraOrdinaryDividends")+ `apply` optional (parseSchemaType "excessDividendAmount")+ `apply` optional (oneOf' [ ("IdentifiedCurrency", fmap OneOf3 (parseSchemaType "currency"))+ , ("DeterminationMethod", fmap TwoOf3 (parseSchemaType "determinationMethod"))+ , ("IdentifiedCurrencyReference", fmap ThreeOf3 (parseSchemaType "currencyReference"))+ ])+ `apply` optional (parseSchemaType "dividendFxTriggerDate")+ `apply` optional (parseSchemaType "interestAccrualsMethod")+ `apply` optional (parseSchemaType "numberOfIndexUnits")+ `apply` optional (parseSchemaType "declaredCashDividendPercentage")+ `apply` optional (parseSchemaType "declaredCashEquivalentDividendPercentage")+ `apply` optional (parseSchemaType "nonCashDividendTreatment")+ `apply` optional (parseSchemaType "dividendComposition")+ `apply` optional (parseSchemaType "specialDividends")+ schemaTypeToXML s x@DividendConditions{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "dividendReinvestment") $ dividCondit_dividendReinvestment x+ , maybe [] (schemaTypeToXML "dividendEntitlement") $ dividCondit_dividendEntitlement x+ , maybe [] (schemaTypeToXML "dividendAmount") $ dividCondit_dividendAmount x+ , maybe [] (schemaTypeToXML "dividendPaymentDate") $ dividCondit_dividendPaymentDate x+ , maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "dividendPeriodEffectiveDate") a+ , maybe [] (schemaTypeToXML "dividendPeriodEndDate") b+ ])+ (schemaTypeToXML "dividendPeriod")+ ) $ dividCondit_choice4 x+ , maybe [] (schemaTypeToXML "extraOrdinaryDividends") $ dividCondit_extraOrdinaryDividends x+ , maybe [] (schemaTypeToXML "excessDividendAmount") $ dividCondit_excessDividendAmount x+ , maybe [] (foldOneOf3 (schemaTypeToXML "currency")+ (schemaTypeToXML "determinationMethod")+ (schemaTypeToXML "currencyReference")+ ) $ dividCondit_choice7 x+ , maybe [] (schemaTypeToXML "dividendFxTriggerDate") $ dividCondit_dividendFxTriggerDate x+ , maybe [] (schemaTypeToXML "interestAccrualsMethod") $ dividCondit_interestAccrualsMethod x+ , maybe [] (schemaTypeToXML "numberOfIndexUnits") $ dividCondit_numberOfIndexUnits x+ , maybe [] (schemaTypeToXML "declaredCashDividendPercentage") $ dividCondit_declaredCashDividendPercentage x+ , maybe [] (schemaTypeToXML "declaredCashEquivalentDividendPercentage") $ dividCondit_declaredCashEquivalentDividendPercentage x+ , maybe [] (schemaTypeToXML "nonCashDividendTreatment") $ dividCondit_nonCashDividendTreatment x+ , maybe [] (schemaTypeToXML "dividendComposition") $ dividCondit_dividendComposition x+ , maybe [] (schemaTypeToXML "specialDividends") $ dividCondit_specialDividends x+ ]+ +-- | A type describing the date on which the dividend will be +-- paid/received. This type is also used to specify the date +-- on which the FX rate will be determined, when applicable.+data DividendPaymentDate = DividendPaymentDate+ { dividPaymentDate_choice0 :: (Maybe (OneOf2 ((Maybe (DividendDateReferenceEnum)),(Maybe (Offset))) AdjustableDate))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * Specification of the dividend date using an + -- enumeration, with values such as the pay date, the + -- ex date or the record date.+ -- + -- * Only to be used when SharePayment has been + -- specified in the dividendDateReference element. The + -- number of Currency Business Days following the day + -- on which the Issuer of the Shares pays the relevant + -- dividend to holders of record of the Shares.+ -- + -- (2) A date that shall be subject to adjustment if it would + -- otherwise fall on a day that is not a business day in + -- the specified business centers, together with the + -- convention for adjusting the date.+ }+ deriving (Eq,Show)+instance SchemaType DividendPaymentDate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DividendPaymentDate+ `apply` optional (oneOf' [ ("Maybe DividendDateReferenceEnum Maybe Offset", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "dividendDateReference")+ `apply` optional (parseSchemaType "paymentDateOffset")))+ , ("AdjustableDate", fmap TwoOf2 (parseSchemaType "adjustableDate"))+ ])+ schemaTypeToXML s x@DividendPaymentDate{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "dividendDateReference") a+ , maybe [] (schemaTypeToXML "paymentDateOffset") b+ ])+ (schemaTypeToXML "adjustableDate")+ ) $ dividPaymentDate_choice0 x+ ]+ +-- | Abstract base class of all time bounded dividend period +-- types.+data DividendPeriod+ = DividendPeriod_DividendPeriodDividend DividendPeriodDividend+ | DividendPeriod_DividendPeriodPayment DividendPeriodPayment+ + deriving (Eq,Show)+instance SchemaType DividendPeriod where+ parseSchemaType s = do+ (fmap DividendPeriod_DividendPeriodDividend $ parseSchemaType s)+ `onFail`+ (fmap DividendPeriod_DividendPeriodPayment $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of DividendPeriod,\n\+\ namely one of:\n\+\DividendPeriodDividend,DividendPeriodPayment"+ schemaTypeToXML _s (DividendPeriod_DividendPeriodDividend x) = schemaTypeToXML "dividendPeriodDividend" x+ schemaTypeToXML _s (DividendPeriod_DividendPeriodPayment x) = schemaTypeToXML "dividendPeriodPayment" x+ +-- | A time bounded dividend period, with an expected dividend +-- for each period.+data DividendPeriodDividend = DividendPeriodDividend+ { dividPeriodDivid_ID :: Maybe Xsd.ID+ , dividPeriodDivid_unadjustedStartDate :: Maybe IdentifiedDate+ -- ^ Unadjusted inclusive dividend period start date.+ , dividPeriodDivid_unadjustedEndDate :: Maybe IdentifiedDate+ -- ^ Unadjusted inclusive dividend period end date.+ , dividPeriodDivid_dateAdjustments :: Maybe BusinessDayAdjustments+ -- ^ Date adjustments for all unadjusted dates in this dividend + -- period.+ , dividPeriodDivid_underlyerReference :: Maybe AssetReference+ -- ^ Reference to the underlyer which is paying dividends. This + -- should be used in all cases, and must be used where there + -- are multiple underlying assets, to avoid any ambiguity + -- about which asset the dividend period relates to.+ , dividPeriodDivid_dividend :: Maybe NonNegativeMoney+ -- ^ Expected dividend in this period.+ , dividPeriodDivid_multiplier :: Maybe PositiveDecimal+ -- ^ Multiplier is a percentage value which is used to produce + -- Deviation by multiplying the difference between Expected + -- Dividend and Actual Dividend Deviation = Multiplier * + -- (Expected Dividend — Actual Dividend).+ }+ deriving (Eq,Show)+instance SchemaType DividendPeriodDividend where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (DividendPeriodDividend a0)+ `apply` optional (parseSchemaType "unadjustedStartDate")+ `apply` optional (parseSchemaType "unadjustedEndDate")+ `apply` optional (parseSchemaType "dateAdjustments")+ `apply` optional (parseSchemaType "underlyerReference")+ `apply` optional (parseSchemaType "dividend")+ `apply` optional (parseSchemaType "multiplier")+ schemaTypeToXML s x@DividendPeriodDividend{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ dividPeriodDivid_ID x+ ]+ [ maybe [] (schemaTypeToXML "unadjustedStartDate") $ dividPeriodDivid_unadjustedStartDate x+ , maybe [] (schemaTypeToXML "unadjustedEndDate") $ dividPeriodDivid_unadjustedEndDate x+ , maybe [] (schemaTypeToXML "dateAdjustments") $ dividPeriodDivid_dateAdjustments x+ , maybe [] (schemaTypeToXML "underlyerReference") $ dividPeriodDivid_underlyerReference x+ , maybe [] (schemaTypeToXML "dividend") $ dividPeriodDivid_dividend x+ , maybe [] (schemaTypeToXML "multiplier") $ dividPeriodDivid_multiplier x+ ]+instance Extension DividendPeriodDividend DividendPeriod where+ supertype v = DividendPeriod_DividendPeriodDividend v+ +-- | A type for defining the merger events and their treatment.+data EquityCorporateEvents = EquityCorporateEvents+ { equityCorporEvents_shareForShare :: Maybe ShareExtraordinaryEventEnum+ -- ^ The consideration paid for the original shares following + -- the Merger Event consists wholly of new shares.+ , equityCorporEvents_shareForOther :: Maybe ShareExtraordinaryEventEnum+ -- ^ The consideration paid for the original shares following + -- the Merger Event consists wholly of cash/securities other + -- than new shares.+ , equityCorporEvents_shareForCombined :: Maybe ShareExtraordinaryEventEnum+ -- ^ The consideration paid for the original shares following + -- the Merger Event consists of both cash/securities and new + -- shares.+ }+ deriving (Eq,Show)+instance SchemaType EquityCorporateEvents where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return EquityCorporateEvents+ `apply` optional (parseSchemaType "shareForShare")+ `apply` optional (parseSchemaType "shareForOther")+ `apply` optional (parseSchemaType "shareForCombined")+ schemaTypeToXML s x@EquityCorporateEvents{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "shareForShare") $ equityCorporEvents_shareForShare x+ , maybe [] (schemaTypeToXML "shareForOther") $ equityCorporEvents_shareForOther x+ , maybe [] (schemaTypeToXML "shareForCombined") $ equityCorporEvents_shareForCombined x+ ]+ +-- | A type used to describe the amount paid for an equity +-- option.+data EquityPremium = EquityPremium+ { equityPremium_ID :: Maybe Xsd.ID+ , equityPremium_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , equityPremium_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , equityPremium_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , equityPremium_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , equityPremium_premiumType :: Maybe PremiumTypeEnum+ -- ^ Forward start Premium type+ , equityPremium_paymentAmount :: Maybe NonNegativeMoney+ -- ^ The currency amount of the payment.+ , equityPremium_paymentDate :: Maybe AdjustableDate+ -- ^ The payment date. This date is subject to adjustment in + -- accordance with any applicable business day convention.+ , equityPremium_swapPremium :: Maybe Xsd.Boolean+ -- ^ Specifies whether or not the premium is to be paid in the + -- style of payments under an interest rate swap contract.+ , equityPremium_pricePerOption :: Maybe NonNegativeMoney+ -- ^ The amount of premium to be paid expressed as a function of + -- the number of options.+ , equityPremium_percentageOfNotional :: Maybe NonNegativeDecimal+ -- ^ The amount of premium to be paid expressed as a percentage + -- of the notional value of the transaction. A percentage of + -- 5% would be expressed as 0.05.+ }+ deriving (Eq,Show)+instance SchemaType EquityPremium where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (EquityPremium a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "premiumType")+ `apply` optional (parseSchemaType "paymentAmount")+ `apply` optional (parseSchemaType "paymentDate")+ `apply` optional (parseSchemaType "swapPremium")+ `apply` optional (parseSchemaType "pricePerOption")+ `apply` optional (parseSchemaType "percentageOfNotional")+ schemaTypeToXML s x@EquityPremium{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ equityPremium_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ equityPremium_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ equityPremium_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ equityPremium_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ equityPremium_receiverAccountReference x+ , maybe [] (schemaTypeToXML "premiumType") $ equityPremium_premiumType x+ , maybe [] (schemaTypeToXML "paymentAmount") $ equityPremium_paymentAmount x+ , maybe [] (schemaTypeToXML "paymentDate") $ equityPremium_paymentDate x+ , maybe [] (schemaTypeToXML "swapPremium") $ equityPremium_swapPremium x+ , maybe [] (schemaTypeToXML "pricePerOption") $ equityPremium_pricePerOption x+ , maybe [] (schemaTypeToXML "percentageOfNotional") $ equityPremium_percentageOfNotional x+ ]+instance Extension EquityPremium PaymentBase where+ supertype v = PaymentBase_EquityPremium v+ +-- | A type for defining the strike price for an equity option. +-- The strike price is either: (i) in respect of an index +-- option transaction, the level of the relevant index +-- specified or otherwise determined in the transaction; or +-- (ii) in respect of a share option transaction, the price +-- per share specified or otherwise determined in the +-- transaction. This can be expressed either as a percentage +-- of notional amount or as an absolute value.+data EquityStrike = EquityStrike+ { equityStrike_choice0 :: (Maybe (OneOf2 Xsd.Decimal ((Maybe (Xsd.Decimal)),(Maybe (AdjustableOrRelativeDate)))))+ -- ^ Choice between:+ -- + -- (1) The price or level at which the option has been struck.+ -- + -- (2) Sequence of:+ -- + -- * The price or level expressed as a percentage of the + -- forward starting spot price.+ -- + -- * The date on which the strike is determined, where + -- this is not the effective date of a forward + -- starting option.+ , equityStrike_currency :: Maybe Currency+ -- ^ The currency in which an amount is denominated.+ }+ deriving (Eq,Show)+instance SchemaType EquityStrike where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return EquityStrike+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "strikePrice"))+ , ("Maybe Xsd.Decimal Maybe AdjustableOrRelativeDate", fmap TwoOf2 (return (,) `apply` optional (parseSchemaType "strikePercentage")+ `apply` optional (parseSchemaType "strikeDeterminationDate")))+ ])+ `apply` optional (parseSchemaType "currency")+ schemaTypeToXML s x@EquityStrike{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "strikePrice")+ (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "strikePercentage") a+ , maybe [] (schemaTypeToXML "strikeDeterminationDate") b+ ])+ ) $ equityStrike_choice0 x+ , maybe [] (schemaTypeToXML "currency") $ equityStrike_currency x+ ]+ +-- | A type for defining how and when an equity option is to be +-- valued.+data EquityValuation = EquityValuation+ { equityVal_ID :: Maybe Xsd.ID+ , equityVal_choice0 :: (Maybe (OneOf2 AdjustableDateOrRelativeDateSequence AdjustableRelativeOrPeriodicDates))+ -- ^ Choice between:+ -- + -- (1) The term "Valuation Date" is assumed to have the + -- meaning as defined in the ISDA 2002 Equity Derivatives + -- Definitions.+ -- + -- (2) Specifies the interim equity valuation dates of a swap.+ , equityVal_valuationTimeType :: Maybe TimeTypeEnum+ -- ^ The time of day at which the calculation agent values the + -- underlying, for example the official closing time of the + -- exchange.+ , equityVal_valuationTime :: Maybe BusinessCenterTime+ -- ^ The specific time of day at which the calculation agent + -- values the underlying.+ , equityVal_futuresPriceValuation :: Maybe Xsd.Boolean+ -- ^ The official settlement price as announced by the related + -- exchange is applicable, in accordance with the ISDA 2002 + -- definitions.+ , equityVal_optionsPriceValuation :: Maybe Xsd.Boolean+ -- ^ The official settlement price as announced by the related + -- exchange is applicable, in accordance with the ISDA 2002 + -- definitions.+ , equityVal_numberOfValuationDates :: Maybe Xsd.NonNegativeInteger+ -- ^ The number of valuation dates between valuation start date + -- and valuation end date.+ , equityVal_dividendValuationDates :: Maybe AdjustableRelativeOrPeriodicDates+ -- ^ Specifies the dividend valuation dates of the swap.+ , equityVal_fPVFinalPriceElectionFallback :: Maybe FPVFinalPriceElectionFallbackEnum+ -- ^ Specifies the fallback provisions for Hedging Party in the + -- determination of the Final Price.+ }+ deriving (Eq,Show)+instance SchemaType EquityValuation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (EquityValuation a0)+ `apply` optional (oneOf' [ ("AdjustableDateOrRelativeDateSequence", fmap OneOf2 (parseSchemaType "valuationDate"))+ , ("AdjustableRelativeOrPeriodicDates", fmap TwoOf2 (parseSchemaType "valuationDates"))+ ])+ `apply` optional (parseSchemaType "valuationTimeType")+ `apply` optional (parseSchemaType "valuationTime")+ `apply` optional (parseSchemaType "futuresPriceValuation")+ `apply` optional (parseSchemaType "optionsPriceValuation")+ `apply` optional (parseSchemaType "numberOfValuationDates")+ `apply` optional (parseSchemaType "dividendValuationDates")+ `apply` optional (parseSchemaType "fPVFinalPriceElectionFallback")+ schemaTypeToXML s x@EquityValuation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ equityVal_ID x+ ]+ [ maybe [] (foldOneOf2 (schemaTypeToXML "valuationDate")+ (schemaTypeToXML "valuationDates")+ ) $ equityVal_choice0 x+ , maybe [] (schemaTypeToXML "valuationTimeType") $ equityVal_valuationTimeType x+ , maybe [] (schemaTypeToXML "valuationTime") $ equityVal_valuationTime x+ , maybe [] (schemaTypeToXML "futuresPriceValuation") $ equityVal_futuresPriceValuation x+ , maybe [] (schemaTypeToXML "optionsPriceValuation") $ equityVal_optionsPriceValuation x+ , maybe [] (schemaTypeToXML "numberOfValuationDates") $ equityVal_numberOfValuationDates x+ , maybe [] (schemaTypeToXML "dividendValuationDates") $ equityVal_dividendValuationDates x+ , maybe [] (schemaTypeToXML "fPVFinalPriceElectionFallback") $ equityVal_fPVFinalPriceElectionFallback x+ ]+ +-- | Where the underlying is shares, defines market events +-- affecting the issuer of those shares that may require the +-- terms of the transaction to be adjusted.+data ExtraordinaryEvents = ExtraordinaryEvents+ { extraEvents_mergerEvents :: Maybe EquityCorporateEvents+ -- ^ Occurs when the underlying ceases to exist following a + -- merger between the Issuer and another company.+ , extraEvents_tenderOffer :: Maybe Xsd.Boolean+ -- ^ If present and true, then tender offer is applicable.+ , extraEvents_tenderOfferEvents :: Maybe EquityCorporateEvents+ -- ^ ISDA 2002 Equity Tender Offer Events.+ , extraEvents_compositionOfCombinedConsideration :: Maybe Xsd.Boolean+ -- ^ If present and true, then composition of combined + -- consideration is applicable.+ , extraEvents_indexAdjustmentEvents :: Maybe IndexAdjustmentEvents+ -- ^ ISDA 2002 Equity Index Adjustment Events.+ , extraEvents_choice5 :: (Maybe (OneOf2 AdditionalDisruptionEvents Xsd.Boolean))+ -- ^ Choice between:+ -- + -- (1) ISDA 2002 Equity Additional Disruption Events.+ -- + -- (2) If true, failure to deliver is applicable.+ , extraEvents_representations :: Maybe Representations+ -- ^ ISDA 2002 Equity Derivative Representations.+ , extraEvents_nationalisationOrInsolvency :: Maybe NationalisationOrInsolvencyOrDelistingEventEnum+ -- ^ The terms "Nationalisation" and "Insolvency" have the + -- meaning as defined in the ISDA 2002 Equity Derivatives + -- Definitions.+ , extraEvents_delisting :: Maybe NationalisationOrInsolvencyOrDelistingEventEnum+ -- ^ The term "Delisting" has the meaning defined in the ISDA + -- 2002 Equity Derivatives Definitions.+ , extraEvents_relatedExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for a related exchange. If + -- the element is not present then the exchange shall be the + -- primary exchange on which listed futures and options on the + -- underlying are listed. The term "Exchange" is assumed to + -- have the meaning as defined in the ISDA 2002 Equity + -- Derivatives Definitions.+ , extraEvents_optionsExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for an exchange on which the + -- reference option contract is listed. This is to address the + -- case where the reference exchange for the future is + -- different than the one for the option. The options Exchange + -- is referenced on share options when Merger Elections are + -- selected as Options Exchange Adjustment.+ , extraEvents_specifiedExchangeId :: [ExchangeId]+ -- ^ A short form unique identifier for a specified exchange. If + -- the element is not present then the exchange shall be + -- default terms as defined in the MCA; unless otherwise + -- specified in the Transaction Supplement.+ }+ deriving (Eq,Show)+instance SchemaType ExtraordinaryEvents where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ExtraordinaryEvents+ `apply` optional (parseSchemaType "mergerEvents")+ `apply` optional (parseSchemaType "tenderOffer")+ `apply` optional (parseSchemaType "tenderOfferEvents")+ `apply` optional (parseSchemaType "compositionOfCombinedConsideration")+ `apply` optional (parseSchemaType "indexAdjustmentEvents")+ `apply` optional (oneOf' [ ("AdditionalDisruptionEvents", fmap OneOf2 (parseSchemaType "additionalDisruptionEvents"))+ , ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "failureToDeliver"))+ ])+ `apply` optional (parseSchemaType "representations")+ `apply` optional (parseSchemaType "nationalisationOrInsolvency")+ `apply` optional (parseSchemaType "delisting")+ `apply` many (parseSchemaType "relatedExchangeId")+ `apply` many (parseSchemaType "optionsExchangeId")+ `apply` many (parseSchemaType "specifiedExchangeId")+ schemaTypeToXML s x@ExtraordinaryEvents{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "mergerEvents") $ extraEvents_mergerEvents x+ , maybe [] (schemaTypeToXML "tenderOffer") $ extraEvents_tenderOffer x+ , maybe [] (schemaTypeToXML "tenderOfferEvents") $ extraEvents_tenderOfferEvents x+ , maybe [] (schemaTypeToXML "compositionOfCombinedConsideration") $ extraEvents_compositionOfCombinedConsideration x+ , maybe [] (schemaTypeToXML "indexAdjustmentEvents") $ extraEvents_indexAdjustmentEvents x+ , maybe [] (foldOneOf2 (schemaTypeToXML "additionalDisruptionEvents")+ (schemaTypeToXML "failureToDeliver")+ ) $ extraEvents_choice5 x+ , maybe [] (schemaTypeToXML "representations") $ extraEvents_representations x+ , maybe [] (schemaTypeToXML "nationalisationOrInsolvency") $ extraEvents_nationalisationOrInsolvency x+ , maybe [] (schemaTypeToXML "delisting") $ extraEvents_delisting x+ , concatMap (schemaTypeToXML "relatedExchangeId") $ extraEvents_relatedExchangeId x+ , concatMap (schemaTypeToXML "optionsExchangeId") $ extraEvents_optionsExchangeId x+ , concatMap (schemaTypeToXML "specifiedExchangeId") $ extraEvents_specifiedExchangeId x+ ]+ +-- | Reference to a floating rate calculation of interest +-- calculation component.+data FloatingRateCalculationReference = FloatingRateCalculationReference+ { floatRateCalcRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType FloatingRateCalculationReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (FloatingRateCalculationReference a0)+ schemaTypeToXML s x@FloatingRateCalculationReference{} =+ toXMLElement s [ toXMLAttribute "href" $ floatRateCalcRef_href x+ ]+ []+instance Extension FloatingRateCalculationReference Reference where+ supertype v = Reference_FloatingRateCalculationReference v+ +-- | Defines the specification of the consequences of Index +-- Events as defined by the 2002 ISDA Equity Derivatives +-- Definitions.+data IndexAdjustmentEvents = IndexAdjustmentEvents+ { indexAdjustEvents_indexModification :: Maybe IndexEventConsequenceEnum+ -- ^ Consequence of index modification.+ , indexAdjustEvents_indexCancellation :: Maybe IndexEventConsequenceEnum+ -- ^ Consequence of index cancellation.+ , indexAdjustEvents_indexDisruption :: Maybe IndexEventConsequenceEnum+ -- ^ Consequence of index disruption.+ }+ deriving (Eq,Show)+instance SchemaType IndexAdjustmentEvents where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return IndexAdjustmentEvents+ `apply` optional (parseSchemaType "indexModification")+ `apply` optional (parseSchemaType "indexCancellation")+ `apply` optional (parseSchemaType "indexDisruption")+ schemaTypeToXML s x@IndexAdjustmentEvents{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "indexModification") $ indexAdjustEvents_indexModification x+ , maybe [] (schemaTypeToXML "indexCancellation") $ indexAdjustEvents_indexCancellation x+ , maybe [] (schemaTypeToXML "indexDisruption") $ indexAdjustEvents_indexDisruption x+ ]+ +-- | Specifies the calculation method of the interest rate leg +-- of the return swap. Includes the floating or fixed rate +-- calculation definitions, along with the determination of +-- the day count fraction.+data InterestCalculation = InterestCalculation+ { interCalc_ID :: Maybe Xsd.ID+ , interCalc_choice0 :: OneOf2 FloatingRateCalculation Xsd.Decimal+ -- ^ Choice between:+ -- + -- (1) The floating rate calculation definitions+ -- + -- (2) The calculation period fixed rate. A per annum rate, + -- expressed as a decimal. A fixed rate of 5% would be + -- represented as 0.05.+ , interCalc_dayCountFraction :: Maybe DayCountFraction+ -- ^ The day count fraction.+ , interCalc_compounding :: Maybe Compounding+ -- ^ Defines compounding rates on the Interest Leg.+ , interCalc_interpolationMethod :: Maybe InterpolationMethod+ -- ^ Specifies the type of interpolation used.+ , interCalc_interpolationPeriod :: Maybe InterpolationPeriodEnum+ -- ^ Defines applicable periods for interpolation.+ }+ deriving (Eq,Show)+instance SchemaType InterestCalculation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (InterestCalculation a0)+ `apply` oneOf' [ ("FloatingRateCalculation", fmap OneOf2 (parseSchemaType "floatingRateCalculation"))+ , ("Xsd.Decimal", fmap TwoOf2 (parseSchemaType "fixedRate"))+ ]+ `apply` optional (parseSchemaType "dayCountFraction")+ `apply` optional (parseSchemaType "compounding")+ `apply` optional (parseSchemaType "interpolationMethod")+ `apply` optional (parseSchemaType "interpolationPeriod")+ schemaTypeToXML s x@InterestCalculation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ interCalc_ID x+ ]+ [ foldOneOf2 (schemaTypeToXML "floatingRateCalculation")+ (schemaTypeToXML "fixedRate")+ $ interCalc_choice0 x+ , maybe [] (schemaTypeToXML "dayCountFraction") $ interCalc_dayCountFraction x+ , maybe [] (schemaTypeToXML "compounding") $ interCalc_compounding x+ , maybe [] (schemaTypeToXML "interpolationMethod") $ interCalc_interpolationMethod x+ , maybe [] (schemaTypeToXML "interpolationPeriod") $ interCalc_interpolationPeriod x+ ]+instance Extension InterestCalculation InterestAccrualsMethod where+ supertype (InterestCalculation a0 e0 e1 e2 e3 e4) =+ InterestAccrualsMethod e0+ +-- | A type describing the fixed income leg of the equity swap.+data InterestLeg = InterestLeg+ { interestLeg_ID :: Maybe Xsd.ID+ , interestLeg_legIdentifier :: [LegIdentifier]+ -- ^ Version aware identification of this leg.+ , interestLeg_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , interestLeg_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , interestLeg_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , interestLeg_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , interestLeg_effectiveDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the effective date of this leg of the swap. When + -- defined in relation to a date specified somewhere else in + -- the document (through the relativeDate component), this + -- element will typically point to the effective date of the + -- other leg of the swap.+ , interestLeg_terminationDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the termination date of this leg of the swap. + -- When defined in relation to a date specified somewhere else + -- in the document (through the relativeDate component), this + -- element will typically point to the termination date of the + -- other leg of the swap.+ , interestLeg_calculationPeriodDates :: Maybe InterestLegCalculationPeriodDates+ -- ^ Component that holds the various dates used to specify the + -- interest leg of the equity swap. It is used to define the + -- InterestPeriodDates identifyer.+ , interestLeg_notional :: Maybe ReturnSwapNotional+ -- ^ Specifies the notional of a return type swap. When used in + -- the equity leg, the definition will typically combine the + -- actual amount (using the notional component defined by the + -- FpML industry group) and the determination method. When + -- used in the interest leg, the definition will typically + -- point to the definition of the equity leg.+ , interestLeg_interestAmount :: Maybe LegAmount+ -- ^ Specifies, in relation to each Interest Payment Date, the + -- amount to which the Interest Payment Date relates. Unless + -- otherwise specified, this term has the meaning defined in + -- the ISDA 2000 ISDA Definitions.+ , interestLeg_interestCalculation :: InterestCalculation+ -- ^ Specifies the calculation method of the interest rate leg + -- of the equity swap. Includes the floating or fixed rate + -- calculation definitions, along with the determination of + -- the day count fraction.+ , interestLeg_stubCalculationPeriod :: Maybe StubCalculationPeriod+ -- ^ Specifies the stub calculation period.+ }+ deriving (Eq,Show)+instance SchemaType InterestLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (InterestLeg a0)+ `apply` many (parseSchemaType "legIdentifier")+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "effectiveDate")+ `apply` optional (parseSchemaType "terminationDate")+ `apply` optional (parseSchemaType "interestLegCalculationPeriodDates")+ `apply` optional (parseSchemaType "notional")+ `apply` optional (parseSchemaType "interestAmount")+ `apply` parseSchemaType "interestCalculation"+ `apply` optional (parseSchemaType "stubCalculationPeriod")+ schemaTypeToXML s x@InterestLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ interestLeg_ID x+ ]+ [ concatMap (schemaTypeToXML "legIdentifier") $ interestLeg_legIdentifier x+ , maybe [] (schemaTypeToXML "payerPartyReference") $ interestLeg_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ interestLeg_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ interestLeg_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ interestLeg_receiverAccountReference x+ , maybe [] (schemaTypeToXML "effectiveDate") $ interestLeg_effectiveDate x+ , maybe [] (schemaTypeToXML "terminationDate") $ interestLeg_terminationDate x+ , maybe [] (schemaTypeToXML "interestLegCalculationPeriodDates") $ interestLeg_calculationPeriodDates x+ , maybe [] (schemaTypeToXML "notional") $ interestLeg_notional x+ , maybe [] (schemaTypeToXML "interestAmount") $ interestLeg_interestAmount x+ , schemaTypeToXML "interestCalculation" $ interestLeg_interestCalculation x+ , maybe [] (schemaTypeToXML "stubCalculationPeriod") $ interestLeg_stubCalculationPeriod x+ ]+instance Extension InterestLeg DirectionalLeg where+ supertype v = DirectionalLeg_InterestLeg v+instance Extension InterestLeg Leg where+ supertype = (supertype :: DirectionalLeg -> Leg)+ . (supertype :: InterestLeg -> DirectionalLeg)+ + +-- | Component that holds the various dates used to specify the +-- interest leg of the return swap. It is used to define the +-- InterestPeriodDates identifyer.+data InterestLegCalculationPeriodDates = InterestLegCalculationPeriodDates+ { interLegCalcPeriodDates_ID :: Xsd.ID+ , interLegCalcPeriodDates_effectiveDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the effective date of the return swap. This + -- global element is valid within the return swaps namespace. + -- Within the FpML namespace, another effectiveDate global + -- element has been defined, that is different in the sense + -- that it does not propose the choice of refering to another + -- date in the document.+ , interLegCalcPeriodDates_terminationDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the termination date of the return swap. This + -- global element is valid within the return swaps namespace. + -- Within the FpML namespace, another terminationDate global + -- element has been defined, that is different in the sense + -- that it does not propose the choice of refering to another + -- date in the document.+ , interLegCalcPeriodDates_interestLegResetDates :: Maybe InterestLegResetDates+ -- ^ Specifies the reset dates of the interest leg of the swap.+ , interLegCalcPeriodDates_interestLegPaymentDates :: Maybe AdjustableRelativeOrPeriodicDates2+ -- ^ Specifies the payment dates of the interest leg of the + -- swap. When defined in relation to a date specified + -- somewhere else in the document (through the relativeDates + -- component), this element will typically point to the + -- payment dates of the equity leg of the swap.+ }+ deriving (Eq,Show)+instance SchemaType InterestLegCalculationPeriodDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "id" e pos+ commit $ interior e $ return (InterestLegCalculationPeriodDates a0)+ `apply` optional (parseSchemaType "effectiveDate")+ `apply` optional (parseSchemaType "terminationDate")+ `apply` optional (parseSchemaType "interestLegResetDates")+ `apply` optional (parseSchemaType "interestLegPaymentDates")+ schemaTypeToXML s x@InterestLegCalculationPeriodDates{} =+ toXMLElement s [ toXMLAttribute "id" $ interLegCalcPeriodDates_ID x+ ]+ [ maybe [] (schemaTypeToXML "effectiveDate") $ interLegCalcPeriodDates_effectiveDate x+ , maybe [] (schemaTypeToXML "terminationDate") $ interLegCalcPeriodDates_terminationDate x+ , maybe [] (schemaTypeToXML "interestLegResetDates") $ interLegCalcPeriodDates_interestLegResetDates x+ , maybe [] (schemaTypeToXML "interestLegPaymentDates") $ interLegCalcPeriodDates_interestLegPaymentDates x+ ]+ +-- | Reference to the calculation period dates of the interest +-- leg.+data InterestLegCalculationPeriodDatesReference = InterestLegCalculationPeriodDatesReference+ { ilcpdr_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType InterestLegCalculationPeriodDatesReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (InterestLegCalculationPeriodDatesReference a0)+ schemaTypeToXML s x@InterestLegCalculationPeriodDatesReference{} =+ toXMLElement s [ toXMLAttribute "href" $ ilcpdr_href x+ ]+ []+instance Extension InterestLegCalculationPeriodDatesReference Reference where+ supertype v = Reference_InterestLegCalculationPeriodDatesReference v+ +data InterestLegResetDates = InterestLegResetDates+ { interLegResetDates_calculationPeriodDatesReference :: Maybe InterestLegCalculationPeriodDatesReference+ -- ^ A pointer style reference to the associated calculation + -- period dates component defined elsewhere in the document.+ , interLegResetDates_choice1 :: (Maybe (OneOf2 ResetRelativeToEnum ResetFrequency))+ -- ^ Choice between:+ -- + -- (1) Specifies whether the reset dates are determined with + -- respect to each adjusted calculation period start date + -- or adjusted calculation period end date. If the reset + -- frequency is specified as daily this element must not + -- be included.+ -- + -- (2) The frequency at which reset dates occur. In the case + -- of a weekly reset frequency, also specifies the day of + -- the week that the reset occurs. If the reset frequency + -- is greater than the calculation period frequency then + -- this implies that more than one reset date is + -- established for each calculation period and some form + -- of rate averaging is applicable.+ , interLegResetDates_initialFixingDate :: Maybe RelativeDateOffset+ -- ^ Initial fixing date expressed as an offset to another date + -- defined elsewhere in the document.+ , interLegResetDates_fixingDates :: Maybe AdjustableDatesOrRelativeDateOffset+ -- ^ Specifies the fixing date relative to the reset date in + -- terms of a business days offset, or by providing a series + -- of adjustable dates.+ }+ deriving (Eq,Show)+instance SchemaType InterestLegResetDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return InterestLegResetDates+ `apply` optional (parseSchemaType "calculationPeriodDatesReference")+ `apply` optional (oneOf' [ ("ResetRelativeToEnum", fmap OneOf2 (parseSchemaType "resetRelativeTo"))+ , ("ResetFrequency", fmap TwoOf2 (parseSchemaType "resetFrequency"))+ ])+ `apply` optional (parseSchemaType "initialFixingDate")+ `apply` optional (parseSchemaType "fixingDates")+ schemaTypeToXML s x@InterestLegResetDates{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "calculationPeriodDatesReference") $ interLegResetDates_calculationPeriodDatesReference x+ , maybe [] (foldOneOf2 (schemaTypeToXML "resetRelativeTo")+ (schemaTypeToXML "resetFrequency")+ ) $ interLegResetDates_choice1 x+ , maybe [] (schemaTypeToXML "initialFixingDate") $ interLegResetDates_initialFixingDate x+ , maybe [] (schemaTypeToXML "fixingDates") $ interLegResetDates_fixingDates x+ ]+ +-- | A type describing the amount that will paid or received on +-- each of the payment dates. This type is used to define both +-- the Equity Amount and the Interest Amount.+data LegAmount = LegAmount+ { legAmount_choice0 :: (Maybe (OneOf3 IdentifiedCurrency DeterminationMethod IdentifiedCurrencyReference))+ -- ^ Choice between:+ -- + -- (1) The currency in which an amount is denominated.+ -- + -- (2) Specifies the method according to which an amount or a + -- date is determined.+ -- + -- (3) Reference to a currency defined elsewhere in the + -- document+ , legAmount_choice1 :: (Maybe (OneOf3 ReferenceAmount Formula Xsd.Base64Binary))+ -- ^ Choice between:+ -- + -- (1) Specifies the reference Amount when this term either + -- corresponds to the standard ISDA Definition (either the + -- 2002 Equity Definition for the Equity Amount, or the + -- 2000 Definition for the Interest Amount), or points to + -- a term defined elsewhere in the swap document.+ -- + -- (2) Specifies a formula, with its description and + -- components.+ -- + -- (3) Description of the leg amount when represented through + -- an encoded image.+ , legAmount_calculationDates :: Maybe AdjustableRelativeOrPeriodicDates+ -- ^ Specifies the date on which a calculation or an observation + -- will be performed for the purpose of defining the Equity + -- Amount, and in accordance to the definition terms of this + -- latter.+ }+ deriving (Eq,Show)+instance SchemaType LegAmount where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return LegAmount+ `apply` optional (oneOf' [ ("IdentifiedCurrency", fmap OneOf3 (parseSchemaType "currency"))+ , ("DeterminationMethod", fmap TwoOf3 (parseSchemaType "determinationMethod"))+ , ("IdentifiedCurrencyReference", fmap ThreeOf3 (parseSchemaType "currencyReference"))+ ])+ `apply` optional (oneOf' [ ("ReferenceAmount", fmap OneOf3 (parseSchemaType "referenceAmount"))+ , ("Formula", fmap TwoOf3 (parseSchemaType "formula"))+ , ("Xsd.Base64Binary", fmap ThreeOf3 (parseSchemaType "encodedDescription"))+ ])+ `apply` optional (parseSchemaType "calculationDates")+ schemaTypeToXML s x@LegAmount{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "currency")+ (schemaTypeToXML "determinationMethod")+ (schemaTypeToXML "currencyReference")+ ) $ legAmount_choice0 x+ , maybe [] (foldOneOf3 (schemaTypeToXML "referenceAmount")+ (schemaTypeToXML "formula")+ (schemaTypeToXML "encodedDescription")+ ) $ legAmount_choice1 x+ , maybe [] (schemaTypeToXML "calculationDates") $ legAmount_calculationDates x+ ]+ +-- | Leg identity.+data LegId = LegId Token60 LegIdAttributes deriving (Eq,Show)+data LegIdAttributes = LegIdAttributes+ { legIdAttrib_legIdScheme :: Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType LegId where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- getAttribute "legIdScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ LegId v (LegIdAttributes a0)+ schemaTypeToXML s (LegId bt at) =+ addXMLAttributes [ toXMLAttribute "legIdScheme" $ legIdAttrib_legIdScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension LegId Token60 where+ supertype (LegId s _) = s+ +-- | Version aware identification of a leg.+data LegIdentifier = LegIdentifier+ { legIdent_legId :: Maybe LegId+ -- ^ Identity of this leg.+ , legIdent_version :: Maybe Xsd.NonNegativeInteger+ -- ^ The version number+ , legIdent_effectiveDate :: Maybe IdentifiedDate+ -- ^ Optionally it is possible to specify a version effective + -- date when a versionId is supplied.+ }+ deriving (Eq,Show)+instance SchemaType LegIdentifier where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return LegIdentifier+ `apply` optional (parseSchemaType "legId")+ `apply` optional (parseSchemaType "version")+ `apply` optional (parseSchemaType "effectiveDate")+ schemaTypeToXML s x@LegIdentifier{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "legId") $ legIdent_legId x+ , maybe [] (schemaTypeToXML "version") $ legIdent_version x+ , maybe [] (schemaTypeToXML "effectiveDate") $ legIdent_effectiveDate x+ ]+ +-- | A type to hold early exercise provisions.+data MakeWholeProvisions = MakeWholeProvisions+ { makeWholeProvis_makeWholeDate :: Maybe Xsd.Date+ -- ^ Date through which option can not be exercised without + -- penalty.+ , makeWholeProvis_recallSpread :: Maybe Xsd.Decimal+ -- ^ Spread used if exercised before make whole date. Early + -- termination penalty. Expressed in bp, e.g. 25 bp.+ }+ deriving (Eq,Show)+instance SchemaType MakeWholeProvisions where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return MakeWholeProvisions+ `apply` optional (parseSchemaType "makeWholeDate")+ `apply` optional (parseSchemaType "recallSpread")+ schemaTypeToXML s x@MakeWholeProvisions{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "makeWholeDate") $ makeWholeProvis_makeWholeDate x+ , maybe [] (schemaTypeToXML "recallSpread") $ makeWholeProvis_recallSpread x+ ]+ +-- | An abstract base class for all swap types which have a +-- single netted leg, such as Variance Swaps, and Correlation +-- Swaps.+data NettedSwapBase+ = NettedSwapBase_CorrelationSwap CorrelationSwap+ | NettedSwapBase_VarianceSwap VarianceSwap+ + deriving (Eq,Show)+instance SchemaType NettedSwapBase where+ parseSchemaType s = do+ (fmap NettedSwapBase_CorrelationSwap $ parseSchemaType s)+ `onFail`+ (fmap NettedSwapBase_VarianceSwap $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of NettedSwapBase,\n\+\ namely one of:\n\+\CorrelationSwap,VarianceSwap"+ schemaTypeToXML _s (NettedSwapBase_CorrelationSwap x) = schemaTypeToXML "correlationSwap" x+ schemaTypeToXML _s (NettedSwapBase_VarianceSwap x) = schemaTypeToXML "varianceSwap" x+instance Extension NettedSwapBase Product where+ supertype v = Product_NettedSwapBase v+ +-- | A type for defining option features.+data OptionFeatures = OptionFeatures+ { optionFeatur_asian :: Maybe Asian+ -- ^ An option where and average price is taken on valuation.+ , optionFeatur_barrier :: Maybe Barrier+ -- ^ An option with a barrier feature.+ , optionFeatur_knock :: Maybe Knock+ -- ^ A knock feature.+ , optionFeatur_passThrough :: Maybe PassThrough+ -- ^ Pass through payments from the underlyer, such as + -- dividends.+ , optionFeatur_dividendAdjustment :: Maybe DividendAdjustment+ -- ^ Dividend adjustment of the contract is driven by the + -- difference between the Expected Dividend, and the Actual + -- Dividend, which is multiplied by an agreed Factor to + -- produce a Deviation, which is used as the basis for + -- adjusting the contract. The parties acknowledge that in + -- determining the Call Strike Price of the Transaction the + -- parties have assumed that the Dividend scheduled to be paid + -- by the Issuer to holders of record of the Shares, in the + -- period set out in Column headed Relevant Period will equal + -- per Share the amount stated in respect of such Relevant + -- Period.+ }+ deriving (Eq,Show)+instance SchemaType OptionFeatures where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OptionFeatures+ `apply` optional (parseSchemaType "asian")+ `apply` optional (parseSchemaType "barrier")+ `apply` optional (parseSchemaType "knock")+ `apply` optional (parseSchemaType "passThrough")+ `apply` optional (parseSchemaType "dividendAdjustment")+ schemaTypeToXML s x@OptionFeatures{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "asian") $ optionFeatur_asian x+ , maybe [] (schemaTypeToXML "barrier") $ optionFeatur_barrier x+ , maybe [] (schemaTypeToXML "knock") $ optionFeatur_knock x+ , maybe [] (schemaTypeToXML "passThrough") $ optionFeatur_passThrough x+ , maybe [] (schemaTypeToXML "dividendAdjustment") $ optionFeatur_dividendAdjustment x+ ]+ +-- | Specifies the principal exchange amount, either by +-- explicitly defining it, or by point to an amount defined +-- somewhere else in the swap document.+data PrincipalExchangeAmount = PrincipalExchangeAmount+ { princExchAmount_choice0 :: (Maybe (OneOf3 AmountReference DeterminationMethod NonNegativeMoney))+ -- ^ Choice between:+ -- + -- (1) Reference to an amount defined elsewhere in the + -- document.+ -- + -- (2) Specifies the method according to which an amount or a + -- date is determined.+ -- + -- (3) Principal exchange amount when explictly stated.+ }+ deriving (Eq,Show)+instance SchemaType PrincipalExchangeAmount where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PrincipalExchangeAmount+ `apply` optional (oneOf' [ ("AmountReference", fmap OneOf3 (parseSchemaType "amountRelativeTo"))+ , ("DeterminationMethod", fmap TwoOf3 (parseSchemaType "determinationMethod"))+ , ("NonNegativeMoney", fmap ThreeOf3 (parseSchemaType "principalAmount"))+ ])+ schemaTypeToXML s x@PrincipalExchangeAmount{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "amountRelativeTo")+ (schemaTypeToXML "determinationMethod")+ (schemaTypeToXML "principalAmount")+ ) $ princExchAmount_choice0 x+ ]+ +-- | Specifies each of the characteristics of the principal +-- exchange cashflows, in terms of paying/receiving +-- counterparties, amounts and dates.+data PrincipalExchangeDescriptions = PrincipalExchangeDescriptions+ { princExchDescr_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , princExchDescr_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , princExchDescr_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , princExchDescr_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , princExchDescr_principalExchangeAmount :: Maybe PrincipalExchangeAmount+ -- ^ Specifies the principal echange amount, either by + -- explicitly defining it, or by point to an amount defined + -- somewhere else in the swap document.+ , princExchDescr_principalExchangeDate :: Maybe AdjustableOrRelativeDate+ -- ^ Date on which each of the principal exchanges will take + -- place. This date is either explictly stated, or is defined + -- by reference to another date in the swap document. In this + -- latter case, it will typically refer to one other date of + -- the equity leg: either the effective date (initial + -- exchange), or the last payment date (final exchange).+ }+ deriving (Eq,Show)+instance SchemaType PrincipalExchangeDescriptions where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PrincipalExchangeDescriptions+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "principalExchangeAmount")+ `apply` optional (parseSchemaType "principalExchangeDate")+ schemaTypeToXML s x@PrincipalExchangeDescriptions{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ princExchDescr_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ princExchDescr_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ princExchDescr_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ princExchDescr_receiverAccountReference x+ , maybe [] (schemaTypeToXML "principalExchangeAmount") $ princExchDescr_principalExchangeAmount x+ , maybe [] (schemaTypeToXML "principalExchangeDate") $ princExchDescr_principalExchangeDate x+ ]+ +-- | A type describing the principal exchange features of the +-- return swap.+data PrincipalExchangeFeatures = PrincipalExchangeFeatures+ { princExchFeatur_principalExchanges :: Maybe PrincipalExchanges+ -- ^ The true/false flags indicating whether initial, + -- intermediate or final exchanges of principal should occur.+ , princExchFeatur_principalExchangeDescriptions :: [PrincipalExchangeDescriptions]+ -- ^ Specifies each of the characteristics of the principal + -- exchange cashflows, in terms of paying/receiving + -- counterparties, amounts and dates.+ }+ deriving (Eq,Show)+instance SchemaType PrincipalExchangeFeatures where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PrincipalExchangeFeatures+ `apply` optional (parseSchemaType "principalExchanges")+ `apply` many (parseSchemaType "principalExchangeDescriptions")+ schemaTypeToXML s x@PrincipalExchangeFeatures{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "principalExchanges") $ princExchFeatur_principalExchanges x+ , concatMap (schemaTypeToXML "principalExchangeDescriptions") $ princExchFeatur_principalExchangeDescriptions x+ ]+ +-- | A type for defining ISDA 2002 Equity Derivative +-- Representations.+data Representations = Representations+ { repres_nonReliance :: Maybe Xsd.Boolean+ -- ^ If true, then non reliance is applicable.+ , repres_agreementsRegardingHedging :: Maybe Xsd.Boolean+ -- ^ If true, then agreements regarding hedging are applicable.+ , repres_indexDisclaimer :: Maybe Xsd.Boolean+ -- ^ If present and true, then index disclaimer is applicable.+ , repres_additionalAcknowledgements :: Maybe Xsd.Boolean+ -- ^ If true, then additional acknowledgements are applicable.+ }+ deriving (Eq,Show)+instance SchemaType Representations where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Representations+ `apply` optional (parseSchemaType "nonReliance")+ `apply` optional (parseSchemaType "agreementsRegardingHedging")+ `apply` optional (parseSchemaType "indexDisclaimer")+ `apply` optional (parseSchemaType "additionalAcknowledgements")+ schemaTypeToXML s x@Representations{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "nonReliance") $ repres_nonReliance x+ , maybe [] (schemaTypeToXML "agreementsRegardingHedging") $ repres_agreementsRegardingHedging x+ , maybe [] (schemaTypeToXML "indexDisclaimer") $ repres_indexDisclaimer x+ , maybe [] (schemaTypeToXML "additionalAcknowledgements") $ repres_additionalAcknowledgements x+ ]+ +-- | A type describing the dividend return conditions applicable +-- to the swap.+data Return = Return+ { return_type :: ReturnTypeEnum+ -- ^ Defines the type of return associated with the return swap.+ , return_dividendConditions :: Maybe DividendConditions+ -- ^ Specifies the conditions governing the payment of the + -- dividends to the receiver of the equity return. With the + -- exception of the dividend payout ratio, which is defined + -- for each of the underlying components.+ }+ deriving (Eq,Show)+instance SchemaType Return where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Return+ `apply` parseSchemaType "returnType"+ `apply` optional (parseSchemaType "dividendConditions")+ schemaTypeToXML s x@Return{} =+ toXMLElement s []+ [ schemaTypeToXML "returnType" $ return_type x+ , maybe [] (schemaTypeToXML "dividendConditions") $ return_dividendConditions x+ ]+ +-- | A type describing the return leg of a return type swap.+data ReturnLeg = ReturnLeg+ { returnLeg_ID :: Maybe Xsd.ID+ , returnLeg_legIdentifier :: [LegIdentifier]+ -- ^ Version aware identification of this leg.+ , returnLeg_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , returnLeg_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , returnLeg_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , returnLeg_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , returnLeg_effectiveDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the effective date of this leg of the swap. When + -- defined in relation to a date specified somewhere else in + -- the document (through the relativeDate component), this + -- element will typically point to the effective date of the + -- other leg of the swap.+ , returnLeg_terminationDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the termination date of this leg of the swap. + -- When defined in relation to a date specified somewhere else + -- in the document (through the relativeDate component), this + -- element will typically point to the termination date of the + -- other leg of the swap.+ , returnLeg_strikeDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the strike date of this leg of the swap, used for + -- forward starting swaps. When defined in relation to a date + -- specified somewhere else in the document (through the + -- relativeDate component), this element will typically by + -- relative to the trade date of the swap.+ , returnLeg_underlyer :: Underlyer+ -- ^ Specifies the underlying component of the leg, which can be + -- either one or many and consists in either equity, index or + -- convertible bond component, or a combination of these.+ , returnLeg_rateOfReturn :: ReturnLegValuation+ -- ^ Specifies the terms of the initial price of the return type + -- swap and of the subsequent valuations of the underlyer.+ , returnLeg_notional :: Maybe ReturnSwapNotional+ -- ^ Specifies the notional of a return type swap. When used in + -- the equity leg, the definition will typically combine the + -- actual amount (using the notional component defined by the + -- FpML industry group) and the determination method. When + -- used in the interest leg, the definition will typically + -- point to the definition of the equity leg.+ , returnLeg_amount :: ReturnSwapAmount+ -- ^ Specifies, in relation to each Payment Date, the amount to + -- which the Payment Date relates. For return swaps this + -- element is equivalent to the Equity Amount term as defined + -- in the ISDA 2002 Equity Derivatives Definitions.+ , returnLeg_return :: Maybe Return+ -- ^ Specifies the conditions under which dividend affecting the + -- underlyer will be paid to the receiver of the amounts.+ , returnLeg_notionalAdjustments :: Maybe NotionalAdjustmentEnum+ -- ^ Specifies the conditions that govern the adjustment to the + -- number of units of the return swap.+ , returnLeg_fxFeature :: Maybe FxFeature+ -- ^ A quanto or composite FX feature.+ , returnLeg_averagingDates :: Maybe AveragingPeriod+ -- ^ Averaging Dates used in the swap.+ }+ deriving (Eq,Show)+instance SchemaType ReturnLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ReturnLeg a0)+ `apply` many (parseSchemaType "legIdentifier")+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "effectiveDate")+ `apply` optional (parseSchemaType "terminationDate")+ `apply` optional (parseSchemaType "strikeDate")+ `apply` parseSchemaType "underlyer"+ `apply` parseSchemaType "rateOfReturn"+ `apply` optional (parseSchemaType "notional")+ `apply` parseSchemaType "amount"+ `apply` optional (parseSchemaType "return")+ `apply` optional (parseSchemaType "notionalAdjustments")+ `apply` optional (parseSchemaType "fxFeature")+ `apply` optional (parseSchemaType "averagingDates")+ schemaTypeToXML s x@ReturnLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ returnLeg_ID x+ ]+ [ concatMap (schemaTypeToXML "legIdentifier") $ returnLeg_legIdentifier x+ , maybe [] (schemaTypeToXML "payerPartyReference") $ returnLeg_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ returnLeg_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ returnLeg_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ returnLeg_receiverAccountReference x+ , maybe [] (schemaTypeToXML "effectiveDate") $ returnLeg_effectiveDate x+ , maybe [] (schemaTypeToXML "terminationDate") $ returnLeg_terminationDate x+ , maybe [] (schemaTypeToXML "strikeDate") $ returnLeg_strikeDate x+ , schemaTypeToXML "underlyer" $ returnLeg_underlyer x+ , schemaTypeToXML "rateOfReturn" $ returnLeg_rateOfReturn x+ , maybe [] (schemaTypeToXML "notional") $ returnLeg_notional x+ , schemaTypeToXML "amount" $ returnLeg_amount x+ , maybe [] (schemaTypeToXML "return") $ returnLeg_return x+ , maybe [] (schemaTypeToXML "notionalAdjustments") $ returnLeg_notionalAdjustments x+ , maybe [] (schemaTypeToXML "fxFeature") $ returnLeg_fxFeature x+ , maybe [] (schemaTypeToXML "averagingDates") $ returnLeg_averagingDates x+ ]+instance Extension ReturnLeg ReturnSwapLegUnderlyer where+ supertype v = ReturnSwapLegUnderlyer_ReturnLeg v+instance Extension ReturnLeg DirectionalLeg where+ supertype = (supertype :: ReturnSwapLegUnderlyer -> DirectionalLeg)+ . (supertype :: ReturnLeg -> ReturnSwapLegUnderlyer)+ +instance Extension ReturnLeg Leg where+ supertype = (supertype :: DirectionalLeg -> Leg)+ . (supertype :: ReturnSwapLegUnderlyer -> DirectionalLeg)+ . (supertype :: ReturnLeg -> ReturnSwapLegUnderlyer)+ + +-- | A type describing the initial and final valuation of the +-- underlyer.+data ReturnLegValuation = ReturnLegValuation+ { returnLegVal_initialPrice :: Maybe ReturnLegValuationPrice+ -- ^ Specifies the initial reference price of the underlyer. + -- This price can be expressed either as an actual + -- amount/currency, as a determination method, or by reference + -- to another value specified in the swap document.+ , returnLegVal_notionalReset :: Maybe Xsd.Boolean+ -- ^ For return swaps, this element is equivalent to the term + -- "Equity Notional Reset" as defined in the ISDA 2002 Equity + -- Derivatives Definitions. The reference to the ISDA + -- definition is either "Applicable" or 'Inapplicable".+ , returnLegVal_valuationPriceInterim :: Maybe ReturnLegValuationPrice+ -- ^ Specifies the final valuation price of the underlyer. This + -- price can be expressed either as an actual amount/currency, + -- as a determination method, or by reference to another value + -- specified in the swap document.+ , returnLegVal_valuationPriceFinal :: Maybe ReturnLegValuationPrice+ -- ^ Specifies the final valuation price of the underlyer. This + -- price can be expressed either as an actual amount/currency, + -- as a determination method, or by reference to another value + -- specified in the swap document.+ , returnLegVal_paymentDates :: Maybe ReturnSwapPaymentDates+ -- ^ Specifies the payment dates of the swap.+ , returnLegVal_exchangeTradedContractNearest :: Maybe ExchangeTradedContract+ -- ^ References a Contract on the Exchange.+ }+ deriving (Eq,Show)+instance SchemaType ReturnLegValuation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReturnLegValuation+ `apply` optional (parseSchemaType "initialPrice")+ `apply` optional (parseSchemaType "notionalReset")+ `apply` optional (parseSchemaType "valuationPriceInterim")+ `apply` optional (parseSchemaType "valuationPriceFinal")+ `apply` optional (parseSchemaType "paymentDates")+ `apply` optional (parseSchemaType "exchangeTradedContractNearest")+ schemaTypeToXML s x@ReturnLegValuation{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "initialPrice") $ returnLegVal_initialPrice x+ , maybe [] (schemaTypeToXML "notionalReset") $ returnLegVal_notionalReset x+ , maybe [] (schemaTypeToXML "valuationPriceInterim") $ returnLegVal_valuationPriceInterim x+ , maybe [] (schemaTypeToXML "valuationPriceFinal") $ returnLegVal_valuationPriceFinal x+ , maybe [] (schemaTypeToXML "paymentDates") $ returnLegVal_paymentDates x+ , maybe [] (schemaTypeToXML "exchangeTradedContractNearest") $ returnLegVal_exchangeTradedContractNearest x+ ]+ +data ReturnLegValuationPrice = ReturnLegValuationPrice+ { returnLegValPrice_commission :: Maybe Commission+ -- ^ This optional component specifies the commission to be + -- charged for executing the hedge transactions.+ , returnLegValPrice_choice1 :: OneOf3 (DeterminationMethod,(Maybe (ActualPrice)),(Maybe (ActualPrice)),(Maybe (Xsd.Decimal)),(Maybe (FxConversion))) AmountReference ((Maybe (ActualPrice)),(Maybe (ActualPrice)),(Maybe (Xsd.Decimal)),(Maybe (FxConversion)))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * Specifies the method according to which an amount + -- or a date is determined.+ -- + -- * Specifies the price of the underlyer, before + -- commissions.+ -- + -- * Specifies the price of the underlyer, net of + -- commissions.+ -- + -- * Specifies the accrued interest that are part of the + -- dirty price in the case of a fixed income security + -- or a convertible bond. Expressed in percentage of + -- the notional.+ -- + -- * Specifies the currency conversion rate that applies + -- to an amount. This rate can either be defined + -- elsewhere in the document (case of a quanto swap), + -- or explicitly described through this component.+ -- + -- (2) The href attribute value will be a pointer style + -- reference to the element or component elsewhere in the + -- document where the anchor amount is defined.+ -- + -- (3) Sequence of:+ -- + -- * Specifies the price of the underlyer, before + -- commissions.+ -- + -- * Specifies the price of the underlyer, net of + -- commissions.+ -- + -- * Specifies the accrued interest that are part of the + -- dirty price in the case of a fixed income security + -- or a convertible bond. Expressed in percentage of + -- the notional.+ -- + -- * Specifies the currency conversion rate that applies + -- to an amount. This rate can either be defined + -- elsewhere in the document (case of a quanto swap), + -- or explicitly described through this component.+ , returnLegValPrice_cleanNetPrice :: Maybe Xsd.Decimal+ -- ^ The net price excluding accrued interest. The "Dirty Price" + -- for bonds is put in the "netPrice" element, which includes + -- accrued interest. Thus netPrice - cleanNetPrice = + -- accruedInterest. The currency and price expression for this + -- field are the same as those for the (dirty) netPrice.+ , returnLegValPrice_quotationCharacteristics :: Maybe QuotationCharacteristics+ -- ^ Allows information about how the price was quoted to be + -- provided.+ , returnLegValPrice_valuationRules :: Maybe EquityValuation+ -- ^ Specifies valuation.+ }+ deriving (Eq,Show)+instance SchemaType ReturnLegValuationPrice where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReturnLegValuationPrice+ `apply` optional (parseSchemaType "commission")+ `apply` oneOf' [ ("DeterminationMethod Maybe ActualPrice Maybe ActualPrice Maybe Xsd.Decimal Maybe FxConversion", fmap OneOf3 (return (,,,,) `apply` parseSchemaType "determinationMethod"+ `apply` optional (parseSchemaType "grossPrice")+ `apply` optional (parseSchemaType "netPrice")+ `apply` optional (parseSchemaType "accruedInterestPrice")+ `apply` optional (parseSchemaType "fxConversion")))+ , ("AmountReference", fmap TwoOf3 (parseSchemaType "amountRelativeTo"))+ , ("Maybe ActualPrice Maybe ActualPrice Maybe Xsd.Decimal Maybe FxConversion", fmap ThreeOf3 (return (,,,) `apply` optional (parseSchemaType "grossPrice")+ `apply` optional (parseSchemaType "netPrice")+ `apply` optional (parseSchemaType "accruedInterestPrice")+ `apply` optional (parseSchemaType "fxConversion")))+ ]+ `apply` optional (parseSchemaType "cleanNetPrice")+ `apply` optional (parseSchemaType "quotationCharacteristics")+ `apply` optional (parseSchemaType "valuationRules")+ schemaTypeToXML s x@ReturnLegValuationPrice{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "commission") $ returnLegValPrice_commission x+ , foldOneOf3 (\ (a,b,c,d,e) -> concat [ schemaTypeToXML "determinationMethod" a+ , maybe [] (schemaTypeToXML "grossPrice") b+ , maybe [] (schemaTypeToXML "netPrice") c+ , maybe [] (schemaTypeToXML "accruedInterestPrice") d+ , maybe [] (schemaTypeToXML "fxConversion") e+ ])+ (schemaTypeToXML "amountRelativeTo")+ (\ (a,b,c,d) -> concat [ maybe [] (schemaTypeToXML "grossPrice") a+ , maybe [] (schemaTypeToXML "netPrice") b+ , maybe [] (schemaTypeToXML "accruedInterestPrice") c+ , maybe [] (schemaTypeToXML "fxConversion") d+ ])+ $ returnLegValPrice_choice1 x+ , maybe [] (schemaTypeToXML "cleanNetPrice") $ returnLegValPrice_cleanNetPrice x+ , maybe [] (schemaTypeToXML "quotationCharacteristics") $ returnLegValPrice_quotationCharacteristics x+ , maybe [] (schemaTypeToXML "valuationRules") $ returnLegValPrice_valuationRules x+ ]+instance Extension ReturnLegValuationPrice Price where+ supertype (ReturnLegValuationPrice e0 e1 e2 e3 e4) =+ Price e0 e1 e2 e3+ +-- | A type describing return swaps including return swaps (long +-- form), total return swaps, and variance swaps.+data ReturnSwap = ReturnSwap+ { returnSwap_ID :: Maybe Xsd.ID+ , returnSwap_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , returnSwap_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , returnSwap_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , returnSwap_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , returnSwap_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , returnSwap_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , returnSwap_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , returnSwap_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , returnSwap_leg :: [DirectionalLeg]+ -- ^ An placeholder for the actual Return Swap Leg definition.+ , returnSwap_principalExchangeFeatures :: Maybe PrincipalExchangeFeatures+ -- ^ This is used to document a Fully Funded Return Swap.+ , returnSwap_additionalPayment :: [ReturnSwapAdditionalPayment]+ -- ^ Specifies additional payment(s) between the principal + -- parties to the trade.+ , returnSwap_earlyTermination :: [ReturnSwapEarlyTermination]+ -- ^ Specifies, for one or for both the parties to the trade, + -- the date from which it can early terminate it.+ , returnSwap_extraordinaryEvents :: Maybe ExtraordinaryEvents+ -- ^ Where the underlying is shares, specifies events affecting + -- the issuer of those shares that may require the terms of + -- the transaction to be adjusted.+ }+ deriving (Eq,Show)+instance SchemaType ReturnSwap where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ReturnSwap a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` optional (parseSchemaType "buyerPartyReference")+ `apply` optional (parseSchemaType "buyerAccountReference")+ `apply` optional (parseSchemaType "sellerPartyReference")+ `apply` optional (parseSchemaType "sellerAccountReference")+ `apply` between (Occurs (Just 0) (Just 2))+ (elementReturnSwapLeg)+ `apply` optional (parseSchemaType "principalExchangeFeatures")+ `apply` many (parseSchemaType "additionalPayment")+ `apply` many (parseSchemaType "earlyTermination")+ `apply` optional (parseSchemaType "extraordinaryEvents")+ schemaTypeToXML s x@ReturnSwap{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ returnSwap_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ returnSwap_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ returnSwap_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ returnSwap_productType x+ , concatMap (schemaTypeToXML "productId") $ returnSwap_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ returnSwap_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ returnSwap_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ returnSwap_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ returnSwap_sellerAccountReference x+ , concatMap (elementToXMLReturnSwapLeg) $ returnSwap_leg x+ , maybe [] (schemaTypeToXML "principalExchangeFeatures") $ returnSwap_principalExchangeFeatures x+ , concatMap (schemaTypeToXML "additionalPayment") $ returnSwap_additionalPayment x+ , concatMap (schemaTypeToXML "earlyTermination") $ returnSwap_earlyTermination x+ , maybe [] (schemaTypeToXML "extraordinaryEvents") $ returnSwap_extraordinaryEvents x+ ]+instance Extension ReturnSwap ReturnSwapBase where+ supertype v = ReturnSwapBase_ReturnSwap v+instance Extension ReturnSwap Product where+ supertype = (supertype :: ReturnSwapBase -> Product)+ . (supertype :: ReturnSwap -> ReturnSwapBase)+ + +-- | A type describing the additional payment(s) between the +-- principal parties to the trade. This component extends some +-- of the features of the additionalPayment component +-- previously developed in FpML. Appropriate discussions will +-- determine whether it would be appropriate to extend the +-- shared component in order to meet the further requirements +-- of equity swaps.+data ReturnSwapAdditionalPayment = ReturnSwapAdditionalPayment+ { returnSwapAddPayment_ID :: Maybe Xsd.ID+ , returnSwapAddPayment_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , returnSwapAddPayment_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , returnSwapAddPayment_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , returnSwapAddPayment_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , returnSwapAddPayment_additionalPaymentAmount :: Maybe AdditionalPaymentAmount+ -- ^ Specifies the amount of the fee along with, when + -- applicable, the formula that supports its determination.+ , returnSwapAddPayment_additionalPaymentDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the value date of the fee payment/receipt.+ , returnSwapAddPayment_paymentType :: Maybe PaymentType+ -- ^ Classification of the payment.+ }+ deriving (Eq,Show)+instance SchemaType ReturnSwapAdditionalPayment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ReturnSwapAdditionalPayment a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "additionalPaymentAmount")+ `apply` optional (parseSchemaType "additionalPaymentDate")+ `apply` optional (parseSchemaType "paymentType")+ schemaTypeToXML s x@ReturnSwapAdditionalPayment{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ returnSwapAddPayment_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ returnSwapAddPayment_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ returnSwapAddPayment_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ returnSwapAddPayment_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ returnSwapAddPayment_receiverAccountReference x+ , maybe [] (schemaTypeToXML "additionalPaymentAmount") $ returnSwapAddPayment_additionalPaymentAmount x+ , maybe [] (schemaTypeToXML "additionalPaymentDate") $ returnSwapAddPayment_additionalPaymentDate x+ , maybe [] (schemaTypeToXML "paymentType") $ returnSwapAddPayment_paymentType x+ ]+instance Extension ReturnSwapAdditionalPayment PaymentBase where+ supertype v = PaymentBase_ReturnSwapAdditionalPayment v+ +-- | Specifies, in relation to each Payment Date, the amount to +-- which the Payment Date relates. For Equity Swaps this +-- element is equivalent to the Equity Amount term as defined +-- in the ISDA 2002 Equity Derivatives Definitions.+data ReturnSwapAmount = ReturnSwapAmount+ { returnSwapAmount_choice0 :: (Maybe (OneOf3 IdentifiedCurrency DeterminationMethod IdentifiedCurrencyReference))+ -- ^ Choice between:+ -- + -- (1) The currency in which an amount is denominated.+ -- + -- (2) Specifies the method according to which an amount or a + -- date is determined.+ -- + -- (3) Reference to a currency defined elsewhere in the + -- document+ , returnSwapAmount_choice1 :: (Maybe (OneOf3 ReferenceAmount Formula Xsd.Base64Binary))+ -- ^ Choice between:+ -- + -- (1) Specifies the reference Amount when this term either + -- corresponds to the standard ISDA Definition (either the + -- 2002 Equity Definition for the Equity Amount, or the + -- 2000 Definition for the Interest Amount), or points to + -- a term defined elsewhere in the swap document.+ -- + -- (2) Specifies a formula, with its description and + -- components.+ -- + -- (3) Description of the leg amount when represented through + -- an encoded image.+ , returnSwapAmount_calculationDates :: Maybe AdjustableRelativeOrPeriodicDates+ -- ^ Specifies the date on which a calculation or an observation + -- will be performed for the purpose of defining the Equity + -- Amount, and in accordance to the definition terms of this + -- latter.+ , returnSwapAmount_cashSettlement :: Maybe Xsd.Boolean+ -- ^ If true, then cash settlement is applicable.+ , returnSwapAmount_optionsExchangeDividends :: Maybe Xsd.Boolean+ -- ^ If present and true, then options exchange dividends are + -- applicable.+ , returnSwapAmount_additionalDividends :: Maybe Xsd.Boolean+ -- ^ If present and true, then additional dividends are + -- applicable.+ , returnSwapAmount_allDividends :: Maybe Xsd.Boolean+ -- ^ Represents the European Master Confirmation value of 'All + -- Dividends' which, when applicable, signifies that, for a + -- given Ex-Date, the daily observed Share Price for that day + -- is adjusted (reduced) by the cash dividend and/or the cash + -- value of any non cash dividend per Share (including + -- Extraordinary Dividends) declared by the Issuer.+ }+ deriving (Eq,Show)+instance SchemaType ReturnSwapAmount where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReturnSwapAmount+ `apply` optional (oneOf' [ ("IdentifiedCurrency", fmap OneOf3 (parseSchemaType "currency"))+ , ("DeterminationMethod", fmap TwoOf3 (parseSchemaType "determinationMethod"))+ , ("IdentifiedCurrencyReference", fmap ThreeOf3 (parseSchemaType "currencyReference"))+ ])+ `apply` optional (oneOf' [ ("ReferenceAmount", fmap OneOf3 (parseSchemaType "referenceAmount"))+ , ("Formula", fmap TwoOf3 (parseSchemaType "formula"))+ , ("Xsd.Base64Binary", fmap ThreeOf3 (parseSchemaType "encodedDescription"))+ ])+ `apply` optional (parseSchemaType "calculationDates")+ `apply` optional (parseSchemaType "cashSettlement")+ `apply` optional (parseSchemaType "optionsExchangeDividends")+ `apply` optional (parseSchemaType "additionalDividends")+ `apply` optional (parseSchemaType "allDividends")+ schemaTypeToXML s x@ReturnSwapAmount{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "currency")+ (schemaTypeToXML "determinationMethod")+ (schemaTypeToXML "currencyReference")+ ) $ returnSwapAmount_choice0 x+ , maybe [] (foldOneOf3 (schemaTypeToXML "referenceAmount")+ (schemaTypeToXML "formula")+ (schemaTypeToXML "encodedDescription")+ ) $ returnSwapAmount_choice1 x+ , maybe [] (schemaTypeToXML "calculationDates") $ returnSwapAmount_calculationDates x+ , maybe [] (schemaTypeToXML "cashSettlement") $ returnSwapAmount_cashSettlement x+ , maybe [] (schemaTypeToXML "optionsExchangeDividends") $ returnSwapAmount_optionsExchangeDividends x+ , maybe [] (schemaTypeToXML "additionalDividends") $ returnSwapAmount_additionalDividends x+ , maybe [] (schemaTypeToXML "allDividends") $ returnSwapAmount_allDividends x+ ]+instance Extension ReturnSwapAmount LegAmount where+ supertype (ReturnSwapAmount e0 e1 e2 e3 e4 e5 e6) =+ LegAmount e0 e1 e2+ +-- | A type describing the components that are common for return +-- type swaps, including short and long form return swaps +-- representations.+data ReturnSwapBase+ = ReturnSwapBase_ReturnSwap ReturnSwap+ | ReturnSwapBase_EquitySwapTransactionSupplement EquitySwapTransactionSupplement+ + deriving (Eq,Show)+instance SchemaType ReturnSwapBase where+ parseSchemaType s = do+ (fmap ReturnSwapBase_ReturnSwap $ parseSchemaType s)+ `onFail`+ (fmap ReturnSwapBase_EquitySwapTransactionSupplement $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of ReturnSwapBase,\n\+\ namely one of:\n\+\ReturnSwap,EquitySwapTransactionSupplement"+ schemaTypeToXML _s (ReturnSwapBase_ReturnSwap x) = schemaTypeToXML "returnSwap" x+ schemaTypeToXML _s (ReturnSwapBase_EquitySwapTransactionSupplement x) = schemaTypeToXML "equitySwapTransactionSupplement" x+instance Extension ReturnSwapBase Product where+ supertype v = Product_ReturnSwapBase v+ +-- | A type describing the date from which each of the party may +-- be allowed to terminate the trade.+data ReturnSwapEarlyTermination = ReturnSwapEarlyTermination+ { returnSwapEarlyTermin_partyReference :: Maybe PartyReference+ -- ^ Reference to a party defined elsewhere in this document + -- which may be allowed to terminate the trade.+ , returnSwapEarlyTermin_startingDate :: Maybe StartingDate+ -- ^ Specifies the date from which the early termination clause + -- can be exercised.+ }+ deriving (Eq,Show)+instance SchemaType ReturnSwapEarlyTermination where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReturnSwapEarlyTermination+ `apply` optional (parseSchemaType "partyReference")+ `apply` optional (parseSchemaType "startingDate")+ schemaTypeToXML s x@ReturnSwapEarlyTermination{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "partyReference") $ returnSwapEarlyTermin_partyReference x+ , maybe [] (schemaTypeToXML "startingDate") $ returnSwapEarlyTermin_startingDate x+ ]+ +-- | A base class for all return leg types with an underlyer.+data ReturnSwapLegUnderlyer+ = ReturnSwapLegUnderlyer_ReturnLeg ReturnLeg+ + deriving (Eq,Show)+instance SchemaType ReturnSwapLegUnderlyer where+ parseSchemaType s = do+ (fmap ReturnSwapLegUnderlyer_ReturnLeg $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of ReturnSwapLegUnderlyer,\n\+\ namely one of:\n\+\ReturnLeg"+ schemaTypeToXML _s (ReturnSwapLegUnderlyer_ReturnLeg x) = schemaTypeToXML "returnLeg" x+instance Extension ReturnSwapLegUnderlyer DirectionalLeg where+ supertype v = DirectionalLeg_ReturnSwapLegUnderlyer v+ +-- | Specifies the notional of return type swap. When used in +-- the equity leg, the definition will typically combine the +-- actual amount (using the notional component defined by the +-- FpML industry group) and the determination method. When +-- used in the interest leg, the definition will typically +-- point to the definition of the equity leg.+data ReturnSwapNotional = ReturnSwapNotional+ { returnSwapNotion_ID :: Maybe Xsd.ID+ , returnSwapNotion_choice0 :: (Maybe (OneOf4 ReturnSwapNotionalAmountReference DeterminationMethodReference DeterminationMethod NotionalAmount))+ -- ^ Choice between:+ -- + -- (1) A reference to the return swap notional amount defined + -- elsewhere in this document.+ -- + -- (2) A reference to the return swap notional determination + -- method defined elsewhere in this document.+ -- + -- (3) Specifies the method according to which an amount or a + -- date is determined.+ -- + -- (4) The notional amount.+ }+ deriving (Eq,Show)+instance SchemaType ReturnSwapNotional where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ReturnSwapNotional a0)+ `apply` optional (oneOf' [ ("ReturnSwapNotionalAmountReference", fmap OneOf4 (parseSchemaType "relativeNotionalAmount"))+ , ("DeterminationMethodReference", fmap TwoOf4 (parseSchemaType "relativeDeterminationMethod"))+ , ("DeterminationMethod", fmap ThreeOf4 (parseSchemaType "determinationMethod"))+ , ("NotionalAmount", fmap FourOf4 (parseSchemaType "notionalAmount"))+ ])+ schemaTypeToXML s x@ReturnSwapNotional{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ returnSwapNotion_ID x+ ]+ [ maybe [] (foldOneOf4 (schemaTypeToXML "relativeNotionalAmount")+ (schemaTypeToXML "relativeDeterminationMethod")+ (schemaTypeToXML "determinationMethod")+ (schemaTypeToXML "notionalAmount")+ ) $ returnSwapNotion_choice0 x+ ]+ +-- | A type describing the return payment dates of the swap.+data ReturnSwapPaymentDates = ReturnSwapPaymentDates+ { returnSwapPaymentDates_ID :: Maybe Xsd.ID+ , returnSwapPaymentDates_paymentDatesInterim :: Maybe AdjustableOrRelativeDates+ -- ^ Specifies the interim payment dates of the swap. When + -- defined in relation to a date specified somewhere else in + -- the document (through the relativeDates component), this + -- element will typically refer to the valuation dates and add + -- a lag corresponding to the settlement cycle of the + -- underlyer.+ , returnSwapPaymentDates_paymentDateFinal :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the final payment date of the swap. When defined + -- in relation to a date specified somewhere else in the + -- document (through the relativeDate component), this element + -- will typically refer to the final valuation date and add a + -- lag corresponding to the settlement cycle of the underlyer.+ }+ deriving (Eq,Show)+instance SchemaType ReturnSwapPaymentDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ReturnSwapPaymentDates a0)+ `apply` optional (parseSchemaType "paymentDatesInterim")+ `apply` optional (parseSchemaType "paymentDateFinal")+ schemaTypeToXML s x@ReturnSwapPaymentDates{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ returnSwapPaymentDates_ID x+ ]+ [ maybe [] (schemaTypeToXML "paymentDatesInterim") $ returnSwapPaymentDates_paymentDatesInterim x+ , maybe [] (schemaTypeToXML "paymentDateFinal") $ returnSwapPaymentDates_paymentDateFinal x+ ]+ +-- | A type specifying the date from which the early termination +-- clause can be exercised.+data StartingDate = StartingDate+ { startingDate_choice0 :: (Maybe (OneOf2 DateReference AdjustableDate))+ -- ^ Choice between:+ -- + -- (1) Reference to a date defined elswhere in the document.+ -- + -- (2) Date from which early termination clause can be + -- exercised.+ }+ deriving (Eq,Show)+instance SchemaType StartingDate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return StartingDate+ `apply` optional (oneOf' [ ("DateReference", fmap OneOf2 (parseSchemaType "dateRelativeTo"))+ , ("AdjustableDate", fmap TwoOf2 (parseSchemaType "adjustableDate"))+ ])+ schemaTypeToXML s x@StartingDate{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "dateRelativeTo")+ (schemaTypeToXML "adjustableDate")+ ) $ startingDate_choice0 x+ ]+ +-- | A type describing the Stub Calculation Period.+data StubCalculationPeriod = StubCalculationPeriod+ { stubCalcPeriod_choice0 :: (Maybe (OneOf1 ((Maybe (Stub)),(Maybe (Stub)))))+ -- ^ Choice group between mandatory specification of initial + -- stub and optional specification of final stub, or mandatory + -- final stub.+ -- + -- Choice between:+ -- + -- (1) Sequence of:+ -- + -- * initialStub+ -- + -- * finalStub+ }+ deriving (Eq,Show)+instance SchemaType StubCalculationPeriod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return StubCalculationPeriod+ `apply` optional (oneOf' [ ("Maybe Stub Maybe Stub", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "initialStub")+ `apply` optional (parseSchemaType "finalStub")))+ ])+ schemaTypeToXML s x@StubCalculationPeriod{} =+ toXMLElement s []+ [ maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "initialStub") a+ , maybe [] (schemaTypeToXML "finalStub") b+ ])+ ) $ stubCalcPeriod_choice0 x+ ]+ +-- | A type describing the variance amount of a variance swap.+data Variance = Variance+ { variance_choice0 :: (Maybe (OneOf3 Xsd.Decimal Xsd.Boolean Xsd.Boolean))+ -- ^ Choice between:+ -- + -- (1) Contract will strike off this initial level.+ -- + -- (2) If true this contract will strike off the closing level + -- of the default exchange traded contract.+ -- + -- (3) If true this contract will strike off the expiring + -- level of the default exchange traded contract.+ , variance_expectedN :: Maybe Xsd.PositiveInteger+ -- ^ Expected number of trading days.+ , variance_amount :: Maybe NonNegativeMoney+ -- ^ Variance amount, which is a cash multiplier.+ , variance_choice3 :: (Maybe (OneOf2 NonNegativeDecimal NonNegativeDecimal))+ -- ^ Choice between expressing the strike as volatility or + -- variance.+ -- + -- Choice between:+ -- + -- (1) volatilityStrikePrice+ -- + -- (2) varianceStrikePrice+ , variance_cap :: Maybe Xsd.Boolean+ -- ^ If present and true, then variance cap is applicable.+ , variance_unadjustedVarianceCap :: Maybe PositiveDecimal+ -- ^ For use when varianceCap is applicable. Contains the + -- scaling factor of the Variance Cap that can differ on a + -- trade-by-trade basis in the European market. For example, a + -- Variance Cap of 2.5^2 x Variance Strike Price has an + -- unadjustedVarianceCap of 2.5.+ , variance_boundedVariance :: Maybe BoundedVariance+ -- ^ Conditions which bound variance. The contract specifies one + -- or more boundary levels. These levels are expressed as + -- prices for confirmation purposes Underlyer price must be + -- equal to or higher than Lower Barrier is known as Up + -- Conditional Swap Underlyer price must be equal to or lower + -- than Upper Barrier is known as Down Conditional Swap + -- Underlyer price must be equal to or higher than Lower + -- Barrier and must be equal to or lower than Upper Barrier is + -- known as Barrier Conditional Swap.+ , variance_exchangeTradedContractNearest :: Maybe ExchangeTradedContract+ -- ^ Specification of the exchange traded contract nearest.+ , variance_vegaNotionalAmount :: Maybe Xsd.Decimal+ -- ^ Vega Notional represents the approximate gain/loss at + -- maturity for a 1% difference between RVol (realised vol) + -- and KVol (strike vol). It does not necessarily represent + -- the Vega Risk of the trade.+ }+ deriving (Eq,Show)+instance SchemaType Variance where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Variance+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf3 (parseSchemaType "initialLevel"))+ , ("Xsd.Boolean", fmap TwoOf3 (parseSchemaType "closingLevel"))+ , ("Xsd.Boolean", fmap ThreeOf3 (parseSchemaType "expiringLevel"))+ ])+ `apply` optional (parseSchemaType "expectedN")+ `apply` optional (parseSchemaType "varianceAmount")+ `apply` optional (oneOf' [ ("NonNegativeDecimal", fmap OneOf2 (parseSchemaType "volatilityStrikePrice"))+ , ("NonNegativeDecimal", fmap TwoOf2 (parseSchemaType "varianceStrikePrice"))+ ])+ `apply` optional (parseSchemaType "varianceCap")+ `apply` optional (parseSchemaType "unadjustedVarianceCap")+ `apply` optional (parseSchemaType "boundedVariance")+ `apply` optional (parseSchemaType "exchangeTradedContractNearest")+ `apply` optional (parseSchemaType "vegaNotionalAmount")+ schemaTypeToXML s x@Variance{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "initialLevel")+ (schemaTypeToXML "closingLevel")+ (schemaTypeToXML "expiringLevel")+ ) $ variance_choice0 x+ , maybe [] (schemaTypeToXML "expectedN") $ variance_expectedN x+ , maybe [] (schemaTypeToXML "varianceAmount") $ variance_amount x+ , maybe [] (foldOneOf2 (schemaTypeToXML "volatilityStrikePrice")+ (schemaTypeToXML "varianceStrikePrice")+ ) $ variance_choice3 x+ , maybe [] (schemaTypeToXML "varianceCap") $ variance_cap x+ , maybe [] (schemaTypeToXML "unadjustedVarianceCap") $ variance_unadjustedVarianceCap x+ , maybe [] (schemaTypeToXML "boundedVariance") $ variance_boundedVariance x+ , maybe [] (schemaTypeToXML "exchangeTradedContractNearest") $ variance_exchangeTradedContractNearest x+ , maybe [] (schemaTypeToXML "vegaNotionalAmount") $ variance_vegaNotionalAmount x+ ]+instance Extension Variance CalculationFromObservation where+ supertype v = CalculationFromObservation_Variance v+ +-- | The fixed income amounts of the return type swap.+elementInterestLeg :: XMLParser InterestLeg+elementInterestLeg = parseSchemaType "interestLeg"+elementToXMLInterestLeg :: InterestLeg -> [Content ()]+elementToXMLInterestLeg = schemaTypeToXML "interestLeg"+ +-- | Return amounts of the return type swap.+elementReturnLeg :: XMLParser ReturnLeg+elementReturnLeg = parseSchemaType "returnLeg"+elementToXMLReturnLeg :: ReturnLeg -> [Content ()]+elementToXMLReturnLeg = schemaTypeToXML "returnLeg"+ +-- | Specifies the structure of a return type swap. It can +-- represent return swaps, total return swaps, variance swaps.+elementReturnSwap :: XMLParser ReturnSwap+elementReturnSwap = parseSchemaType "returnSwap"+elementToXMLReturnSwap :: ReturnSwap -> [Content ()]+elementToXMLReturnSwap = schemaTypeToXML "returnSwap"+ +-- | An placeholder for the actual Return Swap Leg definition.+elementReturnSwapLeg :: XMLParser DirectionalLeg+elementReturnSwapLeg = fmap supertype elementReturnLeg+ `onFail`+ fmap supertype elementInterestLeg+ `onFail` fail "Parse failed when expecting an element in the substitution group for\n\+\ <returnSwapLeg>,\n\+\ namely one of:\n\+\<returnLeg>, <interestLeg>"+elementToXMLReturnSwapLeg :: DirectionalLeg -> [Content ()]+elementToXMLReturnSwapLeg = schemaTypeToXML "returnSwapLeg"+ + + + + + +
@@ -0,0 +1,477 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Shared.EQ+ ( module Data.FpML.V53.Shared.EQ+ , module Data.FpML.V53.Shared.Option+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Shared.Option+ +-- | A type for defining ISDA 2002 Equity Derivative Additional +-- Disruption Events. +data AdditionalDisruptionEvents+instance Eq AdditionalDisruptionEvents+instance Show AdditionalDisruptionEvents+instance SchemaType AdditionalDisruptionEvents+ +-- | Specifies the amount of the fee along with, when +-- applicable, the formula that supports its determination. +data AdditionalPaymentAmount+instance Eq AdditionalPaymentAmount+instance Show AdditionalPaymentAmount+instance SchemaType AdditionalPaymentAmount+ +-- | A type describing a date defined as subject to adjustment +-- or defined in reference to another date through one or +-- several date offsets. +data AdjustableDateOrRelativeDateSequence+instance Eq AdjustableDateOrRelativeDateSequence+instance Show AdjustableDateOrRelativeDateSequence+instance SchemaType AdjustableDateOrRelativeDateSequence+ +-- | A type describing correlation bounds, which form a cap and +-- a floor on the realized correlation. +data BoundedCorrelation+instance Eq BoundedCorrelation+instance Show BoundedCorrelation+instance SchemaType BoundedCorrelation+ +-- | A type describing variance bounds, which are used to +-- exclude money price values outside of the specified range +-- In a Up Conditional Swap Underlyer price must be equal to +-- or higher than Lower Barrier In a Down Conditional Swap +-- Underlyer price must be equal to or lower than Upper +-- Barrier In a Corridor Conditional Swap Underlyer price must +-- be equal to or higher than Lower Barrier and must be equal +-- to or lower than Upper Barrier. +data BoundedVariance+instance Eq BoundedVariance+instance Show BoundedVariance+instance SchemaType BoundedVariance+ +-- | An abstract base class for all calculated money amounts, +-- which are in the currency of the cash multiplier of the +-- calculation. +data CalculatedAmount+instance Eq CalculatedAmount+instance Show CalculatedAmount+instance SchemaType CalculatedAmount+ +-- | Abstract base class for all calculation from observed +-- values. +data CalculationFromObservation+instance Eq CalculationFromObservation+instance Show CalculationFromObservation+instance SchemaType CalculationFromObservation+ +-- | Specifies the compounding method and the compounding rate. +data Compounding+instance Eq Compounding+instance Show Compounding+instance SchemaType Compounding+ +-- | A type defining a compounding rate. The compounding +-- interest can either point back to the floating rate +-- calculation of interest calculation node on the Interest +-- Leg, or be defined specifically. +data CompoundingRate+instance Eq CompoundingRate+instance Show CompoundingRate+instance SchemaType CompoundingRate+ +-- | A type describing the correlation amount of a correlation +-- swap. +data Correlation+instance Eq Correlation+instance Show Correlation+instance SchemaType Correlation+instance Extension Correlation CalculationFromObservation+ +-- | An abstract base class for all directional leg types with +-- effective date, termination date, where a payer makes a +-- stream of payments of greater than zero value to a +-- receiver. +data DirectionalLeg+instance Eq DirectionalLeg+instance Show DirectionalLeg+instance SchemaType DirectionalLeg+instance Extension DirectionalLeg Leg+ +-- | An abstract base class for all directional leg types with +-- effective date, termination date, and underlyer where a +-- payer makes a stream of payments of greater than zero value +-- to a receiver. +data DirectionalLegUnderlyer+instance Eq DirectionalLegUnderlyer+instance Show DirectionalLegUnderlyer+instance SchemaType DirectionalLegUnderlyer+instance Extension DirectionalLegUnderlyer DirectionalLeg+ +-- | An abstract base class for all directional leg types with +-- effective date, termination date, and underlyer, where a +-- payer makes a stream of payments of greater than zero value +-- to a receiver. +data DirectionalLegUnderlyerValuation+instance Eq DirectionalLegUnderlyerValuation+instance Show DirectionalLegUnderlyerValuation+instance SchemaType DirectionalLegUnderlyerValuation+instance Extension DirectionalLegUnderlyerValuation DirectionalLegUnderlyer+ +-- | Container for Dividend Adjustment Periods, which are used +-- to calculate the Deviation between Expected Dividend and +-- Actual Dividend in that Period. +data DividendAdjustment+instance Eq DividendAdjustment+instance Show DividendAdjustment+instance SchemaType DividendAdjustment+ +-- | A type describing the conditions governing the payment of +-- dividends to the receiver of the equity return. With the +-- exception of the dividend payout ratio, which is defined +-- for each of the underlying components. +data DividendConditions+instance Eq DividendConditions+instance Show DividendConditions+instance SchemaType DividendConditions+ +-- | A type describing the date on which the dividend will be +-- paid/received. This type is also used to specify the date +-- on which the FX rate will be determined, when applicable. +data DividendPaymentDate+instance Eq DividendPaymentDate+instance Show DividendPaymentDate+instance SchemaType DividendPaymentDate+ +-- | Abstract base class of all time bounded dividend period +-- types. +data DividendPeriod+instance Eq DividendPeriod+instance Show DividendPeriod+instance SchemaType DividendPeriod+ +-- | A time bounded dividend period, with an expected dividend +-- for each period. +data DividendPeriodDividend+instance Eq DividendPeriodDividend+instance Show DividendPeriodDividend+instance SchemaType DividendPeriodDividend+instance Extension DividendPeriodDividend DividendPeriod+ +-- | A type for defining the merger events and their treatment. +data EquityCorporateEvents+instance Eq EquityCorporateEvents+instance Show EquityCorporateEvents+instance SchemaType EquityCorporateEvents+ +-- | A type used to describe the amount paid for an equity +-- option. +data EquityPremium+instance Eq EquityPremium+instance Show EquityPremium+instance SchemaType EquityPremium+instance Extension EquityPremium PaymentBase+ +-- | A type for defining the strike price for an equity option. +-- The strike price is either: (i) in respect of an index +-- option transaction, the level of the relevant index +-- specified or otherwise determined in the transaction; or +-- (ii) in respect of a share option transaction, the price +-- per share specified or otherwise determined in the +-- transaction. This can be expressed either as a percentage +-- of notional amount or as an absolute value. +data EquityStrike+instance Eq EquityStrike+instance Show EquityStrike+instance SchemaType EquityStrike+ +-- | A type for defining how and when an equity option is to be +-- valued. +data EquityValuation+instance Eq EquityValuation+instance Show EquityValuation+instance SchemaType EquityValuation+ +-- | Where the underlying is shares, defines market events +-- affecting the issuer of those shares that may require the +-- terms of the transaction to be adjusted. +data ExtraordinaryEvents+instance Eq ExtraordinaryEvents+instance Show ExtraordinaryEvents+instance SchemaType ExtraordinaryEvents+ +-- | Reference to a floating rate calculation of interest +-- calculation component. +data FloatingRateCalculationReference+instance Eq FloatingRateCalculationReference+instance Show FloatingRateCalculationReference+instance SchemaType FloatingRateCalculationReference+instance Extension FloatingRateCalculationReference Reference+ +-- | Defines the specification of the consequences of Index +-- Events as defined by the 2002 ISDA Equity Derivatives +-- Definitions. +data IndexAdjustmentEvents+instance Eq IndexAdjustmentEvents+instance Show IndexAdjustmentEvents+instance SchemaType IndexAdjustmentEvents+ +-- | Specifies the calculation method of the interest rate leg +-- of the return swap. Includes the floating or fixed rate +-- calculation definitions, along with the determination of +-- the day count fraction. +data InterestCalculation+instance Eq InterestCalculation+instance Show InterestCalculation+instance SchemaType InterestCalculation+instance Extension InterestCalculation InterestAccrualsMethod+ +-- | A type describing the fixed income leg of the equity swap. +data InterestLeg+instance Eq InterestLeg+instance Show InterestLeg+instance SchemaType InterestLeg+instance Extension InterestLeg DirectionalLeg+instance Extension InterestLeg Leg+ +-- | Component that holds the various dates used to specify the +-- interest leg of the return swap. It is used to define the +-- InterestPeriodDates identifyer. +data InterestLegCalculationPeriodDates+instance Eq InterestLegCalculationPeriodDates+instance Show InterestLegCalculationPeriodDates+instance SchemaType InterestLegCalculationPeriodDates+ +-- | Reference to the calculation period dates of the interest +-- leg. +data InterestLegCalculationPeriodDatesReference+instance Eq InterestLegCalculationPeriodDatesReference+instance Show InterestLegCalculationPeriodDatesReference+instance SchemaType InterestLegCalculationPeriodDatesReference+instance Extension InterestLegCalculationPeriodDatesReference Reference+ +data InterestLegResetDates+instance Eq InterestLegResetDates+instance Show InterestLegResetDates+instance SchemaType InterestLegResetDates+ +-- | A type describing the amount that will paid or received on +-- each of the payment dates. This type is used to define both +-- the Equity Amount and the Interest Amount. +data LegAmount+instance Eq LegAmount+instance Show LegAmount+instance SchemaType LegAmount+ +-- | Leg identity. +data LegId+data LegIdAttributes+instance Eq LegId+instance Eq LegIdAttributes+instance Show LegId+instance Show LegIdAttributes+instance SchemaType LegId+instance Extension LegId Token60+ +-- | Version aware identification of a leg. +data LegIdentifier+instance Eq LegIdentifier+instance Show LegIdentifier+instance SchemaType LegIdentifier+ +-- | A type to hold early exercise provisions. +data MakeWholeProvisions+instance Eq MakeWholeProvisions+instance Show MakeWholeProvisions+instance SchemaType MakeWholeProvisions+ +-- | An abstract base class for all swap types which have a +-- single netted leg, such as Variance Swaps, and Correlation +-- Swaps. +data NettedSwapBase+instance Eq NettedSwapBase+instance Show NettedSwapBase+instance SchemaType NettedSwapBase+instance Extension NettedSwapBase Product+ +-- | A type for defining option features. +data OptionFeatures+instance Eq OptionFeatures+instance Show OptionFeatures+instance SchemaType OptionFeatures+ +-- | Specifies the principal exchange amount, either by +-- explicitly defining it, or by point to an amount defined +-- somewhere else in the swap document. +data PrincipalExchangeAmount+instance Eq PrincipalExchangeAmount+instance Show PrincipalExchangeAmount+instance SchemaType PrincipalExchangeAmount+ +-- | Specifies each of the characteristics of the principal +-- exchange cashflows, in terms of paying/receiving +-- counterparties, amounts and dates. +data PrincipalExchangeDescriptions+instance Eq PrincipalExchangeDescriptions+instance Show PrincipalExchangeDescriptions+instance SchemaType PrincipalExchangeDescriptions+ +-- | A type describing the principal exchange features of the +-- return swap. +data PrincipalExchangeFeatures+instance Eq PrincipalExchangeFeatures+instance Show PrincipalExchangeFeatures+instance SchemaType PrincipalExchangeFeatures+ +-- | A type for defining ISDA 2002 Equity Derivative +-- Representations. +data Representations+instance Eq Representations+instance Show Representations+instance SchemaType Representations+ +-- | A type describing the dividend return conditions applicable +-- to the swap. +data Return+instance Eq Return+instance Show Return+instance SchemaType Return+ +-- | A type describing the return leg of a return type swap. +data ReturnLeg+instance Eq ReturnLeg+instance Show ReturnLeg+instance SchemaType ReturnLeg+instance Extension ReturnLeg ReturnSwapLegUnderlyer+instance Extension ReturnLeg DirectionalLeg+instance Extension ReturnLeg Leg+ +-- | A type describing the initial and final valuation of the +-- underlyer. +data ReturnLegValuation+instance Eq ReturnLegValuation+instance Show ReturnLegValuation+instance SchemaType ReturnLegValuation+ +data ReturnLegValuationPrice+instance Eq ReturnLegValuationPrice+instance Show ReturnLegValuationPrice+instance SchemaType ReturnLegValuationPrice+instance Extension ReturnLegValuationPrice Price+ +-- | A type describing return swaps including return swaps (long +-- form), total return swaps, and variance swaps. +data ReturnSwap+instance Eq ReturnSwap+instance Show ReturnSwap+instance SchemaType ReturnSwap+instance Extension ReturnSwap ReturnSwapBase+instance Extension ReturnSwap Product+ +-- | A type describing the additional payment(s) between the +-- principal parties to the trade. This component extends some +-- of the features of the additionalPayment component +-- previously developed in FpML. Appropriate discussions will +-- determine whether it would be appropriate to extend the +-- shared component in order to meet the further requirements +-- of equity swaps. +data ReturnSwapAdditionalPayment+instance Eq ReturnSwapAdditionalPayment+instance Show ReturnSwapAdditionalPayment+instance SchemaType ReturnSwapAdditionalPayment+instance Extension ReturnSwapAdditionalPayment PaymentBase+ +-- | Specifies, in relation to each Payment Date, the amount to +-- which the Payment Date relates. For Equity Swaps this +-- element is equivalent to the Equity Amount term as defined +-- in the ISDA 2002 Equity Derivatives Definitions. +data ReturnSwapAmount+instance Eq ReturnSwapAmount+instance Show ReturnSwapAmount+instance SchemaType ReturnSwapAmount+instance Extension ReturnSwapAmount LegAmount+ +-- | A type describing the components that are common for return +-- type swaps, including short and long form return swaps +-- representations. +data ReturnSwapBase+instance Eq ReturnSwapBase+instance Show ReturnSwapBase+instance SchemaType ReturnSwapBase+instance Extension ReturnSwapBase Product+ +-- | A type describing the date from which each of the party may +-- be allowed to terminate the trade. +data ReturnSwapEarlyTermination+instance Eq ReturnSwapEarlyTermination+instance Show ReturnSwapEarlyTermination+instance SchemaType ReturnSwapEarlyTermination+ +-- | A base class for all return leg types with an underlyer. +data ReturnSwapLegUnderlyer+instance Eq ReturnSwapLegUnderlyer+instance Show ReturnSwapLegUnderlyer+instance SchemaType ReturnSwapLegUnderlyer+instance Extension ReturnSwapLegUnderlyer DirectionalLeg+ +-- | Specifies the notional of return type swap. When used in +-- the equity leg, the definition will typically combine the +-- actual amount (using the notional component defined by the +-- FpML industry group) and the determination method. When +-- used in the interest leg, the definition will typically +-- point to the definition of the equity leg. +data ReturnSwapNotional+instance Eq ReturnSwapNotional+instance Show ReturnSwapNotional+instance SchemaType ReturnSwapNotional+ +-- | A type describing the return payment dates of the swap. +data ReturnSwapPaymentDates+instance Eq ReturnSwapPaymentDates+instance Show ReturnSwapPaymentDates+instance SchemaType ReturnSwapPaymentDates+ +-- | A type specifying the date from which the early termination +-- clause can be exercised. +data StartingDate+instance Eq StartingDate+instance Show StartingDate+instance SchemaType StartingDate+ +-- | A type describing the Stub Calculation Period. +data StubCalculationPeriod+instance Eq StubCalculationPeriod+instance Show StubCalculationPeriod+instance SchemaType StubCalculationPeriod+ +-- | A type describing the variance amount of a variance swap. +data Variance+instance Eq Variance+instance Show Variance+instance SchemaType Variance+instance Extension Variance CalculationFromObservation+ +-- | The fixed income amounts of the return type swap. +elementInterestLeg :: XMLParser InterestLeg+elementToXMLInterestLeg :: InterestLeg -> [Content ()]+ +-- | Return amounts of the return type swap. +elementReturnLeg :: XMLParser ReturnLeg+elementToXMLReturnLeg :: ReturnLeg -> [Content ()]+ +-- | Specifies the structure of a return type swap. It can +-- represent return swaps, total return swaps, variance swaps. +elementReturnSwap :: XMLParser ReturnSwap+elementToXMLReturnSwap :: ReturnSwap -> [Content ()]+ +-- | An placeholder for the actual Return Swap Leg definition. +elementReturnSwapLeg :: XMLParser DirectionalLeg+ + + + + + +
@@ -0,0 +1,1259 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Shared.Option+ ( module Data.FpML.V53.Shared.Option+ , 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+ +-- Some hs-boot imports are required, for fwd-declaring types.+import {-# SOURCE #-} Data.FpML.V53.FX ( FxOption )+import {-# SOURCE #-} Data.FpML.V53.FX ( FxDigitalOption )+import {-# SOURCE #-} Data.FpML.V53.Swaps.Variance ( VarianceOptionTransactionSupplement )+import {-# SOURCE #-} Data.FpML.V53.CD ( CreditDefaultSwapOption )+import {-# SOURCE #-} Data.FpML.V53.Option.Bond ( BondOption )+ +-- | As per ISDA 2002 Definitions.+data Asian = Asian+ { asian_averagingInOut :: Maybe AveragingInOutEnum+ , asian_strikeFactor :: Maybe Xsd.Decimal+ -- ^ The factor of strike.+ , asian_averagingPeriodIn :: Maybe AveragingPeriod+ -- ^ The averaging in period.+ , asian_averagingPeriodOut :: Maybe AveragingPeriod+ -- ^ The averaging out period.+ }+ deriving (Eq,Show)+instance SchemaType Asian where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Asian+ `apply` optional (parseSchemaType "averagingInOut")+ `apply` optional (parseSchemaType "strikeFactor")+ `apply` optional (parseSchemaType "averagingPeriodIn")+ `apply` optional (parseSchemaType "averagingPeriodOut")+ schemaTypeToXML s x@Asian{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "averagingInOut") $ asian_averagingInOut x+ , maybe [] (schemaTypeToXML "strikeFactor") $ asian_strikeFactor x+ , maybe [] (schemaTypeToXML "averagingPeriodIn") $ asian_averagingPeriodIn x+ , maybe [] (schemaTypeToXML "averagingPeriodOut") $ asian_averagingPeriodOut x+ ]+ +-- | An un ordered list of weighted averaging observations.+data AveragingObservationList = AveragingObservationList+ { averagObservList_averagingObservation :: [WeightedAveragingObservation]+ -- ^ A single weighted averaging observation.+ }+ deriving (Eq,Show)+instance SchemaType AveragingObservationList where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return AveragingObservationList+ `apply` many (parseSchemaType "averagingObservation")+ schemaTypeToXML s x@AveragingObservationList{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "averagingObservation") $ averagObservList_averagingObservation x+ ]+ +-- | Period over which an average value is taken.+data AveragingPeriod = AveragingPeriod+ { averagPeriod_schedule :: [AveragingSchedule]+ -- ^ A schedule for generating averaging observation dates.+ , averagPeriod_choice1 :: (Maybe (OneOf2 DateTimeList AveragingObservationList))+ -- ^ A choice between unweighted and weighted averaging date and + -- times.+ -- + -- Choice between:+ -- + -- (1) An unweighted list of averaging observation date and + -- times.+ -- + -- (2) A weighted list of averaging observation date and + -- times.+ , averagPeriod_marketDisruption :: Maybe MarketDisruption+ -- ^ The market disruption event as defined by ISDA 2002 + -- Definitions.+ }+ deriving (Eq,Show)+instance SchemaType AveragingPeriod where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return AveragingPeriod+ `apply` many (parseSchemaType "schedule")+ `apply` optional (oneOf' [ ("DateTimeList", fmap OneOf2 (parseSchemaType "averagingDateTimes"))+ , ("AveragingObservationList", fmap TwoOf2 (parseSchemaType "averagingObservations"))+ ])+ `apply` optional (parseSchemaType "marketDisruption")+ schemaTypeToXML s x@AveragingPeriod{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "schedule") $ averagPeriod_schedule x+ , maybe [] (foldOneOf2 (schemaTypeToXML "averagingDateTimes")+ (schemaTypeToXML "averagingObservations")+ ) $ averagPeriod_choice1 x+ , maybe [] (schemaTypeToXML "marketDisruption") $ averagPeriod_marketDisruption x+ ]+ +-- | Method of generating a series of dates.+data AveragingSchedule = AveragingSchedule+ { averagSched_startDate :: Maybe Xsd.Date+ -- ^ Date on which this period begins.+ , averagSched_endDate :: Maybe Xsd.Date+ -- ^ Date on which this period ends.+ , averagSched_averagingPeriodFrequency :: Maybe CalculationPeriodFrequency+ -- ^ The frequency at which averaging period occurs with the + -- regular part of the valuation schedule and their roll date + -- convention.+ }+ deriving (Eq,Show)+instance SchemaType AveragingSchedule where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return AveragingSchedule+ `apply` optional (parseSchemaType "startDate")+ `apply` optional (parseSchemaType "endDate")+ `apply` optional (parseSchemaType "averagingPeriodFrequency")+ schemaTypeToXML s x@AveragingSchedule{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "startDate") $ averagSched_startDate x+ , maybe [] (schemaTypeToXML "endDate") $ averagSched_endDate x+ , maybe [] (schemaTypeToXML "averagingPeriodFrequency") $ averagSched_averagingPeriodFrequency x+ ]+ +-- | As per ISDA 2002 Definitions.+data Barrier = Barrier+ { barrier_cap :: Maybe TriggerEvent+ -- ^ A trigger level approached from beneath.+ , barrier_floor :: Maybe TriggerEvent+ -- ^ A trigger level approached from above.+ }+ deriving (Eq,Show)+instance SchemaType Barrier where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Barrier+ `apply` optional (parseSchemaType "barrierCap")+ `apply` optional (parseSchemaType "barrierFloor")+ schemaTypeToXML s x@Barrier{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "barrierCap") $ barrier_cap x+ , maybe [] (schemaTypeToXML "barrierFloor") $ barrier_floor x+ ]+ +-- | A type for defining a calendar spread feature.+data CalendarSpread = CalendarSpread+ { calSpread_expirationDateTwo :: Maybe AdjustableOrRelativeDate+ }+ deriving (Eq,Show)+instance SchemaType CalendarSpread where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CalendarSpread+ `apply` optional (parseSchemaType "expirationDateTwo")+ schemaTypeToXML s x@CalendarSpread{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "expirationDateTwo") $ calSpread_expirationDateTwo x+ ]+ +-- | A classified non negative payment.+data ClassifiedPayment = ClassifiedPayment+ { classPayment_ID :: Maybe Xsd.ID+ , classPayment_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , classPayment_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , classPayment_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , classPayment_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , classPayment_paymentDate :: Maybe AdjustableOrRelativeDate+ -- ^ The payment date, which can be expressed as either an + -- adjustable or relative date.+ , classPayment_paymentAmount :: Maybe NonNegativeMoney+ -- ^ Non negative payment amount.+ , classPayment_paymentType :: [PaymentType]+ -- ^ Payment classification.+ }+ deriving (Eq,Show)+instance SchemaType ClassifiedPayment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ClassifiedPayment a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "paymentDate")+ `apply` optional (parseSchemaType "paymentAmount")+ `apply` many (parseSchemaType "paymentType")+ schemaTypeToXML s x@ClassifiedPayment{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ classPayment_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ classPayment_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ classPayment_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ classPayment_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ classPayment_receiverAccountReference x+ , maybe [] (schemaTypeToXML "paymentDate") $ classPayment_paymentDate x+ , maybe [] (schemaTypeToXML "paymentAmount") $ classPayment_paymentAmount x+ , concatMap (schemaTypeToXML "paymentType") $ classPayment_paymentType x+ ]+instance Extension ClassifiedPayment NonNegativePayment where+ supertype (ClassifiedPayment a0 e0 e1 e2 e3 e4 e5 e6) =+ NonNegativePayment a0 e0 e1 e2 e3 e4 e5+instance Extension ClassifiedPayment PaymentBaseExtended where+ supertype = (supertype :: NonNegativePayment -> PaymentBaseExtended)+ . (supertype :: ClassifiedPayment -> NonNegativePayment)+ +instance Extension ClassifiedPayment PaymentBase where+ supertype = (supertype :: PaymentBaseExtended -> PaymentBase)+ . (supertype :: NonNegativePayment -> PaymentBaseExtended)+ . (supertype :: ClassifiedPayment -> NonNegativePayment)+ + +-- | Specifies the conditions to be applied for converting into +-- a reference currency when the actual currency rate is not +-- determined upfront.+data Composite = Composite+ { composite_determinationMethod :: Maybe DeterminationMethod+ -- ^ Specifies the method according to which an amount or a date + -- is determined.+ , composite_relativeDate :: Maybe RelativeDateOffset+ -- ^ A date specified as some offset to another date (the anchor + -- date).+ , composite_fxSpotRateSource :: Maybe FxSpotRateSource+ -- ^ Specifies the methodology (reference source and, + -- optionally, fixing time) to be used for determining a + -- currency conversion rate.+ }+ deriving (Eq,Show)+instance SchemaType Composite where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Composite+ `apply` optional (parseSchemaType "determinationMethod")+ `apply` optional (parseSchemaType "relativeDate")+ `apply` optional (parseSchemaType "fxSpotRateSource")+ schemaTypeToXML s x@Composite{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "determinationMethod") $ composite_determinationMethod x+ , maybe [] (schemaTypeToXML "relativeDate") $ composite_relativeDate x+ , maybe [] (schemaTypeToXML "fxSpotRateSource") $ composite_fxSpotRateSource x+ ]+ +data CreditEventNotice = CreditEventNotice+ { creditEventNotice_notifyingParty :: Maybe NotifyingParty+ -- ^ Pointer style references to a party identifier defined + -- elsewhere in the document. The notifying party is the party + -- that notifies the other party when a credit event has + -- occurred by means of a credit event notice. If more than + -- one party is referenced as being the notifying party then + -- either party may notify the other of a credit event + -- occurring. ISDA 2003 Term: Notifying Party.+ , creditEventNotice_businessCenter :: Maybe BusinessCenter+ -- ^ Inclusion of this business center element implies that + -- Greenwich Mean Time in Section 3.3 of the 2003 ISDA Credit + -- Derivatives Definitions is replaced by the local time of + -- the city indicated by the businessCenter element value.+ , creditEventNotice_publiclyAvailableInformation :: Maybe PubliclyAvailableInformation+ -- ^ A specified condition to settlement. Publicly available + -- information means information that reasonably confirms any + -- of the facts relevant to determining that a credit event or + -- potential repudiation/moratorium, as applicable, has + -- occurred. The ISDA defined list (2003) is the market + -- standard and is considered comprehensive, and a minimum of + -- two differing public sources must have published the + -- relevant information, to declare a Credit Event. ISDA 2003 + -- Term: Notice of Publicly Available Information Applicable.+ }+ deriving (Eq,Show)+instance SchemaType CreditEventNotice where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CreditEventNotice+ `apply` optional (parseSchemaType "notifyingParty")+ `apply` optional (parseSchemaType "businessCenter")+ `apply` optional (parseSchemaType "publiclyAvailableInformation")+ schemaTypeToXML s x@CreditEventNotice{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "notifyingParty") $ creditEventNotice_notifyingParty x+ , maybe [] (schemaTypeToXML "businessCenter") $ creditEventNotice_businessCenter x+ , maybe [] (schemaTypeToXML "publiclyAvailableInformation") $ creditEventNotice_publiclyAvailableInformation x+ ]+ +data CreditEvents = CreditEvents+ { creditEvents_ID :: Maybe Xsd.ID+ , creditEvents_bankruptcy :: Maybe Xsd.Boolean+ -- ^ A credit event. The reference entity has been dissolved or + -- has become insolvent. It also covers events that may be a + -- precursor to insolvency such as instigation of bankruptcy + -- or insolvency proceedings. Sovereign trades are not subject + -- to Bankruptcy as "technically" a Sovereign cannot become + -- bankrupt. ISDA 2003 Term: Bankruptcy.+ , creditEvents_failureToPay :: Maybe FailureToPay+ -- ^ A credit event. This credit event triggers, after the + -- expiration of any applicable grace period, if the reference + -- entity fails to make due payments in an aggregrate amount + -- of not less than the payment requirement on one or more + -- obligations (e.g. a missed coupon payment). ISDA 2003 Term: + -- Failure to Pay.+ , creditEvents_failureToPayPrincipal :: Maybe Xsd.Boolean+ -- ^ A credit event. Corresponds to the failure by the Reference + -- Entity to pay an expected principal amount or the payment + -- of an actual principal amount that is less than the + -- expected principal amount. ISDA 2003 Term: Failure to Pay + -- Principal.+ , creditEvents_failureToPayInterest :: Maybe Xsd.Boolean+ -- ^ A credit event. Corresponds to the failure by the Reference + -- Entity to pay an expected interest amount or the payment of + -- an actual interest amount that is less than the expected + -- interest amount. ISDA 2003 Term: Failure to Pay Interest.+ , creditEvents_obligationDefault :: Maybe Xsd.Boolean+ -- ^ A credit event. One or more of the obligations have become + -- capable of being declared due and payable before they would + -- otherwise have been due and payable as a result of, or on + -- the basis of, the occurrence of a default, event of default + -- or other similar condition or event other than failure to + -- pay. ISDA 2003 Term: Obligation Default.+ , creditEvents_obligationAcceleration :: Maybe Xsd.Boolean+ -- ^ A credit event. One or more of the obligations have been + -- declared due and payable before they would otherwise have + -- been due and payable as a result of, or on the basis of, + -- the occurrence of a default, event of default or other + -- similar condition or event other than failure to pay + -- (preferred by the market over Obligation Default, because + -- more definitive and encompasses the definition of + -- Obligation Default - this is more favorable to the Seller). + -- Subject to the default requirement amount. ISDA 2003 Term: + -- Obligation Acceleration.+ , creditEvents_repudiationMoratorium :: Maybe Xsd.Boolean+ -- ^ A credit event. The reference entity, or a governmental + -- authority, either refuses to recognise or challenges the + -- validity of one or more obligations of the reference + -- entity, or imposes a moratorium thereby postponing payments + -- on one or more of the obligations of the reference entity. + -- Subject to the default requirement amount. ISDA 2003 Term: + -- Repudiation/Moratorium.+ , creditEvents_restructuring :: Maybe Restructuring+ -- ^ A credit event. A restructuring is an event that materially + -- impacts the reference entity's obligations, such as an + -- interest rate reduction, principal reduction, deferral of + -- interest or principal, change in priority ranking, or + -- change in currency or composition of payment. ISDA 2003 + -- Term: Restructuring.+ , creditEvents_distressedRatingsDowngrade :: Maybe Xsd.Boolean+ -- ^ A credit event. Results from the fact that the rating of + -- the reference obligation is downgraded to a distressed + -- rating level. From a usage standpoint, this credit event is + -- typically not applicable in case of RMBS trades.+ , creditEvents_maturityExtension :: Maybe Xsd.Boolean+ -- ^ A credit event. Results from the fact that the underlier + -- fails to make principal payments as expected.+ , creditEvents_writedown :: Maybe Xsd.Boolean+ -- ^ A credit event. Results from the fact that the underlier + -- writes down its outstanding principal amount.+ , creditEvents_impliedWritedown :: Maybe Xsd.Boolean+ -- ^ A credit event. Results from the fact that losses occur to + -- the underlying instruments that do not result in reductions + -- of the outstanding principal of the reference obligation.+ , creditEvents_defaultRequirement :: Maybe Money+ -- ^ In relation to certain credit events, serves as a threshold + -- for Obligation Acceleration, Obligation Default, + -- Repudiation/Moratorium and Restructuring. Market standard + -- is USD 10,000,000 (JPY 1,000,000,000 for all Japanese Yen + -- trades). This is applied on an aggregate or total basis + -- across all Obligations of the Reference Entity. Used to + -- prevent technical/operational errors from triggering credit + -- events. ISDA 2003 Term: Default Requirement.+ , creditEvents_creditEventNotice :: Maybe CreditEventNotice+ -- ^ A specified condition to settlement. An irrevocable written + -- or verbal notice that describes a credit event that has + -- occurred. The notice is sent from the notifying party + -- (either the buyer or the seller) to the counterparty. It + -- provides information relevant to determining that a credit + -- event has occurred. This is typically accompanied by + -- Publicly Available Information. ISDA 2003 Term: Credit + -- Event Notice.+ }+ deriving (Eq,Show)+instance SchemaType CreditEvents where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CreditEvents a0)+ `apply` optional (parseSchemaType "bankruptcy")+ `apply` optional (parseSchemaType "failureToPay")+ `apply` optional (parseSchemaType "failureToPayPrincipal")+ `apply` optional (parseSchemaType "failureToPayInterest")+ `apply` optional (parseSchemaType "obligationDefault")+ `apply` optional (parseSchemaType "obligationAcceleration")+ `apply` optional (parseSchemaType "repudiationMoratorium")+ `apply` optional (parseSchemaType "restructuring")+ `apply` optional (parseSchemaType "distressedRatingsDowngrade")+ `apply` optional (parseSchemaType "maturityExtension")+ `apply` optional (parseSchemaType "writedown")+ `apply` optional (parseSchemaType "impliedWritedown")+ `apply` optional (parseSchemaType "defaultRequirement")+ `apply` optional (parseSchemaType "creditEventNotice")+ schemaTypeToXML s x@CreditEvents{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ creditEvents_ID x+ ]+ [ maybe [] (schemaTypeToXML "bankruptcy") $ creditEvents_bankruptcy x+ , maybe [] (schemaTypeToXML "failureToPay") $ creditEvents_failureToPay x+ , maybe [] (schemaTypeToXML "failureToPayPrincipal") $ creditEvents_failureToPayPrincipal x+ , maybe [] (schemaTypeToXML "failureToPayInterest") $ creditEvents_failureToPayInterest x+ , maybe [] (schemaTypeToXML "obligationDefault") $ creditEvents_obligationDefault x+ , maybe [] (schemaTypeToXML "obligationAcceleration") $ creditEvents_obligationAcceleration x+ , maybe [] (schemaTypeToXML "repudiationMoratorium") $ creditEvents_repudiationMoratorium x+ , maybe [] (schemaTypeToXML "restructuring") $ creditEvents_restructuring x+ , maybe [] (schemaTypeToXML "distressedRatingsDowngrade") $ creditEvents_distressedRatingsDowngrade x+ , maybe [] (schemaTypeToXML "maturityExtension") $ creditEvents_maturityExtension x+ , maybe [] (schemaTypeToXML "writedown") $ creditEvents_writedown x+ , maybe [] (schemaTypeToXML "impliedWritedown") $ creditEvents_impliedWritedown x+ , maybe [] (schemaTypeToXML "defaultRequirement") $ creditEvents_defaultRequirement x+ , maybe [] (schemaTypeToXML "creditEventNotice") $ creditEvents_creditEventNotice x+ ]+ +-- | Reference to credit events.+data CreditEventsReference = CreditEventsReference+ { creditEventsRef_href :: Xsd.IDREF+ }+ deriving (Eq,Show)+instance SchemaType CreditEventsReference where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "href" e pos+ commit $ interior e $ return (CreditEventsReference a0)+ schemaTypeToXML s x@CreditEventsReference{} =+ toXMLElement s [ toXMLAttribute "href" $ creditEventsRef_href x+ ]+ []+instance Extension CreditEventsReference Reference where+ supertype v = Reference_CreditEventsReference v+ +data FailureToPay = FailureToPay+ { failureToPay_applicable :: Maybe Xsd.Boolean+ -- ^ Indicates whether the failure to pay provision is + -- applicable.+ , failureToPay_gracePeriodExtension :: Maybe GracePeriodExtension+ -- ^ If this element is specified, indicates whether or not a + -- grace period extension is applicable. ISDA 2003 Term: Grace + -- Period Extension Applicable.+ , failureToPay_paymentRequirement :: Maybe Money+ -- ^ Specifies a threshold for the failure to pay credit event. + -- Market standard is USD 1,000,000 (JPY 100,000,000 for + -- Japanese Yen trades) or its equivalent in the relevant + -- obligation currency. This is applied on an aggregate basis + -- across all Obligations of the Reference Entity. Intended to + -- prevent technical/operational errors from triggering credit + -- events. ISDA 2003 Term: Payment Requirement.+ }+ deriving (Eq,Show)+instance SchemaType FailureToPay where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FailureToPay+ `apply` optional (parseSchemaType "applicable")+ `apply` optional (parseSchemaType "gracePeriodExtension")+ `apply` optional (parseSchemaType "paymentRequirement")+ schemaTypeToXML s x@FailureToPay{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "applicable") $ failureToPay_applicable x+ , maybe [] (schemaTypeToXML "gracePeriodExtension") $ failureToPay_gracePeriodExtension x+ , maybe [] (schemaTypeToXML "paymentRequirement") $ failureToPay_paymentRequirement x+ ]+ +-- | Payment made following trigger occurence.+data FeaturePayment = FeaturePayment+ { featurePayment_ID :: Maybe Xsd.ID+ , featurePayment_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , featurePayment_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , featurePayment_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , featurePayment_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , featurePayment_choice4 :: (Maybe (OneOf2 Xsd.Decimal NonNegativeDecimal))+ -- ^ Choice between:+ -- + -- (1) The trigger level percentage.+ -- + -- (2) The monetary quantity in currency units.+ , featurePayment_time :: Maybe TimeTypeEnum+ -- ^ The feature payment time.+ , featurePayment_currency :: Maybe Currency+ -- ^ The currency in which an amount is denominated.+ , featurePayment_date :: Maybe AdjustableOrRelativeDate+ -- ^ The feature payment date.+ }+ deriving (Eq,Show)+instance SchemaType FeaturePayment where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (FeaturePayment a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "levelPercentage"))+ , ("NonNegativeDecimal", fmap TwoOf2 (parseSchemaType "amount"))+ ])+ `apply` optional (parseSchemaType "time")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "featurePaymentDate")+ schemaTypeToXML s x@FeaturePayment{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ featurePayment_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ featurePayment_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ featurePayment_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ featurePayment_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ featurePayment_receiverAccountReference x+ , maybe [] (foldOneOf2 (schemaTypeToXML "levelPercentage")+ (schemaTypeToXML "amount")+ ) $ featurePayment_choice4 x+ , maybe [] (schemaTypeToXML "time") $ featurePayment_time x+ , maybe [] (schemaTypeToXML "currency") $ featurePayment_currency x+ , maybe [] (schemaTypeToXML "featurePaymentDate") $ featurePayment_date x+ ]+instance Extension FeaturePayment PaymentBase where+ supertype v = PaymentBase_FeaturePayment v+ +-- | Frequency Type.+data FrequencyType = FrequencyType Scheme FrequencyTypeAttributes deriving (Eq,Show)+data FrequencyTypeAttributes = FrequencyTypeAttributes+ { frequTypeAttrib_frequencyTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType FrequencyType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "frequencyTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ FrequencyType v (FrequencyTypeAttributes a0)+ schemaTypeToXML s (FrequencyType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "frequencyTypeScheme") $ frequTypeAttrib_frequencyTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension FrequencyType Scheme where+ supertype (FrequencyType s _) = s+ +-- | A type for defining Fx Features.+data FxFeature = FxFeature+ { fxFeature_referenceCurrency :: Maybe IdentifiedCurrency+ -- ^ Specifies the reference currency of the trade.+ , fxFeature_choice1 :: (Maybe (OneOf3 Composite Quanto Composite))+ -- ^ Choice between:+ -- + -- (1) If “Composite” is specified as the Settlement Type + -- in the relevant Transaction Supplement, an amount in + -- the Settlement Currency, determined by the Calculation + -- Agent as being equal to the number of Options exercised + -- or deemed exercised, multiplied by: (Settlement Price + -- – Strike Price) / (Strike Price – Settlement Price) + -- x Multiplier provided that if the above is equal to a + -- negative amount the Option Cash Settlement Amount shall + -- be deemed to be zero.+ -- + -- (2) If “Quanto” is specified as the Settlement Type in + -- the relevant Transaction Supplement, an amount, as + -- determined by the Calculation Agent in accordance with + -- the Section 8.2 of the Equity Definitions.+ -- + -- (3) If “Cross-Currency” is specified as the Settlement + -- Type in the relevant Transaction Supplement, an amount + -- in the Settlement Currency, determined by the + -- Calculation Agent as being equal to the number of + -- Options exercised or deemed exercised, multiplied by: + -- (Settlement Price – Strike Price) / (Strike Price – + -- Settlement Price) x Multiplier x one unit of the + -- Reference Currency converted into an amount in the + -- Settlement Currency using the rate of exchange of the + -- Settlement Currency as quoted on the Reference Price + -- Source on the Valuation Date, provided that if the + -- above is equal to a negative amount the Option Cash + -- Settlement Amount shall be deemed to be zero.+ }+ deriving (Eq,Show)+instance SchemaType FxFeature where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return FxFeature+ `apply` optional (parseSchemaType "referenceCurrency")+ `apply` optional (oneOf' [ ("Composite", fmap OneOf3 (parseSchemaType "composite"))+ , ("Quanto", fmap TwoOf3 (parseSchemaType "quanto"))+ , ("Composite", fmap ThreeOf3 (parseSchemaType "crossCurrency"))+ ])+ schemaTypeToXML s x@FxFeature{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "referenceCurrency") $ fxFeature_referenceCurrency x+ , maybe [] (foldOneOf3 (schemaTypeToXML "composite")+ (schemaTypeToXML "quanto")+ (schemaTypeToXML "crossCurrency")+ ) $ fxFeature_choice1 x+ ]+ +data GracePeriodExtension = GracePeriodExtension+ { gracePeriodExtens_applicable :: Maybe Xsd.Boolean+ -- ^ Indicates whether the grace period extension provision is + -- applicable.+ , gracePeriodExtens_gracePeriod :: Maybe Offset+ -- ^ The number of calendar or business days after any due date + -- that the reference entity has to fulfil its obligations + -- before a failure to pay credit event is deemed to have + -- occurred. ISDA 2003 Term: Grace Period.+ }+ deriving (Eq,Show)+instance SchemaType GracePeriodExtension where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return GracePeriodExtension+ `apply` optional (parseSchemaType "applicable")+ `apply` optional (parseSchemaType "gracePeriod")+ schemaTypeToXML s x@GracePeriodExtension{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "applicable") $ gracePeriodExtens_applicable x+ , maybe [] (schemaTypeToXML "gracePeriod") $ gracePeriodExtens_gracePeriod x+ ]+ +-- | Knock In means option to exercise comes into existence. +-- Knock Out means option to exercise goes out of existence.+data Knock = Knock+ { knock_in :: Maybe TriggerEvent+ -- ^ The knock in.+ , knock_out :: Maybe TriggerEvent+ -- ^ The knock out.+ }+ deriving (Eq,Show)+instance SchemaType Knock where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Knock+ `apply` optional (parseSchemaType "knockIn")+ `apply` optional (parseSchemaType "knockOut")+ schemaTypeToXML s x@Knock{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "knockIn") $ knock_in x+ , maybe [] (schemaTypeToXML "knockOut") $ knock_out x+ ]+ +-- | Defines the handling of an averaging date market disruption +-- for an equity derivative transaction.+data MarketDisruption = MarketDisruption Scheme MarketDisruptionAttributes deriving (Eq,Show)+data MarketDisruptionAttributes = MarketDisruptionAttributes+ { marketDisrupAttrib_marketDisruptionScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType MarketDisruption where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "marketDisruptionScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ MarketDisruption v (MarketDisruptionAttributes a0)+ schemaTypeToXML s (MarketDisruption bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "marketDisruptionScheme") $ marketDisrupAttrib_marketDisruptionScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension MarketDisruption Scheme where+ supertype (MarketDisruption s _) = s+ +data NotifyingParty = NotifyingParty+ { notifParty_buyerPartyReference :: Maybe PartyReference+ , notifParty_sellerPartyReference :: Maybe PartyReference+ }+ deriving (Eq,Show)+instance SchemaType NotifyingParty where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return NotifyingParty+ `apply` optional (parseSchemaType "buyerPartyReference")+ `apply` optional (parseSchemaType "sellerPartyReference")+ schemaTypeToXML s x@NotifyingParty{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "buyerPartyReference") $ notifParty_buyerPartyReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ notifParty_sellerPartyReference x+ ]+ +-- | A type for defining the common features of options.+data Option+ = Option_OptionBase OptionBase+ | Option_FxOption FxOption+ | Option_FxDigitalOption FxDigitalOption+ + deriving (Eq,Show)+instance SchemaType Option where+ parseSchemaType s = do+ (fmap Option_OptionBase $ parseSchemaType s)+ `onFail`+ (fmap Option_FxOption $ parseSchemaType s)+ `onFail`+ (fmap Option_FxDigitalOption $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of Option,\n\+\ namely one of:\n\+\OptionBase,FxOption,FxDigitalOption"+ schemaTypeToXML _s (Option_OptionBase x) = schemaTypeToXML "optionBase" x+ schemaTypeToXML _s (Option_FxOption x) = schemaTypeToXML "fxOption" x+ schemaTypeToXML _s (Option_FxDigitalOption x) = schemaTypeToXML "fxDigitalOption" x+instance Extension Option Product where+ supertype v = Product_Option v+ +-- | A type for defining the common features of options.+data OptionBase+ = OptionBase_OptionBaseExtended OptionBaseExtended+ | OptionBase_VarianceOptionTransactionSupplement VarianceOptionTransactionSupplement+ + deriving (Eq,Show)+instance SchemaType OptionBase where+ parseSchemaType s = do+ (fmap OptionBase_OptionBaseExtended $ parseSchemaType s)+ `onFail`+ (fmap OptionBase_VarianceOptionTransactionSupplement $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of OptionBase,\n\+\ namely one of:\n\+\OptionBaseExtended,VarianceOptionTransactionSupplement"+ schemaTypeToXML _s (OptionBase_OptionBaseExtended x) = schemaTypeToXML "optionBaseExtended" x+ schemaTypeToXML _s (OptionBase_VarianceOptionTransactionSupplement x) = schemaTypeToXML "varianceOptionTransactionSupplement" x+instance Extension OptionBase Option where+ supertype v = Option_OptionBase v+ +-- | Base type for options starting with the 4-3 release, until +-- we refactor the schema as part of the 5-0 release series.+data OptionBaseExtended+ = OptionBaseExtended_CreditDefaultSwapOption CreditDefaultSwapOption+ | OptionBaseExtended_BondOption BondOption+ + deriving (Eq,Show)+instance SchemaType OptionBaseExtended where+ parseSchemaType s = do+ (fmap OptionBaseExtended_CreditDefaultSwapOption $ parseSchemaType s)+ `onFail`+ (fmap OptionBaseExtended_BondOption $ parseSchemaType s)+ `onFail` fail "Parse failed when expecting an extension type of OptionBaseExtended,\n\+\ namely one of:\n\+\CreditDefaultSwapOption,BondOption"+ schemaTypeToXML _s (OptionBaseExtended_CreditDefaultSwapOption x) = schemaTypeToXML "creditDefaultSwapOption" x+ schemaTypeToXML _s (OptionBaseExtended_BondOption x) = schemaTypeToXML "bondOption" x+instance Extension OptionBaseExtended OptionBase where+ supertype v = OptionBase_OptionBaseExtended v+ +-- | A type for defining option features.+data OptionFeature = OptionFeature+ { optionFeature_fxFeature :: Maybe FxFeature+ -- ^ A quanto or composite FX feature.+ , optionFeature_strategyFeature :: Maybe StrategyFeature+ -- ^ A simple strategy feature.+ , optionFeature_asian :: Maybe Asian+ -- ^ An option where and average price is taken on valuation.+ , optionFeature_barrier :: Maybe Barrier+ -- ^ An option with a barrier feature.+ , optionFeature_knock :: Maybe Knock+ -- ^ A knock feature.+ , optionFeature_passThrough :: Maybe PassThrough+ -- ^ Pass through payments from the underlyer, such as + -- dividends.+ }+ deriving (Eq,Show)+instance SchemaType OptionFeature where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OptionFeature+ `apply` optional (parseSchemaType "fxFeature")+ `apply` optional (parseSchemaType "strategyFeature")+ `apply` optional (parseSchemaType "asian")+ `apply` optional (parseSchemaType "barrier")+ `apply` optional (parseSchemaType "knock")+ `apply` optional (parseSchemaType "passThrough")+ schemaTypeToXML s x@OptionFeature{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "fxFeature") $ optionFeature_fxFeature x+ , maybe [] (schemaTypeToXML "strategyFeature") $ optionFeature_strategyFeature x+ , maybe [] (schemaTypeToXML "asian") $ optionFeature_asian x+ , maybe [] (schemaTypeToXML "barrier") $ optionFeature_barrier x+ , maybe [] (schemaTypeToXML "knock") $ optionFeature_knock x+ , maybe [] (schemaTypeToXML "passThrough") $ optionFeature_passThrough x+ ]+ +-- | A type for defining the strike price for an option as a +-- numeric value without currency.+data OptionNumericStrike = OptionNumericStrike+ { optionNumericStrike_choice0 :: (Maybe (OneOf2 Xsd.Decimal Xsd.Decimal))+ -- ^ Choice between:+ -- + -- (1) The price or level at which the option has been struck.+ -- + -- (2) The price or level expressed as a percentage of the + -- forward starting spot price.+ }+ deriving (Eq,Show)+instance SchemaType OptionNumericStrike where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OptionNumericStrike+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "strikePrice"))+ , ("Xsd.Decimal", fmap TwoOf2 (parseSchemaType "strikePercentage"))+ ])+ schemaTypeToXML s x@OptionNumericStrike{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "strikePrice")+ (schemaTypeToXML "strikePercentage")+ ) $ optionNumericStrike_choice0 x+ ]+ +-- | A type for defining the strike price for an equity option. +-- The strike price is either: (i) in respect of an index +-- option transaction, the level of the relevant index +-- specified or otherwise determined in the transaction; or +-- (ii) in respect of a share option transaction, the price +-- per share specified or otherwise determined in the +-- transaction. This can be expressed either as a percentage +-- of notional amount or as an absolute value.+data OptionStrike = OptionStrike+ { optionStrike_choice0 :: (Maybe (OneOf2 Xsd.Decimal Xsd.Decimal))+ -- ^ Choice between:+ -- + -- (1) The price or level at which the option has been struck.+ -- + -- (2) The price or level expressed as a percentage of the + -- forward starting spot price.+ , optionStrike_currency :: Maybe Currency+ -- ^ The currency in which an amount is denominated.+ }+ deriving (Eq,Show)+instance SchemaType OptionStrike where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return OptionStrike+ `apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "strikePrice"))+ , ("Xsd.Decimal", fmap TwoOf2 (parseSchemaType "strikePercentage"))+ ])+ `apply` optional (parseSchemaType "currency")+ schemaTypeToXML s x@OptionStrike{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "strikePrice")+ (schemaTypeToXML "strikePercentage")+ ) $ optionStrike_choice0 x+ , maybe [] (schemaTypeToXML "currency") $ optionStrike_currency x+ ]+instance Extension OptionStrike OptionNumericStrike where+ supertype (OptionStrike e0 e1) =+ OptionNumericStrike e0+ +-- | Type which contains pass through payments.+data PassThrough = PassThrough+ { passThrough_item :: [PassThroughItem]+ -- ^ One to many pass through payment items.+ }+ deriving (Eq,Show)+instance SchemaType PassThrough where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PassThrough+ `apply` many (parseSchemaType "passThroughItem")+ schemaTypeToXML s x@PassThrough{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "passThroughItem") $ passThrough_item x+ ]+ +-- | Type to represent a single pass through payment.+data PassThroughItem = PassThroughItem+ { passThroughItem_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , passThroughItem_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , passThroughItem_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , passThroughItem_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , passThroughItem_underlyerReference :: Maybe AssetReference+ -- ^ Reference to the underlyer whose payments are being passed + -- through.+ , passThroughItem_passThroughPercentage :: Maybe Xsd.Decimal+ -- ^ Percentage of payments from the underlyer which are passed + -- through.+ }+ deriving (Eq,Show)+instance SchemaType PassThroughItem where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PassThroughItem+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "underlyerReference")+ `apply` optional (parseSchemaType "passThroughPercentage")+ schemaTypeToXML s x@PassThroughItem{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ passThroughItem_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ passThroughItem_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ passThroughItem_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ passThroughItem_receiverAccountReference x+ , maybe [] (schemaTypeToXML "underlyerReference") $ passThroughItem_underlyerReference x+ , maybe [] (schemaTypeToXML "passThroughPercentage") $ passThroughItem_passThroughPercentage x+ ]+ +-- | A type for defining a premium.+data Premium = Premium+ { premium_ID :: Maybe Xsd.ID+ , premium_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , premium_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , premium_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , premium_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , premium_paymentAmount :: Maybe NonNegativeMoney+ , premium_paymentDate :: Maybe AdjustableOrRelativeDate+ -- ^ The payment date. This date is subject to adjustment in + -- accordance with any applicable business day convention.+ , premium_type :: Maybe PremiumTypeEnum+ -- ^ Forward start Premium type+ , premium_pricePerOption :: Maybe Money+ -- ^ The amount of premium to be paid expressed as a function of + -- the number of options.+ , premium_percentageOfNotional :: Maybe Xsd.Decimal+ -- ^ The amount of premium to be paid expressed as a percentage + -- of the notional value of the transaction. A percentage of + -- 5% would be expressed as 0.05.+ , premium_discountFactor :: Maybe Xsd.Decimal+ -- ^ The value representing the discount factor used to + -- calculate the present value of the cash flow.+ , premium_presentValueAmount :: Maybe Money+ -- ^ The amount representing the present value of the forecast + -- payment.+ }+ deriving (Eq,Show)+instance SchemaType Premium where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Premium a0)+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "paymentAmount")+ `apply` optional (parseSchemaType "paymentDate")+ `apply` optional (parseSchemaType "premiumType")+ `apply` optional (parseSchemaType "pricePerOption")+ `apply` optional (parseSchemaType "percentageOfNotional")+ `apply` optional (parseSchemaType "discountFactor")+ `apply` optional (parseSchemaType "presentValueAmount")+ schemaTypeToXML s x@Premium{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ premium_ID x+ ]+ [ maybe [] (schemaTypeToXML "payerPartyReference") $ premium_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ premium_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ premium_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ premium_receiverAccountReference x+ , maybe [] (schemaTypeToXML "paymentAmount") $ premium_paymentAmount x+ , maybe [] (schemaTypeToXML "paymentDate") $ premium_paymentDate x+ , maybe [] (schemaTypeToXML "premiumType") $ premium_type x+ , maybe [] (schemaTypeToXML "pricePerOption") $ premium_pricePerOption x+ , maybe [] (schemaTypeToXML "percentageOfNotional") $ premium_percentageOfNotional x+ , maybe [] (schemaTypeToXML "discountFactor") $ premium_discountFactor x+ , maybe [] (schemaTypeToXML "presentValueAmount") $ premium_presentValueAmount x+ ]+instance Extension Premium SimplePayment where+ supertype (Premium a0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10) =+ SimplePayment a0 e0 e1 e2 e3 e4 e5+instance Extension Premium PaymentBase where+ supertype = (supertype :: SimplePayment -> PaymentBase)+ . (supertype :: Premium -> SimplePayment)+ + +data PubliclyAvailableInformation = PubliclyAvailableInformation+ { publicAvailInfo_standardPublicSources :: Maybe Xsd.Boolean+ -- ^ If this element is specified and set to 'true', indicates + -- that ISDA defined Standard Public Sources are applicable.+ , publicAvailInfo_publicSource :: [Xsd.XsdString]+ -- ^ A public information source, e.g. a particular newspaper or + -- electronic news service, that may publish relevant + -- information used in the determination of whether or not a + -- credit event has occurred. ISDA 2003 Term: Public Source.+ , publicAvailInfo_specifiedNumber :: Maybe Xsd.PositiveInteger+ -- ^ The minimum number of the specified public information + -- sources that must publish information that reasonably + -- confirms that a credit event has occurred. The market + -- convention is two. ISDA 2003 Term: Specified Number.+ }+ deriving (Eq,Show)+instance SchemaType PubliclyAvailableInformation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PubliclyAvailableInformation+ `apply` optional (parseSchemaType "standardPublicSources")+ `apply` many (parseSchemaType "publicSource")+ `apply` optional (parseSchemaType "specifiedNumber")+ schemaTypeToXML s x@PubliclyAvailableInformation{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "standardPublicSources") $ publicAvailInfo_standardPublicSources x+ , concatMap (schemaTypeToXML "publicSource") $ publicAvailInfo_publicSource x+ , maybe [] (schemaTypeToXML "specifiedNumber") $ publicAvailInfo_specifiedNumber x+ ]+ +-- | Determines the currency rate that the seller of the equity +-- amounts will apply at each valuation date for converting +-- the respective amounts into a currency that is different +-- from the currency denomination of the underlyer.+data Quanto = Quanto+ { quanto_fxRate :: [FxRate]+ -- ^ Specifies a currency conversion rate.+ , quanto_fxSpotRateSource :: Maybe FxSpotRateSource+ -- ^ Specifies the methodology (reference source and, + -- optionally, fixing time) to be used for determining a + -- currency conversion rate.+ }+ deriving (Eq,Show)+instance SchemaType Quanto where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Quanto+ `apply` many (parseSchemaType "fxRate")+ `apply` optional (parseSchemaType "fxSpotRateSource")+ schemaTypeToXML s x@Quanto{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "fxRate") $ quanto_fxRate x+ , maybe [] (schemaTypeToXML "fxSpotRateSource") $ quanto_fxSpotRateSource x+ ]+ +data Restructuring = Restructuring+ { restr_applicable :: Maybe Xsd.Boolean+ -- ^ Indicates whether the restructuring provision is + -- applicable.+ , restructuring_type :: Maybe RestructuringType+ -- ^ Specifies the type of restructuring that is applicable.+ , restr_multipleHolderObligation :: Maybe Xsd.Boolean+ -- ^ In relation to a restructuring credit event, unless + -- multiple holder obligation is not specified restructurings + -- are limited to multiple holder obligations. A multiple + -- holder obligation means an obligation that is held by more + -- than three holders that are not affiliates of each other + -- and where at least two thirds of the holders must agree to + -- the event that constitutes the restructuring credit event. + -- ISDA 2003 Term: Multiple Holder Obligation.+ , restr_multipleCreditEventNotices :: Maybe Xsd.Boolean+ -- ^ Presence of this element and value set to 'true' indicates + -- that Section 3.9 of the 2003 Credit Derivatives Definitions + -- shall apply. Absence of this element indicates that Section + -- 3.9 shall not apply. NOTE: Not allowed under ISDA Credit + -- 1999.+ }+ deriving (Eq,Show)+instance SchemaType Restructuring where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Restructuring+ `apply` optional (parseSchemaType "applicable")+ `apply` optional (parseSchemaType "restructuringType")+ `apply` optional (parseSchemaType "multipleHolderObligation")+ `apply` optional (parseSchemaType "multipleCreditEventNotices")+ schemaTypeToXML s x@Restructuring{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "applicable") $ restr_applicable x+ , maybe [] (schemaTypeToXML "restructuringType") $ restructuring_type x+ , maybe [] (schemaTypeToXML "multipleHolderObligation") $ restr_multipleHolderObligation x+ , maybe [] (schemaTypeToXML "multipleCreditEventNotices") $ restr_multipleCreditEventNotices x+ ]+ +data RestructuringType = RestructuringType Scheme RestructuringTypeAttributes deriving (Eq,Show)+data RestructuringTypeAttributes = RestructuringTypeAttributes+ { restrTypeAttrib_restructuringScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType RestructuringType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "restructuringScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ RestructuringType v (RestructuringTypeAttributes a0)+ schemaTypeToXML s (RestructuringType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "restructuringScheme") $ restrTypeAttrib_restructuringScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension RestructuringType Scheme where+ supertype (RestructuringType s _) = s+ +-- | A type for definining equity option simple strike or +-- calendar spread strategy features.+data StrategyFeature = StrategyFeature+ { stratFeature_choice0 :: (Maybe (OneOf2 StrikeSpread CalendarSpread))+ -- ^ Choice between:+ -- + -- (1) Definition of the upper strike in a strike spread.+ -- + -- (2) Definition of the later expiration date in a calendar + -- spread.+ }+ deriving (Eq,Show)+instance SchemaType StrategyFeature where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return StrategyFeature+ `apply` optional (oneOf' [ ("StrikeSpread", fmap OneOf2 (parseSchemaType "strikeSpread"))+ , ("CalendarSpread", fmap TwoOf2 (parseSchemaType "calendarSpread"))+ ])+ schemaTypeToXML s x@StrategyFeature{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "strikeSpread")+ (schemaTypeToXML "calendarSpread")+ ) $ stratFeature_choice0 x+ ]+ +-- | A type for defining a strike spread feature.+data StrikeSpread = StrikeSpread+ { strikeSpread_upperStrike :: Maybe OptionStrike+ -- ^ Upper strike in a strike spread.+ , strikeSpread_upperStrikeNumberOfOptions :: Maybe PositiveDecimal+ -- ^ Number of options at the upper strike price in a strike + -- spread.+ }+ deriving (Eq,Show)+instance SchemaType StrikeSpread where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return StrikeSpread+ `apply` optional (parseSchemaType "upperStrike")+ `apply` optional (parseSchemaType "upperStrikeNumberOfOptions")+ schemaTypeToXML s x@StrikeSpread{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "upperStrike") $ strikeSpread_upperStrike x+ , maybe [] (schemaTypeToXML "upperStrikeNumberOfOptions") $ strikeSpread_upperStrikeNumberOfOptions x+ ]+ +-- | Trigger point at which feature is effective.+data Trigger = Trigger+ { trigger_choice0 :: OneOf3 Xsd.Decimal Xsd.Decimal ((Maybe (OneOf2 CreditEvents CreditEventsReference)))+ -- ^ Choice between:+ -- + -- (1) The trigger level.+ -- + -- (2) The trigger level percentage.+ -- + -- (3) Choice between either an explicit representation of + -- Credit Events, or Credit Events defined elsewhere in + -- the document.+ , trigger_type :: Maybe TriggerTypeEnum+ -- ^ The Triggering condition.+ , trigger_timeType :: Maybe TriggerTimeTypeEnum+ -- ^ The valuation time type of knock condition.+ }+ deriving (Eq,Show)+instance SchemaType Trigger where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Trigger+ `apply` oneOf' [ ("Xsd.Decimal", fmap OneOf3 (parseSchemaType "level"))+ , ("Xsd.Decimal", fmap TwoOf3 (parseSchemaType "levelPercentage"))+ , ("(Maybe (OneOf2 CreditEvents CreditEventsReference))", fmap ThreeOf3 (optional (oneOf' [ ("CreditEvents", fmap OneOf2 (parseSchemaType "creditEvents"))+ , ("CreditEventsReference", fmap TwoOf2 (parseSchemaType "creditEventsReference"))+ ])))+ ]+ `apply` optional (parseSchemaType "triggerType")+ `apply` optional (parseSchemaType "triggerTimeType")+ schemaTypeToXML s x@Trigger{} =+ toXMLElement s []+ [ foldOneOf3 (schemaTypeToXML "level")+ (schemaTypeToXML "levelPercentage")+ (maybe [] (foldOneOf2 (schemaTypeToXML "creditEvents")+ (schemaTypeToXML "creditEventsReference")+ ))+ $ trigger_choice0 x+ , maybe [] (schemaTypeToXML "triggerType") $ trigger_type x+ , maybe [] (schemaTypeToXML "triggerTimeType") $ trigger_timeType x+ ]+ +-- | Observation point for trigger.+data TriggerEvent = TriggerEvent+ { triggerEvent_schedule :: [AveragingSchedule]+ -- ^ A Equity Derivative schedule.+ , triggerEvent_triggerDates :: Maybe DateList+ -- ^ The trigger Dates.+ , triggerEvent_trigger :: Maybe Trigger+ -- ^ The trigger level.+ , triggerEvent_featurePayment :: Maybe FeaturePayment+ -- ^ The feature payment.+ }+ deriving (Eq,Show)+instance SchemaType TriggerEvent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return TriggerEvent+ `apply` many (parseSchemaType "schedule")+ `apply` optional (parseSchemaType "triggerDates")+ `apply` optional (parseSchemaType "trigger")+ `apply` optional (parseSchemaType "featurePayment")+ schemaTypeToXML s x@TriggerEvent{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "schedule") $ triggerEvent_schedule x+ , maybe [] (schemaTypeToXML "triggerDates") $ triggerEvent_triggerDates x+ , maybe [] (schemaTypeToXML "trigger") $ triggerEvent_trigger x+ , maybe [] (schemaTypeToXML "featurePayment") $ triggerEvent_featurePayment x+ ]+ +-- | A single weighted averaging observation.+data WeightedAveragingObservation = WeightedAveragingObservation+ { weightAveragObserv_choice0 :: (Maybe (OneOf2 Xsd.DateTime Xsd.PositiveInteger))+ -- ^ Choice between date times for literal date values, and + -- observation numbers for schedule generated observations.+ -- + -- Choice between:+ -- + -- (1) Observation date time, which should be used when + -- literal observation dates are required.+ -- + -- (2) Observation number, which should be unique, within a + -- series generated by a date schedule.+ , weightAveragObserv_weight :: Maybe NonNegativeDecimal+ -- ^ Observation weight, which is used as a multiplier for the + -- observation value.+ }+ deriving (Eq,Show)+instance SchemaType WeightedAveragingObservation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return WeightedAveragingObservation+ `apply` optional (oneOf' [ ("Xsd.DateTime", fmap OneOf2 (parseSchemaType "dateTime"))+ , ("Xsd.PositiveInteger", fmap TwoOf2 (parseSchemaType "observationNumber"))+ ])+ `apply` optional (parseSchemaType "weight")+ schemaTypeToXML s x@WeightedAveragingObservation{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "dateTime")+ (schemaTypeToXML "observationNumber")+ ) $ weightAveragObserv_choice0 x+ , maybe [] (schemaTypeToXML "weight") $ weightAveragObserv_weight x+ ]+ + + +
@@ -0,0 +1,269 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Shared.Option+ ( module Data.FpML.V53.Shared.Option+ , 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 qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Asset+ +-- | As per ISDA 2002 Definitions. +data Asian+instance Eq Asian+instance Show Asian+instance SchemaType Asian+ +-- | An un ordered list of weighted averaging observations. +data AveragingObservationList+instance Eq AveragingObservationList+instance Show AveragingObservationList+instance SchemaType AveragingObservationList+ +-- | Period over which an average value is taken. +data AveragingPeriod+instance Eq AveragingPeriod+instance Show AveragingPeriod+instance SchemaType AveragingPeriod+ +-- | Method of generating a series of dates. +data AveragingSchedule+instance Eq AveragingSchedule+instance Show AveragingSchedule+instance SchemaType AveragingSchedule+ +-- | As per ISDA 2002 Definitions. +data Barrier+instance Eq Barrier+instance Show Barrier+instance SchemaType Barrier+ +-- | A type for defining a calendar spread feature. +data CalendarSpread+instance Eq CalendarSpread+instance Show CalendarSpread+instance SchemaType CalendarSpread+ +-- | A classified non negative payment. +data ClassifiedPayment+instance Eq ClassifiedPayment+instance Show ClassifiedPayment+instance SchemaType ClassifiedPayment+instance Extension ClassifiedPayment NonNegativePayment+instance Extension ClassifiedPayment PaymentBaseExtended+instance Extension ClassifiedPayment PaymentBase+ +-- | Specifies the conditions to be applied for converting into +-- a reference currency when the actual currency rate is not +-- determined upfront. +data Composite+instance Eq Composite+instance Show Composite+instance SchemaType Composite+ +data CreditEventNotice+instance Eq CreditEventNotice+instance Show CreditEventNotice+instance SchemaType CreditEventNotice+ +data CreditEvents+instance Eq CreditEvents+instance Show CreditEvents+instance SchemaType CreditEvents+ +-- | Reference to credit events. +data CreditEventsReference+instance Eq CreditEventsReference+instance Show CreditEventsReference+instance SchemaType CreditEventsReference+instance Extension CreditEventsReference Reference+ +data FailureToPay+instance Eq FailureToPay+instance Show FailureToPay+instance SchemaType FailureToPay+ +-- | Payment made following trigger occurence. +data FeaturePayment+instance Eq FeaturePayment+instance Show FeaturePayment+instance SchemaType FeaturePayment+instance Extension FeaturePayment PaymentBase+ +-- | Frequency Type. +data FrequencyType+data FrequencyTypeAttributes+instance Eq FrequencyType+instance Eq FrequencyTypeAttributes+instance Show FrequencyType+instance Show FrequencyTypeAttributes+instance SchemaType FrequencyType+instance Extension FrequencyType Scheme+ +-- | A type for defining Fx Features. +data FxFeature+instance Eq FxFeature+instance Show FxFeature+instance SchemaType FxFeature+ +data GracePeriodExtension+instance Eq GracePeriodExtension+instance Show GracePeriodExtension+instance SchemaType GracePeriodExtension+ +-- | Knock In means option to exercise comes into existence. +-- Knock Out means option to exercise goes out of existence. +data Knock+instance Eq Knock+instance Show Knock+instance SchemaType Knock+ +-- | Defines the handling of an averaging date market disruption +-- for an equity derivative transaction. +data MarketDisruption+data MarketDisruptionAttributes+instance Eq MarketDisruption+instance Eq MarketDisruptionAttributes+instance Show MarketDisruption+instance Show MarketDisruptionAttributes+instance SchemaType MarketDisruption+instance Extension MarketDisruption Scheme+ +data NotifyingParty+instance Eq NotifyingParty+instance Show NotifyingParty+instance SchemaType NotifyingParty+ +-- | A type for defining the common features of options. +data Option+instance Eq Option+instance Show Option+instance SchemaType Option+instance Extension Option Product+ +-- | A type for defining the common features of options. +data OptionBase+instance Eq OptionBase+instance Show OptionBase+instance SchemaType OptionBase+instance Extension OptionBase Option+ +-- | Base type for options starting with the 4-3 release, until +-- we refactor the schema as part of the 5-0 release series. +data OptionBaseExtended+instance Eq OptionBaseExtended+instance Show OptionBaseExtended+instance SchemaType OptionBaseExtended+instance Extension OptionBaseExtended OptionBase+ +-- | A type for defining option features. +data OptionFeature+instance Eq OptionFeature+instance Show OptionFeature+instance SchemaType OptionFeature+ +-- | A type for defining the strike price for an option as a +-- numeric value without currency. +data OptionNumericStrike+instance Eq OptionNumericStrike+instance Show OptionNumericStrike+instance SchemaType OptionNumericStrike+ +-- | A type for defining the strike price for an equity option. +-- The strike price is either: (i) in respect of an index +-- option transaction, the level of the relevant index +-- specified or otherwise determined in the transaction; or +-- (ii) in respect of a share option transaction, the price +-- per share specified or otherwise determined in the +-- transaction. This can be expressed either as a percentage +-- of notional amount or as an absolute value. +data OptionStrike+instance Eq OptionStrike+instance Show OptionStrike+instance SchemaType OptionStrike+instance Extension OptionStrike OptionNumericStrike+ +-- | Type which contains pass through payments. +data PassThrough+instance Eq PassThrough+instance Show PassThrough+instance SchemaType PassThrough+ +-- | Type to represent a single pass through payment. +data PassThroughItem+instance Eq PassThroughItem+instance Show PassThroughItem+instance SchemaType PassThroughItem+ +-- | A type for defining a premium. +data Premium+instance Eq Premium+instance Show Premium+instance SchemaType Premium+instance Extension Premium SimplePayment+instance Extension Premium PaymentBase+ +data PubliclyAvailableInformation+instance Eq PubliclyAvailableInformation+instance Show PubliclyAvailableInformation+instance SchemaType PubliclyAvailableInformation+ +-- | Determines the currency rate that the seller of the equity +-- amounts will apply at each valuation date for converting +-- the respective amounts into a currency that is different +-- from the currency denomination of the underlyer. +data Quanto+instance Eq Quanto+instance Show Quanto+instance SchemaType Quanto+ +data Restructuring+instance Eq Restructuring+instance Show Restructuring+instance SchemaType Restructuring+ +data RestructuringType+data RestructuringTypeAttributes+instance Eq RestructuringType+instance Eq RestructuringTypeAttributes+instance Show RestructuringType+instance Show RestructuringTypeAttributes+instance SchemaType RestructuringType+instance Extension RestructuringType Scheme+ +-- | A type for definining equity option simple strike or +-- calendar spread strategy features. +data StrategyFeature+instance Eq StrategyFeature+instance Show StrategyFeature+instance SchemaType StrategyFeature+ +-- | A type for defining a strike spread feature. +data StrikeSpread+instance Eq StrikeSpread+instance Show StrikeSpread+instance SchemaType StrikeSpread+ +-- | Trigger point at which feature is effective. +data Trigger+instance Eq Trigger+instance Show Trigger+instance SchemaType Trigger+ +-- | Observation point for trigger. +data TriggerEvent+instance Eq TriggerEvent+instance Show TriggerEvent+instance SchemaType TriggerEvent+ +-- | A single weighted averaging observation. +data WeightedAveragingObservation+instance Eq WeightedAveragingObservation+instance Show WeightedAveragingObservation+instance SchemaType WeightedAveragingObservation+ + + +
+ Data/FpML/V53/Standard.hs view
@@ -0,0 +1,84 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Standard+ ( module Data.FpML.V53.Standard+ , module Data.FpML.V53.Shared+ , 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.Shared+import Data.FpML.V53.Asset+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | A product to represent a standardized OTC derivative +-- transaction whose economics do not need to be fully +-- described using an FpML schema because they are implied by +-- the product ID.+elementStandardProduct :: XMLParser StandardProduct+elementStandardProduct = parseSchemaType "standardProduct"+elementToXMLStandardProduct :: StandardProduct -> [Content ()]+elementToXMLStandardProduct = schemaTypeToXML "standardProduct"+ +-- | Simple product representation providing key information +-- about a variety of different products+data StandardProduct = StandardProduct+ { stdProduct_ID :: Maybe Xsd.ID+ , stdProduct_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , stdProduct_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , stdProduct_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , stdProduct_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , stdProduct_notional :: CashflowNotional+ -- ^ The notional amount that was traded.+ , stdProduct_quote :: [BasicQuotation]+ -- ^ Pricing information for the trade.+ }+ deriving (Eq,Show)+instance SchemaType StandardProduct where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (StandardProduct a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` parseSchemaType "notional"+ `apply` many1 (parseSchemaType "quote")+ schemaTypeToXML s x@StandardProduct{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ stdProduct_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ stdProduct_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ stdProduct_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ stdProduct_productType x+ , concatMap (schemaTypeToXML "productId") $ stdProduct_productId x+ , schemaTypeToXML "notional" $ stdProduct_notional x+ , concatMap (schemaTypeToXML "quote") $ stdProduct_quote x+ ]+instance Extension StandardProduct Product where+ supertype v = Product_StandardProduct v
+ Data/FpML/V53/Standard.hs-boot view
@@ -0,0 +1,28 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Standard+ ( module Data.FpML.V53.Standard+ , module Data.FpML.V53.Shared+ , 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 qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Shared+import {-# SOURCE #-} Data.FpML.V53.Asset+ +-- | A product to represent a standardized OTC derivative +-- transaction whose economics do not need to be fully +-- described using an FpML schema because they are implied by +-- the product ID. +elementStandardProduct :: XMLParser StandardProduct+elementToXMLStandardProduct :: StandardProduct -> [Content ()]+ +-- | Simple product representation providing key information +-- about a variety of different products +data StandardProduct+instance Eq StandardProduct+instance Show StandardProduct+instance SchemaType StandardProduct+instance Extension StandardProduct Product
+ Data/FpML/V53/Swaps/Correlation.hs view
@@ -0,0 +1,252 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Swaps.Correlation+ ( module Data.FpML.V53.Swaps.Correlation+ , module Data.FpML.V53.Shared.EQ+ ) 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+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | Correlation Amount.+data CorrelationAmount = CorrelationAmount+ { correlAmount_calculationDates :: Maybe AdjustableRelativeOrPeriodicDates+ -- ^ Specifies the date on which a calculation or an observation + -- will be performed for the purpose of calculating the + -- amount.+ , correlAmount_observationStartDate :: Maybe AdjustableOrRelativeDate+ -- ^ The start of the period over which observations are made + -- which are used in the calculation Used when the observation + -- start date differs from the trade date such as for forward + -- starting swaps.+ , correlAmount_optionsExchangeDividends :: Maybe Xsd.Boolean+ -- ^ If present and true, then options exchange dividends are + -- applicable.+ , correlAmount_additionalDividends :: Maybe Xsd.Boolean+ -- ^ If present and true, then additional dividends are + -- applicable.+ , correlAmount_allDividends :: Maybe Xsd.Boolean+ -- ^ Represents the European Master Confirmation value of 'All + -- Dividends' which, when applicable, signifies that, for a + -- given Ex-Date, the daily observed Share Price for that day + -- is adjusted (reduced) by the cash dividend and/or the cash + -- value of any non cash dividend per Share (including + -- Extraordinary Dividends) declared by the Issuer.+ , correlAmount_correlation :: Maybe Correlation+ -- ^ Specifies Correlation.+ }+ deriving (Eq,Show)+instance SchemaType CorrelationAmount where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return CorrelationAmount+ `apply` optional (parseSchemaType "calculationDates")+ `apply` optional (parseSchemaType "observationStartDate")+ `apply` optional (parseSchemaType "optionsExchangeDividends")+ `apply` optional (parseSchemaType "additionalDividends")+ `apply` optional (parseSchemaType "allDividends")+ `apply` optional (parseSchemaType "correlation")+ schemaTypeToXML s x@CorrelationAmount{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "calculationDates") $ correlAmount_calculationDates x+ , maybe [] (schemaTypeToXML "observationStartDate") $ correlAmount_observationStartDate x+ , maybe [] (schemaTypeToXML "optionsExchangeDividends") $ correlAmount_optionsExchangeDividends x+ , maybe [] (schemaTypeToXML "additionalDividends") $ correlAmount_additionalDividends x+ , maybe [] (schemaTypeToXML "allDividends") $ correlAmount_allDividends x+ , maybe [] (schemaTypeToXML "correlation") $ correlAmount_correlation x+ ]+instance Extension CorrelationAmount CalculatedAmount where+ supertype v = CalculatedAmount_CorrelationAmount v+ +-- | A type describing return which is driven by a Correlation +-- calculation.+data CorrelationLeg = CorrelationLeg+ { correlLeg_ID :: Maybe Xsd.ID+ , correlLeg_legIdentifier :: [LegIdentifier]+ -- ^ Version aware identification of this leg.+ , correlLeg_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , correlLeg_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , correlLeg_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , correlLeg_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , correlLeg_effectiveDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the effective date of this leg of the swap. When + -- defined in relation to a date specified somewhere else in + -- the document (through the relativeDate component), this + -- element will typically point to the effective date of the + -- other leg of the swap.+ , correlLeg_terminationDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the termination date of this leg of the swap. + -- When defined in relation to a date specified somewhere else + -- in the document (through the relativeDate component), this + -- element will typically point to the termination date of the + -- other leg of the swap.+ , correlLeg_underlyer :: Maybe Underlyer+ -- ^ Specifies the underlyer of the leg.+ , correlLeg_settlementType :: Maybe SettlementTypeEnum+ , correlLeg_settlementDate :: Maybe AdjustableOrRelativeDate+ , correlLeg_choice10 :: (Maybe (OneOf2 Money Currency))+ -- ^ Choice between:+ -- + -- (1) Settlement Amount+ -- + -- (2) Settlement Currency for use where the Settlement Amount + -- cannot be known in advance+ , correlLeg_fxFeature :: Maybe FxFeature+ -- ^ Quanto, Composite, or Cross Currency FX features.+ , correlLeg_valuation :: Maybe EquityValuation+ -- ^ Valuation of the underlyer.+ , correlLeg_amount :: Maybe CorrelationAmount+ -- ^ Specifies, in relation to each Equity Payment Date, the + -- Equity Amount to which the Equity Payment Date relates. + -- Unless otherwise specified, this term has the meaning + -- defined in the ISDA 2002 Equity Derivatives Definitions.+ }+ deriving (Eq,Show)+instance SchemaType CorrelationLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CorrelationLeg a0)+ `apply` many (parseSchemaType "legIdentifier")+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "effectiveDate")+ `apply` optional (parseSchemaType "terminationDate")+ `apply` optional (parseSchemaType "underlyer")+ `apply` optional (parseSchemaType "settlementType")+ `apply` optional (parseSchemaType "settlementDate")+ `apply` optional (oneOf' [ ("Money", fmap OneOf2 (parseSchemaType "settlementAmount"))+ , ("Currency", fmap TwoOf2 (parseSchemaType "settlementCurrency"))+ ])+ `apply` optional (parseSchemaType "fxFeature")+ `apply` optional (parseSchemaType "valuation")+ `apply` optional (parseSchemaType "amount")+ schemaTypeToXML s x@CorrelationLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ correlLeg_ID x+ ]+ [ concatMap (schemaTypeToXML "legIdentifier") $ correlLeg_legIdentifier x+ , maybe [] (schemaTypeToXML "payerPartyReference") $ correlLeg_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ correlLeg_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ correlLeg_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ correlLeg_receiverAccountReference x+ , maybe [] (schemaTypeToXML "effectiveDate") $ correlLeg_effectiveDate x+ , maybe [] (schemaTypeToXML "terminationDate") $ correlLeg_terminationDate x+ , maybe [] (schemaTypeToXML "underlyer") $ correlLeg_underlyer x+ , maybe [] (schemaTypeToXML "settlementType") $ correlLeg_settlementType x+ , maybe [] (schemaTypeToXML "settlementDate") $ correlLeg_settlementDate x+ , maybe [] (foldOneOf2 (schemaTypeToXML "settlementAmount")+ (schemaTypeToXML "settlementCurrency")+ ) $ correlLeg_choice10 x+ , maybe [] (schemaTypeToXML "fxFeature") $ correlLeg_fxFeature x+ , maybe [] (schemaTypeToXML "valuation") $ correlLeg_valuation x+ , maybe [] (schemaTypeToXML "amount") $ correlLeg_amount x+ ]+instance Extension CorrelationLeg DirectionalLegUnderlyerValuation where+ supertype v = DirectionalLegUnderlyerValuation_CorrelationLeg v+instance Extension CorrelationLeg DirectionalLegUnderlyer where+ supertype = (supertype :: DirectionalLegUnderlyerValuation -> DirectionalLegUnderlyer)+ . (supertype :: CorrelationLeg -> DirectionalLegUnderlyerValuation)+ +instance Extension CorrelationLeg DirectionalLeg where+ supertype = (supertype :: DirectionalLegUnderlyer -> DirectionalLeg)+ . (supertype :: DirectionalLegUnderlyerValuation -> DirectionalLegUnderlyer)+ . (supertype :: CorrelationLeg -> DirectionalLegUnderlyerValuation)+ +instance Extension CorrelationLeg Leg where+ supertype = (supertype :: DirectionalLeg -> Leg)+ . (supertype :: DirectionalLegUnderlyer -> DirectionalLeg)+ . (supertype :: DirectionalLegUnderlyerValuation -> DirectionalLegUnderlyer)+ . (supertype :: CorrelationLeg -> DirectionalLegUnderlyerValuation)+ + +-- | A Correlation Swap modelled using a single netted leg.+data CorrelationSwap = CorrelationSwap+ { correlSwap_ID :: Maybe Xsd.ID+ , correlSwap_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , correlSwap_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , correlSwap_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , correlSwap_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , correlSwap_additionalPayment :: [ClassifiedPayment]+ -- ^ Specifies additional payment(s) between the principal + -- parties to the netted swap.+ , correlSwap_extraordinaryEvents :: Maybe ExtraordinaryEvents+ -- ^ Where the underlying is shares, specifies events affecting + -- the issuer of those shares that may require the terms of + -- the transaction to be adjusted.+ , correlSwap_correlationLeg :: Maybe CorrelationLeg+ -- ^ Correlation Leg. Correlation Buyer is deemed to be the + -- Equity Amount Receiver, Correlation Seller is deemed to be + -- the Equity Amount Payer.+ }+ deriving (Eq,Show)+instance SchemaType CorrelationSwap where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (CorrelationSwap a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` many (parseSchemaType "additionalPayment")+ `apply` optional (parseSchemaType "extraordinaryEvents")+ `apply` optional (parseSchemaType "correlationLeg")+ schemaTypeToXML s x@CorrelationSwap{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ correlSwap_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ correlSwap_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ correlSwap_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ correlSwap_productType x+ , concatMap (schemaTypeToXML "productId") $ correlSwap_productId x+ , concatMap (schemaTypeToXML "additionalPayment") $ correlSwap_additionalPayment x+ , maybe [] (schemaTypeToXML "extraordinaryEvents") $ correlSwap_extraordinaryEvents x+ , maybe [] (schemaTypeToXML "correlationLeg") $ correlSwap_correlationLeg x+ ]+instance Extension CorrelationSwap NettedSwapBase where+ supertype v = NettedSwapBase_CorrelationSwap v+instance Extension CorrelationSwap Product where+ supertype = (supertype :: NettedSwapBase -> Product)+ . (supertype :: CorrelationSwap -> NettedSwapBase)+ + +-- | Specifies the structure of a correlation swap.+elementCorrelationSwap :: XMLParser CorrelationSwap+elementCorrelationSwap = parseSchemaType "correlationSwap"+elementToXMLCorrelationSwap :: CorrelationSwap -> [Content ()]+elementToXMLCorrelationSwap = schemaTypeToXML "correlationSwap"
+ Data/FpML/V53/Swaps/Correlation.hs-boot view
@@ -0,0 +1,41 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Swaps.Correlation+ ( module Data.FpML.V53.Swaps.Correlation+ , module Data.FpML.V53.Shared.EQ+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Shared.EQ+ +-- | Correlation Amount. +data CorrelationAmount+instance Eq CorrelationAmount+instance Show CorrelationAmount+instance SchemaType CorrelationAmount+instance Extension CorrelationAmount CalculatedAmount+ +-- | A type describing return which is driven by a Correlation +-- calculation. +data CorrelationLeg+instance Eq CorrelationLeg+instance Show CorrelationLeg+instance SchemaType CorrelationLeg+instance Extension CorrelationLeg DirectionalLegUnderlyerValuation+instance Extension CorrelationLeg DirectionalLegUnderlyer+instance Extension CorrelationLeg DirectionalLeg+instance Extension CorrelationLeg Leg+ +-- | A Correlation Swap modelled using a single netted leg. +data CorrelationSwap+instance Eq CorrelationSwap+instance Show CorrelationSwap+instance SchemaType CorrelationSwap+instance Extension CorrelationSwap NettedSwapBase+instance Extension CorrelationSwap Product+ +-- | Specifies the structure of a correlation swap. +elementCorrelationSwap :: XMLParser CorrelationSwap+elementToXMLCorrelationSwap :: CorrelationSwap -> [Content ()]
+ Data/FpML/V53/Swaps/Dividend.hs view
@@ -0,0 +1,381 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+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+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | Floating Payment Leg of a Dividend Swap.+data DividendLeg = DividendLeg+ { dividendLeg_ID :: Maybe Xsd.ID+ , dividendLeg_legIdentifier :: [LegIdentifier]+ -- ^ Version aware identification of this leg.+ , dividendLeg_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , dividendLeg_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , dividendLeg_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , dividendLeg_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , dividendLeg_effectiveDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the effective date of this leg of the swap. When + -- defined in relation to a date specified somewhere else in + -- the document (through the relativeDate component), this + -- element will typically point to the effective date of the + -- other leg of the swap.+ , dividendLeg_terminationDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the termination date of this leg of the swap. + -- When defined in relation to a date specified somewhere else + -- in the document (through the relativeDate component), this + -- element will typically point to the termination date of the + -- other leg of the swap.+ , dividendLeg_underlyer :: Maybe Underlyer+ -- ^ Specifies the underlyer of the leg.+ , dividendLeg_settlementType :: Maybe SettlementTypeEnum+ , dividendLeg_settlementDate :: Maybe AdjustableOrRelativeDate+ , dividendLeg_choice10 :: (Maybe (OneOf2 Money Currency))+ -- ^ Choice between:+ -- + -- (1) Settlement Amount+ -- + -- (2) Settlement Currency for use where the Settlement Amount + -- cannot be known in advance+ , dividendLeg_fxFeature :: Maybe FxFeature+ -- ^ Quanto, Composite, or Cross Currency FX features.+ , dividendLeg_declaredCashDividendPercentage :: Maybe NonNegativeDecimal+ -- ^ Declared Cash Dividend Percentage.+ , dividendLeg_declaredCashEquivalentDividendPercentage :: Maybe NonNegativeDecimal+ -- ^ Declared Cash Equivalent Dividend Percentage.+ , dividendLeg_dividendPeriod :: [DividendPeriodPayment]+ -- ^ One to many time bounded dividend payment periods, each + -- with a fixed strike and dividend payment date per period.+ , dividendLeg_specialDividends :: Maybe Xsd.Boolean+ -- ^ If present and true, then special dividends and memorial + -- dividends are applicable.+ , dividendLeg_materialDividend :: Maybe Xsd.Boolean+ -- ^ If present and true, then material non cash dividends are + -- applicable.+ }+ 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)+ + +-- | A time bounded dividend period, with fixed strike and a +-- dividend payment date per period.+data DividendPeriodPayment = DividendPeriodPayment+ { dividPeriodPayment_ID :: Maybe Xsd.ID+ , dividPeriodPayment_unadjustedStartDate :: Maybe IdentifiedDate+ -- ^ Unadjusted inclusive dividend period start date.+ , dividPeriodPayment_unadjustedEndDate :: Maybe IdentifiedDate+ -- ^ Unadjusted inclusive dividend period end date.+ , dividPeriodPayment_dateAdjustments :: Maybe BusinessDayAdjustments+ -- ^ Date adjustments for all unadjusted dates in this dividend + -- period.+ , dividPeriodPayment_underlyerReference :: Maybe AssetReference+ -- ^ Reference to the underlyer which is paying dividends. This + -- should be used in all cases, and must be used where there + -- are multiple underlying assets, to avoid any ambiguity + -- about which asset the dividend period relates to.+ , dividPeriodPayment_fixedStrike :: Maybe PositiveDecimal+ -- ^ Fixed strike.+ , dividPeriodPayment_paymentDate :: Maybe AdjustableOrRelativeDate+ -- ^ Dividend period amount payment date.+ , dividPeriodPayment_valuationDate :: Maybe AdjustableOrRelativeDate+ -- ^ Dividend period amount valuation date.+ }+ 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+ +-- | A Dividend Swap Transaction Supplement.+data DividendSwapTransactionSupplement = DividendSwapTransactionSupplement+ { dividSwapTransSuppl_ID :: Maybe Xsd.ID+ , dividSwapTransSuppl_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , dividSwapTransSuppl_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , dividSwapTransSuppl_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , dividSwapTransSuppl_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , dividSwapTransSuppl_dividendLeg :: Maybe DividendLeg+ -- ^ Dividend leg.+ , dividSwapTransSuppl_fixedLeg :: Maybe FixedPaymentLeg+ -- ^ Fixed payment leg.+ , dividSwapTransSuppl_choice6 :: (Maybe (OneOf2 Xsd.Boolean Xsd.Boolean))+ -- ^ Choice between:+ -- + -- (1) For an index option transaction, a flag to indicate + -- whether a relevant Multiple Exchange Index Annex is + -- applicable to the transaction. This annex defines + -- additional provisions which are applicable where an + -- index is comprised of component securities that are + -- traded on multiple exchanges.+ -- + -- (2) For an index option transaction, a flag to indicate + -- whether a relevant Component Security Index Annex is + -- applicable to the transaction.+ , dividSwapTransSuppl_localJurisdiction :: Maybe CountryCode+ -- ^ Local Jurisdiction is a term used in the AEJ Master + -- Confirmation, which is used to determine local taxes, which + -- shall mean taxes, duties, and similar charges imposed by + -- the taxing authority of the Local Jurisdiction If this + -- element is not present Local Jurisdiction is Not + -- Applicable.+ , dividSwapTransSuppl_relevantJurisdiction :: Maybe CountryCode+ -- ^ Relevent Jurisdiction is a term used in the AEJ Master + -- Confirmation, which is used to determine local taxes, which + -- shall mean taxes, duties and similar charges that would be + -- imposed by the taxing authority of the Country of Underlyer + -- on a Hypothetical Broker Dealer assuming the Applicable + -- Hedge Positions are held by its office in the Relevant + -- Jurisdiction. If this element is not present Relevant + -- Jurisdiction is Not Applicable.+ }+ 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+ +-- | Fixed payment amount within a Dividend Swap.+data FixedPaymentAmount = FixedPaymentAmount+ { fixedPaymentAmount_ID :: Maybe Xsd.ID+ , fixedPaymentAmount_paymentAmount :: Maybe NonNegativeMoney+ -- ^ Payment amount, which is optional since the payment amount + -- may be calculated using fixed strike and number of open + -- units.+ , fixedPaymentAmount_paymentDate :: Maybe RelativeDateOffset+ -- ^ Payment date relative to another date.+ }+ 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+ +-- | Fixed Payment Leg of a Dividend Swap.+data FixedPaymentLeg = FixedPaymentLeg+ { fixedPaymentLeg_ID :: Maybe Xsd.ID+ , fixedPaymentLeg_legIdentifier :: [LegIdentifier]+ -- ^ Version aware identification of this leg.+ , fixedPaymentLeg_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , fixedPaymentLeg_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , fixedPaymentLeg_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , fixedPaymentLeg_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , fixedPaymentLeg_effectiveDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the effective date of this leg of the swap. When + -- defined in relation to a date specified somewhere else in + -- the document (through the relativeDate component), this + -- element will typically point to the effective date of the + -- other leg of the swap.+ , fixedPaymentLeg_terminationDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the termination date of this leg of the swap. + -- When defined in relation to a date specified somewhere else + -- in the document (through the relativeDate component), this + -- element will typically point to the termination date of the + -- other leg of the swap.+ , fixedPaymentLeg_fixedPayment :: [FixedPaymentAmount]+ -- ^ Fixed payment of a dividend swap, payment date is relative + -- to a dividend period payment date. Commonly the dividend + -- leg and the fixed payment leg will pay out on the same + -- date, and the payments will be netted.+ }+ 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)+ + +-- | Specifies the structure of the dividend swap transaction +-- supplement.+elementDividendSwapTransactionSupplement :: XMLParser DividendSwapTransactionSupplement+elementDividendSwapTransactionSupplement = parseSchemaType "dividendSwapTransactionSupplement"+elementToXMLDividendSwapTransactionSupplement :: DividendSwapTransactionSupplement -> [Content ()]+elementToXMLDividendSwapTransactionSupplement = schemaTypeToXML "dividendSwapTransactionSupplement"
+ Data/FpML/V53/Swaps/Dividend.hs-boot view
@@ -0,0 +1,57 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+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 qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Shared.EQ+import {-# SOURCE #-} Data.FpML.V53.Shared+ +-- | Floating Payment Leg of a Dividend Swap. +data DividendLeg+instance Eq DividendLeg+instance Show DividendLeg+instance SchemaType DividendLeg+instance Extension DividendLeg DirectionalLegUnderlyer+instance Extension DividendLeg DirectionalLeg+instance Extension DividendLeg Leg+ +-- | A time bounded dividend period, with fixed strike and a +-- dividend payment date per period. +data DividendPeriodPayment+instance Eq DividendPeriodPayment+instance Show DividendPeriodPayment+instance SchemaType DividendPeriodPayment+instance Extension DividendPeriodPayment DividendPeriod+ +-- | A Dividend Swap Transaction Supplement. +data DividendSwapTransactionSupplement+instance Eq DividendSwapTransactionSupplement+instance Show DividendSwapTransactionSupplement+instance SchemaType DividendSwapTransactionSupplement+instance Extension DividendSwapTransactionSupplement Product+ +-- | Fixed payment amount within a Dividend Swap. +data FixedPaymentAmount+instance Eq FixedPaymentAmount+instance Show FixedPaymentAmount+instance SchemaType FixedPaymentAmount+instance Extension FixedPaymentAmount PaymentBase+ +-- | Fixed Payment Leg of a Dividend Swap. +data FixedPaymentLeg+instance Eq FixedPaymentLeg+instance Show FixedPaymentLeg+instance SchemaType FixedPaymentLeg+instance Extension FixedPaymentLeg DirectionalLeg+instance Extension FixedPaymentLeg Leg+ +-- | Specifies the structure of the dividend swap transaction +-- supplement. +elementDividendSwapTransactionSupplement :: XMLParser DividendSwapTransactionSupplement+elementToXMLDividendSwapTransactionSupplement :: DividendSwapTransactionSupplement -> [Content ()]
+ Data/FpML/V53/Swaps/Return.hs view
@@ -0,0 +1,185 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Swaps.Return+ ( module Data.FpML.V53.Swaps.Return+ , module Data.FpML.V53.Shared.EQ+ ) 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+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | A type for defining Equity Swap Transaction Supplement+data EquitySwapTransactionSupplement = EquitySwapTransactionSupplement+ { equitySwapTransSuppl_ID :: Maybe Xsd.ID+ , equitySwapTransSuppl_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , equitySwapTransSuppl_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , equitySwapTransSuppl_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , equitySwapTransSuppl_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , equitySwapTransSuppl_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , equitySwapTransSuppl_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , equitySwapTransSuppl_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , equitySwapTransSuppl_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , equitySwapTransSuppl_returnSwapLeg :: [DirectionalLeg]+ -- ^ An placeholder for the actual Return Swap Leg definition.+ , equitySwapTransSuppl_principalExchangeFeatures :: Maybe PrincipalExchangeFeatures+ -- ^ This is used to document a Fully Funded Return Swap.+ , equitySwapTransSuppl_choice10 :: (Maybe (OneOf2 Xsd.Boolean ((Maybe (Xsd.Boolean)),(Maybe (Xsd.Boolean)),(Maybe (FeeElectionEnum)),(Maybe (NonNegativeDecimal)))))+ -- ^ Choice between:+ -- + -- (1) Used for specifying whether the Mutual Early + -- Termination Right that is detailed in the Master + -- Confirmation will apply.+ -- + -- (2) Sequence of:+ -- + -- * A Boolean element used for specifying whether the + -- Optional Early Termination clause detailed in the + -- agreement will apply.+ -- + -- * A Boolean element used for specifying whether the + -- Break Funding Recovery detailed in the agreement + -- will apply.+ -- + -- * Defines the fee type.+ -- + -- * breakFeeRate+ , equitySwapTransSuppl_choice11 :: (Maybe (OneOf2 Xsd.Boolean Xsd.Boolean))+ -- ^ Choice between:+ -- + -- (1) For an index option transaction, a flag to indicate + -- whether a relevant Multiple Exchange Index Annex is + -- applicable to the transaction. This annex defines + -- additional provisions which are applicable where an + -- index is comprised of component securities that are + -- traded on multiple exchanges.+ -- + -- (2) For an index option transaction, a flag to indicate + -- whether a relevant Component Security Index Annex is + -- applicable to the transaction.+ , equitySwapTransSuppl_localJurisdiction :: Maybe CountryCode+ -- ^ Local Jurisdiction is a term used in the AEJ Master + -- Confirmation, which is used to determine local taxes, which + -- shall mean taxes, duties, and similar charges imposed by + -- the taxing authority of the Local Jurisdiction If this + -- element is not present Local Jurisdiction is Not + -- Applicable.+ , equitySwapTransSuppl_relevantJurisdiction :: Maybe CountryCode+ -- ^ Relevent Jurisdiction is a term used in the AEJ Master + -- Confirmation, which is used to determine local taxes, which + -- shall mean taxes, duties and similar charges that would be + -- imposed by the taxing authority of the Country of Underlyer + -- on a Hypothetical Broker Dealer assuming the Applicable + -- Hedge Positions are held by its office in the Relevant + -- Jurisdiction. If this element is not present Relevant + -- Jurisdiction is Not Applicable.+ , equitySwapTransSuppl_extraordinaryEvents :: Maybe ExtraordinaryEvents+ -- ^ Where the underlying is shares, specifies events affecting + -- the issuer of those shares that may require the terms of + -- the transaction to be adjusted.+ }+ deriving (Eq,Show)+instance SchemaType EquitySwapTransactionSupplement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (EquitySwapTransactionSupplement a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` optional (parseSchemaType "buyerPartyReference")+ `apply` optional (parseSchemaType "buyerAccountReference")+ `apply` optional (parseSchemaType "sellerPartyReference")+ `apply` optional (parseSchemaType "sellerAccountReference")+ `apply` between (Occurs (Just 0) (Just 2))+ (elementReturnSwapLeg)+ `apply` optional (parseSchemaType "principalExchangeFeatures")+ `apply` optional (oneOf' [ ("Xsd.Boolean", fmap OneOf2 (parseSchemaType "mutualEarlyTermination"))+ , ("Maybe Xsd.Boolean Maybe Xsd.Boolean Maybe FeeElectionEnum Maybe NonNegativeDecimal", fmap TwoOf2 (return (,,,) `apply` optional (parseSchemaType "optionalEarlyTermination")+ `apply` optional (parseSchemaType "breakFundingRecovery")+ `apply` optional (parseSchemaType "breakFeeElection")+ `apply` optional (parseSchemaType "breakFeeRate")))+ ])+ `apply` optional (oneOf' [ ("Xsd.Boolean", fmap OneOf2 (parseSchemaType "multipleExchangeIndexAnnexFallback"))+ , ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "componentSecurityIndexAnnexFallback"))+ ])+ `apply` optional (parseSchemaType "localJurisdiction")+ `apply` optional (parseSchemaType "relevantJurisdiction")+ `apply` optional (parseSchemaType "extraordinaryEvents")+ schemaTypeToXML s x@EquitySwapTransactionSupplement{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ equitySwapTransSuppl_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ equitySwapTransSuppl_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ equitySwapTransSuppl_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ equitySwapTransSuppl_productType x+ , concatMap (schemaTypeToXML "productId") $ equitySwapTransSuppl_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ equitySwapTransSuppl_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ equitySwapTransSuppl_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ equitySwapTransSuppl_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ equitySwapTransSuppl_sellerAccountReference x+ , concatMap (elementToXMLReturnSwapLeg) $ equitySwapTransSuppl_returnSwapLeg x+ , maybe [] (schemaTypeToXML "principalExchangeFeatures") $ equitySwapTransSuppl_principalExchangeFeatures x+ , maybe [] (foldOneOf2 (schemaTypeToXML "mutualEarlyTermination")+ (\ (a,b,c,d) -> concat [ maybe [] (schemaTypeToXML "optionalEarlyTermination") a+ , maybe [] (schemaTypeToXML "breakFundingRecovery") b+ , maybe [] (schemaTypeToXML "breakFeeElection") c+ , maybe [] (schemaTypeToXML "breakFeeRate") d+ ])+ ) $ equitySwapTransSuppl_choice10 x+ , maybe [] (foldOneOf2 (schemaTypeToXML "multipleExchangeIndexAnnexFallback")+ (schemaTypeToXML "componentSecurityIndexAnnexFallback")+ ) $ equitySwapTransSuppl_choice11 x+ , maybe [] (schemaTypeToXML "localJurisdiction") $ equitySwapTransSuppl_localJurisdiction x+ , maybe [] (schemaTypeToXML "relevantJurisdiction") $ equitySwapTransSuppl_relevantJurisdiction x+ , maybe [] (schemaTypeToXML "extraordinaryEvents") $ equitySwapTransSuppl_extraordinaryEvents x+ ]+instance Extension EquitySwapTransactionSupplement ReturnSwapBase where+ supertype v = ReturnSwapBase_EquitySwapTransactionSupplement v+instance Extension EquitySwapTransactionSupplement Product where+ supertype = (supertype :: ReturnSwapBase -> Product)+ . (supertype :: EquitySwapTransactionSupplement -> ReturnSwapBase)+ + +-- | Specifies the structure of the equity swap transaction +-- supplement.+elementEquitySwapTransactionSupplement :: XMLParser EquitySwapTransactionSupplement+elementEquitySwapTransactionSupplement = parseSchemaType "equitySwapTransactionSupplement"+elementToXMLEquitySwapTransactionSupplement :: EquitySwapTransactionSupplement -> [Content ()]+elementToXMLEquitySwapTransactionSupplement = schemaTypeToXML "equitySwapTransactionSupplement"
+ Data/FpML/V53/Swaps/Return.hs-boot view
@@ -0,0 +1,24 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Swaps.Return+ ( module Data.FpML.V53.Swaps.Return+ , module Data.FpML.V53.Shared.EQ+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Shared.EQ+ +-- | A type for defining Equity Swap Transaction Supplement +data EquitySwapTransactionSupplement+instance Eq EquitySwapTransactionSupplement+instance Show EquitySwapTransactionSupplement+instance SchemaType EquitySwapTransactionSupplement+instance Extension EquitySwapTransactionSupplement ReturnSwapBase+instance Extension EquitySwapTransactionSupplement Product+ +-- | Specifies the structure of the equity swap transaction +-- supplement. +elementEquitySwapTransactionSupplement :: XMLParser EquitySwapTransactionSupplement+elementToXMLEquitySwapTransactionSupplement :: EquitySwapTransactionSupplement -> [Content ()]
+ Data/FpML/V53/Swaps/Variance.hs view
@@ -0,0 +1,494 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Swaps.Variance+ ( module Data.FpML.V53.Swaps.Variance+ , module Data.FpML.V53.Eqd+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import Text.XML.HaXml.OneOfN+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import Data.FpML.V53.Eqd+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | Calculation of a Variance Amount.+data VarianceAmount = VarianceAmount+ { varianAmount_calculationDates :: Maybe AdjustableRelativeOrPeriodicDates+ -- ^ Specifies the date on which a calculation or an observation + -- will be performed for the purpose of calculating the + -- amount.+ , varianAmount_observationStartDate :: Maybe AdjustableOrRelativeDate+ -- ^ The start of the period over which observations are made + -- which are used in the calculation Used when the observation + -- start date differs from the trade date such as for forward + -- starting swaps.+ , varianAmount_optionsExchangeDividends :: Maybe Xsd.Boolean+ -- ^ If present and true, then options exchange dividends are + -- applicable.+ , varianAmount_additionalDividends :: Maybe Xsd.Boolean+ -- ^ If present and true, then additional dividends are + -- applicable.+ , varianAmount_allDividends :: Maybe Xsd.Boolean+ -- ^ Represents the European Master Confirmation value of 'All + -- Dividends' which, when applicable, signifies that, for a + -- given Ex-Date, the daily observed Share Price for that day + -- is adjusted (reduced) by the cash dividend and/or the cash + -- value of any non cash dividend per Share (including + -- Extraordinary Dividends) declared by the Issuer.+ , varianAmount_variance :: Maybe Variance+ -- ^ Specifies Variance.+ }+ deriving (Eq,Show)+instance SchemaType VarianceAmount where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return VarianceAmount+ `apply` optional (parseSchemaType "calculationDates")+ `apply` optional (parseSchemaType "observationStartDate")+ `apply` optional (parseSchemaType "optionsExchangeDividends")+ `apply` optional (parseSchemaType "additionalDividends")+ `apply` optional (parseSchemaType "allDividends")+ `apply` optional (parseSchemaType "variance")+ schemaTypeToXML s x@VarianceAmount{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "calculationDates") $ varianAmount_calculationDates x+ , maybe [] (schemaTypeToXML "observationStartDate") $ varianAmount_observationStartDate x+ , maybe [] (schemaTypeToXML "optionsExchangeDividends") $ varianAmount_optionsExchangeDividends x+ , maybe [] (schemaTypeToXML "additionalDividends") $ varianAmount_additionalDividends x+ , maybe [] (schemaTypeToXML "allDividends") $ varianAmount_allDividends x+ , maybe [] (schemaTypeToXML "variance") $ varianAmount_variance x+ ]+instance Extension VarianceAmount CalculatedAmount where+ supertype v = CalculatedAmount_VarianceAmount v+ +-- | A type describing return which is driven by a Variance +-- Calculation.+data VarianceLeg = VarianceLeg+ { varianceLeg_ID :: Maybe Xsd.ID+ , varianceLeg_legIdentifier :: [LegIdentifier]+ -- ^ Version aware identification of this leg.+ , varianceLeg_payerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party responsible for making the + -- payments defined by this structure.+ , varianceLeg_payerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account responsible for making the + -- payments defined by this structure.+ , varianceLeg_receiverPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that receives the payments + -- corresponding to this structure.+ , varianceLeg_receiverAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that receives the payments + -- corresponding to this structure.+ , varianceLeg_effectiveDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the effective date of this leg of the swap. When + -- defined in relation to a date specified somewhere else in + -- the document (through the relativeDate component), this + -- element will typically point to the effective date of the + -- other leg of the swap.+ , varianceLeg_terminationDate :: Maybe AdjustableOrRelativeDate+ -- ^ Specifies the termination date of this leg of the swap. + -- When defined in relation to a date specified somewhere else + -- in the document (through the relativeDate component), this + -- element will typically point to the termination date of the + -- other leg of the swap.+ , varianceLeg_underlyer :: Maybe Underlyer+ -- ^ Specifies the underlyer of the leg.+ , varianceLeg_settlementType :: Maybe SettlementTypeEnum+ , varianceLeg_settlementDate :: Maybe AdjustableOrRelativeDate+ , varianceLeg_choice10 :: (Maybe (OneOf2 Money Currency))+ -- ^ Choice between:+ -- + -- (1) Settlement Amount+ -- + -- (2) Settlement Currency for use where the Settlement Amount + -- cannot be known in advance+ , varianceLeg_fxFeature :: Maybe FxFeature+ -- ^ Quanto, Composite, or Cross Currency FX features.+ , varianceLeg_valuation :: Maybe EquityValuation+ -- ^ Valuation of the underlyer.+ , varianceLeg_amount :: Maybe VarianceAmount+ -- ^ Specifies, in relation to each Equity Payment Date, the + -- amount to which the Equity Payment Date relates. Unless + -- otherwise specified, this term has the meaning defined in + -- the ISDA 2002 Equity Derivatives Definitions.+ }+ deriving (Eq,Show)+instance SchemaType VarianceLeg where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (VarianceLeg a0)+ `apply` many (parseSchemaType "legIdentifier")+ `apply` optional (parseSchemaType "payerPartyReference")+ `apply` optional (parseSchemaType "payerAccountReference")+ `apply` optional (parseSchemaType "receiverPartyReference")+ `apply` optional (parseSchemaType "receiverAccountReference")+ `apply` optional (parseSchemaType "effectiveDate")+ `apply` optional (parseSchemaType "terminationDate")+ `apply` optional (parseSchemaType "underlyer")+ `apply` optional (parseSchemaType "settlementType")+ `apply` optional (parseSchemaType "settlementDate")+ `apply` optional (oneOf' [ ("Money", fmap OneOf2 (parseSchemaType "settlementAmount"))+ , ("Currency", fmap TwoOf2 (parseSchemaType "settlementCurrency"))+ ])+ `apply` optional (parseSchemaType "fxFeature")+ `apply` optional (parseSchemaType "valuation")+ `apply` optional (parseSchemaType "amount")+ schemaTypeToXML s x@VarianceLeg{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ varianceLeg_ID x+ ]+ [ concatMap (schemaTypeToXML "legIdentifier") $ varianceLeg_legIdentifier x+ , maybe [] (schemaTypeToXML "payerPartyReference") $ varianceLeg_payerPartyReference x+ , maybe [] (schemaTypeToXML "payerAccountReference") $ varianceLeg_payerAccountReference x+ , maybe [] (schemaTypeToXML "receiverPartyReference") $ varianceLeg_receiverPartyReference x+ , maybe [] (schemaTypeToXML "receiverAccountReference") $ varianceLeg_receiverAccountReference x+ , maybe [] (schemaTypeToXML "effectiveDate") $ varianceLeg_effectiveDate x+ , maybe [] (schemaTypeToXML "terminationDate") $ varianceLeg_terminationDate x+ , maybe [] (schemaTypeToXML "underlyer") $ varianceLeg_underlyer x+ , maybe [] (schemaTypeToXML "settlementType") $ varianceLeg_settlementType x+ , maybe [] (schemaTypeToXML "settlementDate") $ varianceLeg_settlementDate x+ , maybe [] (foldOneOf2 (schemaTypeToXML "settlementAmount")+ (schemaTypeToXML "settlementCurrency")+ ) $ varianceLeg_choice10 x+ , maybe [] (schemaTypeToXML "fxFeature") $ varianceLeg_fxFeature x+ , maybe [] (schemaTypeToXML "valuation") $ varianceLeg_valuation x+ , maybe [] (schemaTypeToXML "amount") $ varianceLeg_amount x+ ]+instance Extension VarianceLeg DirectionalLegUnderlyerValuation where+ supertype v = DirectionalLegUnderlyerValuation_VarianceLeg v+instance Extension VarianceLeg DirectionalLegUnderlyer where+ supertype = (supertype :: DirectionalLegUnderlyerValuation -> DirectionalLegUnderlyer)+ . (supertype :: VarianceLeg -> DirectionalLegUnderlyerValuation)+ +instance Extension VarianceLeg DirectionalLeg where+ supertype = (supertype :: DirectionalLegUnderlyer -> DirectionalLeg)+ . (supertype :: DirectionalLegUnderlyerValuation -> DirectionalLegUnderlyer)+ . (supertype :: VarianceLeg -> DirectionalLegUnderlyerValuation)+ +instance Extension VarianceLeg Leg where+ supertype = (supertype :: DirectionalLeg -> Leg)+ . (supertype :: DirectionalLegUnderlyer -> DirectionalLeg)+ . (supertype :: DirectionalLegUnderlyerValuation -> DirectionalLegUnderlyer)+ . (supertype :: VarianceLeg -> DirectionalLegUnderlyerValuation)+ + +data VarianceOptionTransactionSupplement = VarianceOptionTransactionSupplement+ { vots_ID :: Maybe Xsd.ID+ , vots_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , vots_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , vots_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , vots_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , vots_buyerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that buys this instrument, ie. + -- pays for this instrument and receives the rights defined by + -- it. See 2000 ISDA definitions Article 11.1 (b). In the case + -- of FRAs this the fixed rate payer.+ , vots_buyerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that buys this instrument.+ , vots_sellerPartyReference :: Maybe PartyReference+ -- ^ A reference to the party that sells ("writes") this + -- instrument, i.e. that grants the rights defined by this + -- instrument and in return receives a payment for it. See + -- 2000 ISDA definitions Article 11.1 (a). In the case of FRAs + -- this is the floating rate payer.+ , vots_sellerAccountReference :: Maybe AccountReference+ -- ^ A reference to the account that sells this instrument.+ , vots_optionType :: OptionTypeEnum+ -- ^ The type of option transaction. From a usage standpoint, + -- put/call is the default option type, while payer/receiver + -- indicator is used for options index credit default swaps, + -- consistently with the industry practice. Straddle is used + -- for the case of straddle strategy, that combine a call and + -- a put with the same strike.+ , vots_equityPremium :: Maybe EquityPremium+ -- ^ The variance option premium payable by the buyer to the + -- seller.+ , vots_equityExercise :: Maybe EquityExerciseValuationSettlement+ -- ^ The parameters for defining how the equity option can be + -- exercised, how it is valued and how it is settled.+ , vots_exchangeLookAlike :: Maybe Xsd.Boolean+ -- ^ For a share option transaction, a flag used to indicate + -- whether the transaction is to be treated as an 'exchange + -- look-alike'. This designation has significance for how + -- share adjustments (arising from corporate actions) will be + -- determined for the transaction. For an 'exchange + -- look-alike' transaction the relevant share adjustments will + -- follow that for a corresponding designated contract listed + -- on the related exchange (referred to as Options Exchange + -- Adjustment (ISDA defined term), otherwise the share + -- adjustments will be determined by the calculation agent + -- (referred to as Calculation Agent Adjustment (ISDA defined + -- term)).+ , vots_methodOfAdjustment :: Maybe MethodOfAdjustmentEnum+ -- ^ Defines how adjustments will be made to the contract should + -- one or more of the extraordinary events occur.+ , vots_choice13 :: (Maybe (OneOf2 PositiveDecimal PositiveDecimal))+ -- ^ Choice between:+ -- + -- (1) The number of shares per option comprised in the option + -- transaction supplement.+ -- + -- (2) Specifies the contract multiplier that can be + -- associated with an index option.+ , vots_varianceSwapTransactionSupplement :: VarianceSwapTransactionSupplement+ -- ^ The variance swap details.+ }+ deriving (Eq,Show)+instance SchemaType VarianceOptionTransactionSupplement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (VarianceOptionTransactionSupplement a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` optional (parseSchemaType "buyerPartyReference")+ `apply` optional (parseSchemaType "buyerAccountReference")+ `apply` optional (parseSchemaType "sellerPartyReference")+ `apply` optional (parseSchemaType "sellerAccountReference")+ `apply` parseSchemaType "optionType"+ `apply` optional (parseSchemaType "equityPremium")+ `apply` optional (parseSchemaType "equityExercise")+ `apply` optional (parseSchemaType "exchangeLookAlike")+ `apply` optional (parseSchemaType "methodOfAdjustment")+ `apply` optional (oneOf' [ ("PositiveDecimal", fmap OneOf2 (parseSchemaType "optionEntitlement"))+ , ("PositiveDecimal", fmap TwoOf2 (parseSchemaType "multiplier"))+ ])+ `apply` parseSchemaType "varianceSwapTransactionSupplement"+ schemaTypeToXML s x@VarianceOptionTransactionSupplement{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ vots_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ vots_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ vots_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ vots_productType x+ , concatMap (schemaTypeToXML "productId") $ vots_productId x+ , maybe [] (schemaTypeToXML "buyerPartyReference") $ vots_buyerPartyReference x+ , maybe [] (schemaTypeToXML "buyerAccountReference") $ vots_buyerAccountReference x+ , maybe [] (schemaTypeToXML "sellerPartyReference") $ vots_sellerPartyReference x+ , maybe [] (schemaTypeToXML "sellerAccountReference") $ vots_sellerAccountReference x+ , schemaTypeToXML "optionType" $ vots_optionType x+ , maybe [] (schemaTypeToXML "equityPremium") $ vots_equityPremium x+ , maybe [] (schemaTypeToXML "equityExercise") $ vots_equityExercise x+ , maybe [] (schemaTypeToXML "exchangeLookAlike") $ vots_exchangeLookAlike x+ , maybe [] (schemaTypeToXML "methodOfAdjustment") $ vots_methodOfAdjustment x+ , maybe [] (foldOneOf2 (schemaTypeToXML "optionEntitlement")+ (schemaTypeToXML "multiplier")+ ) $ vots_choice13 x+ , schemaTypeToXML "varianceSwapTransactionSupplement" $ vots_varianceSwapTransactionSupplement x+ ]+instance Extension VarianceOptionTransactionSupplement OptionBase where+ supertype v = OptionBase_VarianceOptionTransactionSupplement v+instance Extension VarianceOptionTransactionSupplement Option where+ supertype = (supertype :: OptionBase -> Option)+ . (supertype :: VarianceOptionTransactionSupplement -> OptionBase)+ +instance Extension VarianceOptionTransactionSupplement Product where+ supertype = (supertype :: Option -> Product)+ . (supertype :: OptionBase -> Option)+ . (supertype :: VarianceOptionTransactionSupplement -> OptionBase)+ + +-- | A Variance Swap.+data VarianceSwap = VarianceSwap+ { varianceSwap_ID :: Maybe Xsd.ID+ , varianceSwap_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , varianceSwap_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , varianceSwap_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , varianceSwap_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , varianceSwap_additionalPayment :: [ClassifiedPayment]+ -- ^ Specifies additional payment(s) between the principal + -- parties to the netted swap.+ , varianceSwap_extraordinaryEvents :: Maybe ExtraordinaryEvents+ -- ^ Where the underlying is shares, specifies events affecting + -- the issuer of those shares that may require the terms of + -- the transaction to be adjusted.+ , varianceSwap_varianceLeg :: [VarianceLeg]+ -- ^ Variance Leg.+ }+ deriving (Eq,Show)+instance SchemaType VarianceSwap where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (VarianceSwap a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` many (parseSchemaType "additionalPayment")+ `apply` optional (parseSchemaType "extraordinaryEvents")+ `apply` many (parseSchemaType "varianceLeg")+ schemaTypeToXML s x@VarianceSwap{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ varianceSwap_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ varianceSwap_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ varianceSwap_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ varianceSwap_productType x+ , concatMap (schemaTypeToXML "productId") $ varianceSwap_productId x+ , concatMap (schemaTypeToXML "additionalPayment") $ varianceSwap_additionalPayment x+ , maybe [] (schemaTypeToXML "extraordinaryEvents") $ varianceSwap_extraordinaryEvents x+ , concatMap (schemaTypeToXML "varianceLeg") $ varianceSwap_varianceLeg x+ ]+instance Extension VarianceSwap NettedSwapBase where+ supertype v = NettedSwapBase_VarianceSwap v+instance Extension VarianceSwap Product where+ supertype = (supertype :: NettedSwapBase -> Product)+ . (supertype :: VarianceSwap -> NettedSwapBase)+ + +-- | A Variance Swap Transaction Supplement.+data VarianceSwapTransactionSupplement = VarianceSwapTransactionSupplement+ { varianSwapTransSuppl_ID :: Maybe Xsd.ID+ , varianSwapTransSuppl_primaryAssetClass :: Maybe AssetClass+ -- ^ A classification of the most important risk class of the + -- trade. FpML defines a simple asset class categorization + -- using a coding scheme.+ , varianSwapTransSuppl_secondaryAssetClass :: [AssetClass]+ -- ^ A classification of additional risk classes of the trade, + -- if any. FpML defines a simple asset class categorization + -- using a coding scheme.+ , varianSwapTransSuppl_productType :: [ProductType]+ -- ^ A classification of the type of product. FpML defines a + -- simple product categorization using a coding scheme.+ , varianSwapTransSuppl_productId :: [ProductId]+ -- ^ A product reference identifier. The product ID is an + -- identifier that describes the key economic characteristics + -- of the trade type, with the exception of concepts such as + -- size (notional, quantity, number of units) and price (fixed + -- rate, strike, etc.) that are negotiated for each + -- transaction. It can be used to hold identifiers such as the + -- "UPI" (universal product identifier) required by certain + -- regulatory reporting rules. It can also be used to hold + -- identifiers of benchmark products or product temnplates + -- used by certain trading systems or facilities. FpML does + -- not define the domain values associated with this element. + -- Note that the domain values for this element are not + -- strictly an enumerated list.+ , varianSwapTransSuppl_varianceLeg :: [VarianceLeg]+ -- ^ Variance Leg.+ , varianSwapTransSuppl_choice5 :: (Maybe (OneOf2 Xsd.Boolean Xsd.Boolean))+ -- ^ Choice between:+ -- + -- (1) For an index option transaction, a flag to indicate + -- whether a relevant Multiple Exchange Index Annex is + -- applicable to the transaction. This annex defines + -- additional provisions which are applicable where an + -- index is comprised of component securities that are + -- traded on multiple exchanges.+ -- + -- (2) For an index option transaction, a flag to indicate + -- whether a relevant Component Security Index Annex is + -- applicable to the transaction.+ , varianSwapTransSuppl_localJurisdiction :: Maybe CountryCode+ -- ^ Local Jurisdiction is a term used in the AEJ Master + -- Confirmation, which is used to determine local taxes, which + -- shall mean taxes, duties, and similar charges imposed by + -- the taxing authority of the Local Jurisdiction If this + -- element is not present Local Jurisdiction is Not + -- Applicable.+ , varianSwapTransSuppl_relevantJurisdiction :: Maybe CountryCode+ -- ^ Relevent Jurisdiction is a term used in the AEJ Master + -- Confirmation, which is used to determine local taxes, which + -- shall mean taxes, duties and similar charges that would be + -- imposed by the taxing authority of the Country of Underlyer + -- on a Hypothetical Broker Dealer assuming the Applicable + -- Hedge Positions are held by its office in the Relevant + -- Jurisdiction. If this element is not present Relevant + -- Jurisdiction is Not Applicable.+ }+ deriving (Eq,Show)+instance SchemaType VarianceSwapTransactionSupplement where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (VarianceSwapTransactionSupplement a0)+ `apply` optional (parseSchemaType "primaryAssetClass")+ `apply` many (parseSchemaType "secondaryAssetClass")+ `apply` many (parseSchemaType "productType")+ `apply` many (parseSchemaType "productId")+ `apply` many (parseSchemaType "varianceLeg")+ `apply` optional (oneOf' [ ("Xsd.Boolean", fmap OneOf2 (parseSchemaType "multipleExchangeIndexAnnexFallback"))+ , ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "componentSecurityIndexAnnexFallback"))+ ])+ `apply` optional (parseSchemaType "localJurisdiction")+ `apply` optional (parseSchemaType "relevantJurisdiction")+ schemaTypeToXML s x@VarianceSwapTransactionSupplement{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ varianSwapTransSuppl_ID x+ ]+ [ maybe [] (schemaTypeToXML "primaryAssetClass") $ varianSwapTransSuppl_primaryAssetClass x+ , concatMap (schemaTypeToXML "secondaryAssetClass") $ varianSwapTransSuppl_secondaryAssetClass x+ , concatMap (schemaTypeToXML "productType") $ varianSwapTransSuppl_productType x+ , concatMap (schemaTypeToXML "productId") $ varianSwapTransSuppl_productId x+ , concatMap (schemaTypeToXML "varianceLeg") $ varianSwapTransSuppl_varianceLeg x+ , maybe [] (foldOneOf2 (schemaTypeToXML "multipleExchangeIndexAnnexFallback")+ (schemaTypeToXML "componentSecurityIndexAnnexFallback")+ ) $ varianSwapTransSuppl_choice5 x+ , maybe [] (schemaTypeToXML "localJurisdiction") $ varianSwapTransSuppl_localJurisdiction x+ , maybe [] (schemaTypeToXML "relevantJurisdiction") $ varianSwapTransSuppl_relevantJurisdiction x+ ]+instance Extension VarianceSwapTransactionSupplement Product where+ supertype v = Product_VarianceSwapTransactionSupplement v+ +-- | Specifies the structure of a variance option.+elementVarianceOptionTransactionSupplement :: XMLParser VarianceOptionTransactionSupplement+elementVarianceOptionTransactionSupplement = parseSchemaType "varianceOptionTransactionSupplement"+elementToXMLVarianceOptionTransactionSupplement :: VarianceOptionTransactionSupplement -> [Content ()]+elementToXMLVarianceOptionTransactionSupplement = schemaTypeToXML "varianceOptionTransactionSupplement"+ +-- | Specifies the structure of a variance swap.+elementVarianceSwap :: XMLParser VarianceSwap+elementVarianceSwap = parseSchemaType "varianceSwap"+elementToXMLVarianceSwap :: VarianceSwap -> [Content ()]+elementToXMLVarianceSwap = schemaTypeToXML "varianceSwap"+ +-- | Specifies the structure of a variance swap transaction +-- supplement.+elementVarianceSwapTransactionSupplement :: XMLParser VarianceSwapTransactionSupplement+elementVarianceSwapTransactionSupplement = parseSchemaType "varianceSwapTransactionSupplement"+elementToXMLVarianceSwapTransactionSupplement :: VarianceSwapTransactionSupplement -> [Content ()]+elementToXMLVarianceSwapTransactionSupplement = schemaTypeToXML "varianceSwapTransactionSupplement"
+ Data/FpML/V53/Swaps/Variance.hs-boot view
@@ -0,0 +1,65 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Swaps.Variance+ ( module Data.FpML.V53.Swaps.Variance+ , module Data.FpML.V53.Eqd+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Eqd+ +-- | Calculation of a Variance Amount. +data VarianceAmount+instance Eq VarianceAmount+instance Show VarianceAmount+instance SchemaType VarianceAmount+instance Extension VarianceAmount CalculatedAmount+ +-- | A type describing return which is driven by a Variance +-- Calculation. +data VarianceLeg+instance Eq VarianceLeg+instance Show VarianceLeg+instance SchemaType VarianceLeg+instance Extension VarianceLeg DirectionalLegUnderlyerValuation+instance Extension VarianceLeg DirectionalLegUnderlyer+instance Extension VarianceLeg DirectionalLeg+instance Extension VarianceLeg Leg+ +data VarianceOptionTransactionSupplement+instance Eq VarianceOptionTransactionSupplement+instance Show VarianceOptionTransactionSupplement+instance SchemaType VarianceOptionTransactionSupplement+instance Extension VarianceOptionTransactionSupplement OptionBase+instance Extension VarianceOptionTransactionSupplement Option+instance Extension VarianceOptionTransactionSupplement Product+ +-- | A Variance Swap. +data VarianceSwap+instance Eq VarianceSwap+instance Show VarianceSwap+instance SchemaType VarianceSwap+instance Extension VarianceSwap NettedSwapBase+instance Extension VarianceSwap Product+ +-- | A Variance Swap Transaction Supplement. +data VarianceSwapTransactionSupplement+instance Eq VarianceSwapTransactionSupplement+instance Show VarianceSwapTransactionSupplement+instance SchemaType VarianceSwapTransactionSupplement+instance Extension VarianceSwapTransactionSupplement Product+ +-- | Specifies the structure of a variance option. +elementVarianceOptionTransactionSupplement :: XMLParser VarianceOptionTransactionSupplement+elementToXMLVarianceOptionTransactionSupplement :: VarianceOptionTransactionSupplement -> [Content ()]+ +-- | Specifies the structure of a variance swap. +elementVarianceSwap :: XMLParser VarianceSwap+elementToXMLVarianceSwap :: VarianceSwap -> [Content ()]+ +-- | Specifies the structure of a variance swap transaction +-- supplement. +elementVarianceSwapTransactionSupplement :: XMLParser VarianceSwapTransactionSupplement+elementToXMLVarianceSwapTransactionSupplement :: VarianceSwapTransactionSupplement -> [Content ()]
+ Data/FpML/V53/Valuation.hs view
@@ -0,0 +1,684 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Valuation+ ( module Data.FpML.V53.Valuation+ , module Data.FpML.V53.Enum+ , module Data.FpML.V53.Riskdef+ , module Data.FpML.V53.Msg+ , 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.Enum+import Data.FpML.V53.Riskdef+import Data.FpML.V53.Msg+import Data.FpML.V53.Events.Business+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +-- | A structure that holds a set of measures about an asset, +-- including possibly their sensitivities.+data AssetValuation = AssetValuation+ { assetVal_ID :: Maybe Xsd.ID+ , assetVal_definitionRef :: Maybe Xsd.IDREF+ -- ^ An optional reference to the scenario that this valuation + -- applies to.+ , assetVal_objectReference :: Maybe AnyAssetReference+ -- ^ A reference to the asset or pricing structure that this + -- values.+ , assetVal_valuationScenarioReference :: Maybe ValuationScenarioReference+ -- ^ A reference to the valuation scenario used to calculate + -- this valuation. If the Valuation occurs within a + -- ValuationSet, this value is optional and is defaulted from + -- the ValuationSet. If this value occurs in both places, the + -- lower level value (i.e. the one here) overrides that in the + -- higher (i.e. ValuationSet).+ , assetVal_quote :: [Quotation]+ -- ^ One or more numerical measures relating to the asset, + -- possibly together with sensitivities of that measure to + -- pricing inputs.+ , assetVal_fxRate :: [FxRate]+ -- ^ Indicates the rate of a currency conversion that may have + -- been used to compute valuations.+ }+ deriving (Eq,Show)+instance SchemaType AssetValuation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ a1 <- optional $ getAttribute "definitionRef" e pos+ commit $ interior e $ return (AssetValuation a0 a1)+ `apply` optional (parseSchemaType "objectReference")+ `apply` optional (parseSchemaType "valuationScenarioReference")+ `apply` many (parseSchemaType "quote")+ `apply` many (parseSchemaType "fxRate")+ schemaTypeToXML s x@AssetValuation{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ assetVal_ID x+ , maybe [] (toXMLAttribute "definitionRef") $ assetVal_definitionRef x+ ]+ [ maybe [] (schemaTypeToXML "objectReference") $ assetVal_objectReference x+ , maybe [] (schemaTypeToXML "valuationScenarioReference") $ assetVal_valuationScenarioReference x+ , concatMap (schemaTypeToXML "quote") $ assetVal_quote x+ , concatMap (schemaTypeToXML "fxRate") $ assetVal_fxRate x+ ]+instance Extension AssetValuation Valuation where+ supertype (AssetValuation a0 a1 e0 e1 e2 e3) =+ Valuation a0 a1 e0 e1+ +-- | A valuation scenario that is derived from another valuation +-- scenario.+data DerivedValuationScenario = DerivedValuationScenario+ { derivedValScenar_ID :: Maybe Xsd.ID+ , derivedValScenar_name :: Maybe Xsd.XsdString+ -- ^ The (optional) name for this valuation scenario, used for + -- understandability. For example "EOD Valuations".+ , derivedValScenar_baseValuationScenario :: Maybe ValuationScenarioReference+ -- ^ An (optional) reference to a valuation scenario from which + -- this one is derived.+ , derivedValScenar_valuationDate :: Maybe IdentifiedDate+ -- ^ The (optional) date for which the assets are valued. If not + -- present, the valuation date will be that of the base + -- valuation scenario.+ , derivedValScenar_marketReference :: Maybe MarketReference+ -- ^ A reference to the market environment used to price the + -- asset. If not present, the market will be that of the base + -- valuation scenario.+ , derivedValScenar_shift :: [PricingParameterShift]+ -- ^ A collection of shifts to be applied to market inputs prior + -- to computation of the derivative.+ }+ deriving (Eq,Show)+instance SchemaType DerivedValuationScenario where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (DerivedValuationScenario a0)+ `apply` optional (parseSchemaType "name")+ `apply` optional (parseSchemaType "baseValuationScenario")+ `apply` optional (parseSchemaType "valuationDate")+ `apply` optional (parseSchemaType "marketReference")+ `apply` many (parseSchemaType "shift")+ schemaTypeToXML s x@DerivedValuationScenario{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ derivedValScenar_ID x+ ]+ [ maybe [] (schemaTypeToXML "name") $ derivedValScenar_name x+ , maybe [] (schemaTypeToXML "baseValuationScenario") $ derivedValScenar_baseValuationScenario x+ , maybe [] (schemaTypeToXML "valuationDate") $ derivedValScenar_valuationDate x+ , maybe [] (schemaTypeToXML "marketReference") $ derivedValScenar_marketReference x+ , concatMap (schemaTypeToXML "shift") $ derivedValScenar_shift x+ ]+ +-- | Some kind of numerical measure about an asset, eg. its NPV, +-- together with characteristics of that measure, together +-- with optional sensitivities.+data Quotation = Quotation+ { quotation_value :: Maybe Xsd.Decimal+ -- ^ The value of the the quotation.+ , quotation_measureType :: Maybe AssetMeasureType+ -- ^ The type of the value that is measured. This could be an + -- NPV, a cash flow, a clean price, etc.+ , quotation_quoteUnits :: Maybe PriceQuoteUnits+ -- ^ The optional units that the measure is expressed in. If not + -- supplied, this is assumed to be a price/value in currency + -- units.+ , quotation_side :: Maybe QuotationSideEnum+ -- ^ The side (bid/mid/ask) of the measure.+ , quotation_currency :: Maybe Currency+ -- ^ The optional currency that the measure is expressed in. If + -- not supplied, this is defaulted from the reportingCurrency + -- in the valuationScenarioDefinition.+ , quotation_currencyType :: Maybe ReportingCurrencyType+ -- ^ The optional currency that the measure is expressed in. If + -- not supplied, this is defaulted from the reportingCurrency + -- in the valuationScenarioDefinition.+ , quotation_timing :: Maybe QuoteTiming+ -- ^ When during a day the quote is for. Typically, if this + -- element is supplied, the QuoteLocation needs also to be + -- supplied.+ , quotation_choice7 :: (Maybe (OneOf2 BusinessCenter ExchangeId))+ -- ^ Choice between:+ -- + -- (1) A city or other business center.+ -- + -- (2) The exchange (e.g. stock or futures exchange) from + -- which the quote is obtained.+ , quotation_informationSource :: [InformationSource]+ -- ^ The information source where a published or displayed + -- market rate will be obtained, e.g. Telerate Page 3750.+ , quotation_pricingModel :: Maybe PricingModel+ -- ^ .+ , quotation_time :: Maybe Xsd.DateTime+ -- ^ When the quote was observed or derived.+ , quotation_valuationDate :: Maybe Xsd.Date+ -- ^ When the quote was computed.+ , quotation_expiryTime :: Maybe Xsd.DateTime+ -- ^ When does the quote cease to be valid.+ , quotation_cashflowType :: Maybe CashflowType+ -- ^ For cash flows, the type of the cash flows. Examples + -- include: Coupon payment, Premium Fee, Settlement Fee, + -- Brokerage Fee, etc.+ , quotation_sensitivitySet :: [SensitivitySet]+ -- ^ Zero or more sets of sensitivities of this measure to + -- various input parameters.+ }+ deriving (Eq,Show)+instance SchemaType Quotation where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Quotation+ `apply` optional (parseSchemaType "value")+ `apply` optional (parseSchemaType "measureType")+ `apply` optional (parseSchemaType "quoteUnits")+ `apply` optional (parseSchemaType "side")+ `apply` optional (parseSchemaType "currency")+ `apply` optional (parseSchemaType "currencyType")+ `apply` optional (parseSchemaType "timing")+ `apply` optional (oneOf' [ ("BusinessCenter", fmap OneOf2 (parseSchemaType "businessCenter"))+ , ("ExchangeId", fmap TwoOf2 (parseSchemaType "exchangeId"))+ ])+ `apply` many (parseSchemaType "informationSource")+ `apply` optional (parseSchemaType "pricingModel")+ `apply` optional (parseSchemaType "time")+ `apply` optional (parseSchemaType "valuationDate")+ `apply` optional (parseSchemaType "expiryTime")+ `apply` optional (parseSchemaType "cashflowType")+ `apply` many (parseSchemaType "sensitivitySet")+ schemaTypeToXML s x@Quotation{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "value") $ quotation_value x+ , maybe [] (schemaTypeToXML "measureType") $ quotation_measureType x+ , maybe [] (schemaTypeToXML "quoteUnits") $ quotation_quoteUnits x+ , maybe [] (schemaTypeToXML "side") $ quotation_side x+ , maybe [] (schemaTypeToXML "currency") $ quotation_currency x+ , maybe [] (schemaTypeToXML "currencyType") $ quotation_currencyType x+ , maybe [] (schemaTypeToXML "timing") $ quotation_timing x+ , maybe [] (foldOneOf2 (schemaTypeToXML "businessCenter")+ (schemaTypeToXML "exchangeId")+ ) $ quotation_choice7 x+ , concatMap (schemaTypeToXML "informationSource") $ quotation_informationSource x+ , maybe [] (schemaTypeToXML "pricingModel") $ quotation_pricingModel x+ , maybe [] (schemaTypeToXML "time") $ quotation_time x+ , maybe [] (schemaTypeToXML "valuationDate") $ quotation_valuationDate x+ , maybe [] (schemaTypeToXML "expiryTime") $ quotation_expiryTime x+ , maybe [] (schemaTypeToXML "cashflowType") $ quotation_cashflowType x+ , concatMap (schemaTypeToXML "sensitivitySet") $ quotation_sensitivitySet x+ ]+ +-- | The roles of the parties in reporting information such as +-- positions.+data ReportingRoles = ReportingRoles+ { reportRoles_baseParty :: Maybe PartyReference+ -- ^ A reference to the party from whose perspective the + -- position is valued, ie. the owner or holder of the + -- position.+ , reportRoles_baseAccount :: Maybe AccountReference+ -- ^ A reference to the party from whose perspective the + -- position is valued, ie. the owner or holder of the + -- position.+ , reportRoles_activityProvider :: Maybe PartyReference+ -- ^ A reference to the party responsible for reporting trading + -- activities.+ , reportRoles_positionProvider :: Maybe PartyReference+ -- ^ A reference to the party responsible for reporting the + -- position itself and its constituents.+ , reportRoles_valuationProvider :: Maybe PartyReference+ -- ^ A reference to the party responsible for calculating and + -- reporting the valuations of the positions.+ }+ deriving (Eq,Show)+instance SchemaType ReportingRoles where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ReportingRoles+ `apply` optional (parseSchemaType "baseParty")+ `apply` optional (parseSchemaType "baseAccount")+ `apply` optional (parseSchemaType "activityProvider")+ `apply` optional (parseSchemaType "positionProvider")+ `apply` optional (parseSchemaType "valuationProvider")+ schemaTypeToXML s x@ReportingRoles{} =+ toXMLElement s []+ [ maybe [] (schemaTypeToXML "baseParty") $ reportRoles_baseParty x+ , maybe [] (schemaTypeToXML "baseAccount") $ reportRoles_baseAccount x+ , maybe [] (schemaTypeToXML "activityProvider") $ reportRoles_activityProvider x+ , maybe [] (schemaTypeToXML "positionProvider") $ reportRoles_positionProvider x+ , maybe [] (schemaTypeToXML "valuationProvider") $ reportRoles_valuationProvider x+ ]+ +-- | An servicing date relevant for a trade structure, such as a +-- payment or a reset.+data ScheduledDate = ScheduledDate+ { schedDate_choice0 :: (Maybe (OneOf1 ((Maybe (Xsd.Date)),(Maybe (Xsd.Date)))))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * unadjustedDate+ -- + -- * adjustedDate+ , schedDate_type :: Maybe ScheduledDateType+ -- ^ The type of the date, e.g. next or previous payment.+ , schedDate_assetReference :: Maybe AnyAssetReference+ -- ^ A reference to the leg (or other product component) for + -- which these dates occur.+ , schedDate_choice3 :: (Maybe (OneOf2 AssetValuation ValuationReference))+ -- ^ Choice between:+ -- + -- (1) The value that is associated with the scheduled date.+ -- + -- (2) A reference to the value associated with this scheduled + -- date.+ }+ deriving (Eq,Show)+instance SchemaType ScheduledDate where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ScheduledDate+ `apply` optional (oneOf' [ ("Maybe Xsd.Date Maybe Xsd.Date", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "unadjustedDate")+ `apply` optional (parseSchemaType "adjustedDate")))+ ])+ `apply` optional (parseSchemaType "type")+ `apply` optional (parseSchemaType "assetReference")+ `apply` optional (oneOf' [ ("AssetValuation", fmap OneOf2 (parseSchemaType "associatedValue"))+ , ("ValuationReference", fmap TwoOf2 (parseSchemaType "associatedValueReference"))+ ])+ schemaTypeToXML s x@ScheduledDate{} =+ toXMLElement s []+ [ maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "unadjustedDate") a+ , maybe [] (schemaTypeToXML "adjustedDate") b+ ])+ ) $ schedDate_choice0 x+ , maybe [] (schemaTypeToXML "type") $ schedDate_type x+ , maybe [] (schemaTypeToXML "assetReference") $ schedDate_assetReference x+ , maybe [] (foldOneOf2 (schemaTypeToXML "associatedValue")+ (schemaTypeToXML "associatedValueReference")+ ) $ schedDate_choice3 x+ ]+ +-- | A list of dates (cash flows, resets, etc.) that are +-- relevant for this structure, e.g. next cash flow, last +-- reset, etc. Provides a way to list upcoming or recent +-- servicing dates related to this trade stream in a way that +-- is simpler and more flexible than the FpML "cashflows" +-- structure.+data ScheduledDates = ScheduledDates+ { schedDates_scheduledDate :: [ScheduledDate]+ -- ^ A single stream level scheduled servicing date.+ }+ deriving (Eq,Show)+instance SchemaType ScheduledDates where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return ScheduledDates+ `apply` many (parseSchemaType "scheduledDate")+ schemaTypeToXML s x@ScheduledDates{} =+ toXMLElement s []+ [ concatMap (schemaTypeToXML "scheduledDate") $ schedDates_scheduledDate x+ ]+ +-- | A scheme used to identify the type of a stream scheduled +-- servicing date.+data ScheduledDateType = ScheduledDateType Scheme ScheduledDateTypeAttributes deriving (Eq,Show)+data ScheduledDateTypeAttributes = ScheduledDateTypeAttributes+ { schedDateTypeAttrib_scheduledDateTypeScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ScheduledDateType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "scheduledDateTypeScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ScheduledDateType v (ScheduledDateTypeAttributes a0)+ schemaTypeToXML s (ScheduledDateType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "scheduledDateTypeScheme") $ schedDateTypeAttrib_scheduledDateTypeScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ScheduledDateType Scheme where+ supertype (ScheduledDateType s _) = s+ +-- | The sensitivity of a value to a defined change in input +-- parameters.+data Sensitivity = Sensitivity Xsd.Decimal SensitivityAttributes deriving (Eq,Show)+data SensitivityAttributes = SensitivityAttributes+ { sensitAttrib_name :: Maybe Xsd.NormalizedString+ -- ^ A optional name for this sensitivity. This is primarily + -- intended for display purposes.+ , sensitAttrib_definitionRef :: Maybe Xsd.IDREF+ -- ^ A optional (but normally supplied) reference to the + -- definition of this sensitivity.+ }+ deriving (Eq,Show)+instance SchemaType Sensitivity where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "name" e pos+ a1 <- optional $ getAttribute "definitionRef" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ Sensitivity v (SensitivityAttributes a0 a1)+ schemaTypeToXML s (Sensitivity bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "name") $ sensitAttrib_name at+ , maybe [] (toXMLAttribute "definitionRef") $ sensitAttrib_definitionRef at+ ]+ $ schemaTypeToXML s bt+instance Extension Sensitivity Xsd.Decimal where+ supertype (Sensitivity s _) = s+ +-- | A collection of sensitivities. References a definition that +-- explains the meaning/type of the sensitivities.+data SensitivitySet = SensitivitySet+ { sensitSet_ID :: Maybe Xsd.ID+ , sensitSet_name :: Maybe Xsd.XsdString+ , sensitSet_definitionReference :: Maybe SensitivitySetDefinitionReference+ -- ^ A reference to a sensitivity set definition.+ , sensitSet_sensitivity :: [Sensitivity]+ }+ deriving (Eq,Show)+instance SchemaType SensitivitySet where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (SensitivitySet a0)+ `apply` optional (parseSchemaType "name")+ `apply` optional (parseSchemaType "definitionReference")+ `apply` many (parseSchemaType "sensitivity")+ schemaTypeToXML s x@SensitivitySet{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ sensitSet_ID x+ ]+ [ maybe [] (schemaTypeToXML "name") $ sensitSet_name x+ , maybe [] (schemaTypeToXML "definitionReference") $ sensitSet_definitionReference x+ , concatMap (schemaTypeToXML "sensitivity") $ sensitSet_sensitivity x+ ]+ +-- | A set of valuation.+data Valuations = Valuations+ { valuations_choice0 :: (Maybe (OneOf2 AssetValuation ValuationReference))+ -- ^ Choice between:+ -- + -- (1) valuation+ -- + -- (2) A reference to a quotation+ }+ deriving (Eq,Show)+instance SchemaType Valuations where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return Valuations+ `apply` optional (oneOf' [ ("AssetValuation", fmap OneOf2 (parseSchemaType "valuation"))+ , ("ValuationReference", fmap TwoOf2 (parseSchemaType "valuationReference"))+ ])+ schemaTypeToXML s x@Valuations{} =+ toXMLElement s []+ [ maybe [] (foldOneOf2 (schemaTypeToXML "valuation")+ (schemaTypeToXML "valuationReference")+ ) $ valuations_choice0 x+ ]+ +-- | A set of valuation inputs and results. This structure can +-- be used for requesting valuations, or for reporting them. +-- In general, the request fills in fewer elements.+data ValuationSet = ValuationSet+ { valuationSet_ID :: Maybe Xsd.ID+ , valuationSet_name :: Maybe Xsd.XsdString+ -- ^ The name of the valuation set, used to understand what it + -- means. E.g., "EOD Values and Risks for Party A".+ , valuationSet_valuationScenario :: [ValuationScenario]+ -- ^ Valuation scenerios used (requested/reported) in this + -- valuation set. E.g., the EOD valuation scenario for a + -- particular value date. Used for the first occurrence of a + -- valuation scenario in a document.+ , valuationSet_valuationScenarioReference :: [ValuationScenarioReference]+ -- ^ References to valuation scenarios used (requested/reported) + -- in this valuation set. E..g, a reference to the EOD + -- valuation scenario for a particular value date. Used for + -- subsequence occurrences of a valuation set in an FpML + -- document.+ , valuationSet_baseParty :: Maybe PartyReference+ -- ^ Reference to the party from whose point of view the assets + -- are valued.+ , valuationSet_quotationCharacteristics :: [QuotationCharacteristics]+ -- ^ Charactistics (measure types, units, sides, etc.) of the + -- quotes used (requested/reported) in the valuation set.+ , valuationSet_sensitivitySetDefinition :: [SensitivitySetDefinition]+ -- ^ Definition(s) of sensitivity sets used (requested or + -- reported) in this valuation set.+ , valuationSet_detail :: Maybe ValuationSetDetail+ -- ^ Does this valuation set include a market environment?+ , valuationSet_assetValuation :: [AssetValuation]+ -- ^ Valuations reported in this valuation set. These values can + -- be values (NPVs, prices, etc.) or risks (DAR, etc.) and can + -- include sensitivities.+ }+ deriving (Eq,Show)+instance SchemaType ValuationSet where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (ValuationSet a0)+ `apply` optional (parseSchemaType "name")+ `apply` many (parseSchemaType "valuationScenario")+ `apply` many (parseSchemaType "valuationScenarioReference")+ `apply` optional (parseSchemaType "baseParty")+ `apply` many (parseSchemaType "quotationCharacteristics")+ `apply` many (parseSchemaType "sensitivitySetDefinition")+ `apply` optional (parseSchemaType "detail")+ `apply` many (parseSchemaType "assetValuation")+ schemaTypeToXML s x@ValuationSet{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ valuationSet_ID x+ ]+ [ maybe [] (schemaTypeToXML "name") $ valuationSet_name x+ , concatMap (schemaTypeToXML "valuationScenario") $ valuationSet_valuationScenario x+ , concatMap (schemaTypeToXML "valuationScenarioReference") $ valuationSet_valuationScenarioReference x+ , maybe [] (schemaTypeToXML "baseParty") $ valuationSet_baseParty x+ , concatMap (schemaTypeToXML "quotationCharacteristics") $ valuationSet_quotationCharacteristics x+ , concatMap (schemaTypeToXML "sensitivitySetDefinition") $ valuationSet_sensitivitySetDefinition x+ , maybe [] (schemaTypeToXML "detail") $ valuationSet_detail x+ , concatMap (schemaTypeToXML "assetValuation") $ valuationSet_assetValuation x+ ]+ +-- | The amount of detail provided in the valuation set, e.g. is +-- market environment data provided, are risk definitions +-- provided, etc.+data ValuationSetDetail = ValuationSetDetail Scheme ValuationSetDetailAttributes deriving (Eq,Show)+data ValuationSetDetailAttributes = ValuationSetDetailAttributes+ { valSetDetailAttrib_valuationSetDetailScheme :: Maybe Xsd.AnyURI+ }+ deriving (Eq,Show)+instance SchemaType ValuationSetDetail where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "valuationSetDetailScheme" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ ValuationSetDetail v (ValuationSetDetailAttributes a0)+ schemaTypeToXML s (ValuationSetDetail bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "valuationSetDetailScheme") $ valSetDetailAttrib_valuationSetDetailScheme at+ ]+ $ schemaTypeToXML s bt+instance Extension ValuationSetDetail Scheme where+ supertype (ValuationSetDetail s _) = s+ +elementValuationSet :: XMLParser ValuationSet+elementValuationSet = parseSchemaType "valuationSet"+elementToXMLValuationSet :: ValuationSet -> [Content ()]+elementToXMLValuationSet = schemaTypeToXML "valuationSet"+ + + + +-- | A collection of related trades or positions and the +-- corresponding aggregate exposures generated by these.+data Position = Position+ { position_ID :: Maybe Xsd.ID+ , position_id :: Maybe PositionId+ -- ^ A version-independent identifier for the position, possibly + -- based on trade identifier.+ , position_version :: Maybe Xsd.PositiveInteger+ -- ^ A version identifier. Version identifiers must be + -- ascending, i.e. higher numbers imply newer versions. There + -- is no requirement that version identifiers for a position + -- be sequential or small, so for example timestamp-based + -- version identifiers could be used.+ , position_status :: Maybe PositionStatusEnum+ , position_creationDate :: Maybe Xsd.Date+ , position_originatingEvent :: Maybe PositionOriginEnum+ , position_history :: Maybe PositionHistory+ , position_reportingRoles :: Maybe ReportingRoles+ -- ^ Information about the roles of the parties with respect to + -- reporting the positions.+ , position_constituent :: Maybe PositionConstituent+ -- ^ The components that create this position.+ , position_scheduledDate :: [ScheduledDate]+ -- ^ Position level schedule date, such as final payment dates, + -- in a simple and flexible format.+ , position_valuation :: [AssetValuation]+ -- ^ Valuation reported for the position, such as NPV or accrued + -- interest. The asset/object references in the valuations + -- should refer to the deal or components of the deal in the + -- position, e.g. legs, streams, or underlyers.+ }+ deriving (Eq,Show)+instance SchemaType Position where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "id" e pos+ commit $ interior e $ return (Position a0)+ `apply` optional (parseSchemaType "positionId")+ `apply` optional (parseSchemaType "version")+ `apply` optional (parseSchemaType "status")+ `apply` optional (parseSchemaType "creationDate")+ `apply` optional (parseSchemaType "originatingEvent")+ `apply` optional (parseSchemaType "history")+ `apply` optional (parseSchemaType "reportingRoles")+ `apply` optional (parseSchemaType "constituent")+ `apply` many (parseSchemaType "scheduledDate")+ `apply` many (parseSchemaType "valuation")+ schemaTypeToXML s x@Position{} =+ toXMLElement s [ maybe [] (toXMLAttribute "id") $ position_ID x+ ]+ [ maybe [] (schemaTypeToXML "positionId") $ position_id x+ , maybe [] (schemaTypeToXML "version") $ position_version x+ , maybe [] (schemaTypeToXML "status") $ position_status x+ , maybe [] (schemaTypeToXML "creationDate") $ position_creationDate x+ , maybe [] (schemaTypeToXML "originatingEvent") $ position_originatingEvent x+ , maybe [] (schemaTypeToXML "history") $ position_history x+ , maybe [] (schemaTypeToXML "reportingRoles") $ position_reportingRoles x+ , maybe [] (schemaTypeToXML "constituent") $ position_constituent x+ , concatMap (schemaTypeToXML "scheduledDate") $ position_scheduledDate x+ , concatMap (schemaTypeToXML "valuation") $ position_valuation x+ ]+ + +-- | A list of events that have affected a position.+data PositionHistory = PositionHistory+ { positHistory_choice0 :: (Maybe (OneOf10 ((Maybe (OriginatingEvent)),(Maybe (Trade))) TradeAmendmentContent TradeNotionalChange ((Maybe (TerminatingEvent)),(Maybe (TradeNotionalChange))) TradeNovationContent OptionExercise [OptionExpiry] DeClear Withdrawal AdditionalEvent))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * originatingEvent+ -- + -- * trade+ -- + -- (2) amendment+ -- + -- (3) increase+ -- + -- (4) Sequence of:+ -- + -- * terminatingEvent+ -- + -- * termination+ -- + -- (5) novation+ -- + -- (6) optionExercise+ -- + -- (7) optionExpiry+ -- + -- (8) deClear+ -- + -- (9) withdrawal+ -- + -- (10) The additionalEvent element is an + -- extension/substitution point to customize FpML and add + -- additional events.+ }+ deriving (Eq,Show)+instance SchemaType PositionHistory where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PositionHistory+ `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))+ ])+ schemaTypeToXML s x@PositionHistory{} =+ toXMLElement s []+ [ 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)+ ) $ positHistory_choice0 x+ ]+ +-- | The items (trades, trade references, holdings, other +-- positions) that comprise this position. Currently a +-- position may consist only of a single trade, a reference to +-- a previously submitted position, or a reference to the +-- trade. The choice structure is optional to allow extensions +-- to be placed within this container.+data PositionConstituent = PositionConstituent+ { positConstit_choice0 :: (Maybe (OneOf3 Trade Xsd.PositiveInteger PartyTradeIdentifiers))+ -- ^ Choice between:+ -- + -- (1) An element that allows the full details of the trade to + -- be used as a mechanism for identifying the trade for + -- which the post-trade event pertains.+ -- + -- (2) A previously submitted version of the position.+ -- + -- (3) The trade reference identifier(s) allocated to the + -- trade by the parties involved.+ }+ deriving (Eq,Show)+instance SchemaType PositionConstituent where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PositionConstituent+ `apply` optional (oneOf' [ ("Trade", fmap OneOf3 (parseSchemaType "trade"))+ , ("Xsd.PositiveInteger", fmap TwoOf3 (parseSchemaType "positionVersionReference"))+ , ("PartyTradeIdentifiers", fmap ThreeOf3 (parseSchemaType "tradeReference"))+ ])+ schemaTypeToXML s x@PositionConstituent{} =+ toXMLElement s []+ [ maybe [] (foldOneOf3 (schemaTypeToXML "trade")+ (schemaTypeToXML "positionVersionReference")+ (schemaTypeToXML "tradeReference")+ ) $ positConstit_choice0 x+ ]
+ Data/FpML/V53/Valuation.hs-boot view
@@ -0,0 +1,151 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.FpML.V53.Valuation+ ( module Data.FpML.V53.Valuation+ , module Data.FpML.V53.Enum+ , module Data.FpML.V53.Riskdef+ , module Data.FpML.V53.Msg+ , 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 qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+import {-# SOURCE #-} Data.FpML.V53.Enum+import {-# SOURCE #-} Data.FpML.V53.Riskdef+import {-# SOURCE #-} Data.FpML.V53.Msg+import {-# SOURCE #-} Data.FpML.V53.Events.Business+ +-- | A structure that holds a set of measures about an asset, +-- including possibly their sensitivities. +data AssetValuation+instance Eq AssetValuation+instance Show AssetValuation+instance SchemaType AssetValuation+instance Extension AssetValuation Valuation+ +-- | A valuation scenario that is derived from another valuation +-- scenario. +data DerivedValuationScenario+instance Eq DerivedValuationScenario+instance Show DerivedValuationScenario+instance SchemaType DerivedValuationScenario+ +-- | Some kind of numerical measure about an asset, eg. its NPV, +-- together with characteristics of that measure, together +-- with optional sensitivities. +data Quotation+instance Eq Quotation+instance Show Quotation+instance SchemaType Quotation+ +-- | The roles of the parties in reporting information such as +-- positions. +data ReportingRoles+instance Eq ReportingRoles+instance Show ReportingRoles+instance SchemaType ReportingRoles+ +-- | An servicing date relevant for a trade structure, such as a +-- payment or a reset. +data ScheduledDate+instance Eq ScheduledDate+instance Show ScheduledDate+instance SchemaType ScheduledDate+ +-- | A list of dates (cash flows, resets, etc.) that are +-- relevant for this structure, e.g. next cash flow, last +-- reset, etc. Provides a way to list upcoming or recent +-- servicing dates related to this trade stream in a way that +-- is simpler and more flexible than the FpML "cashflows" +-- structure. +data ScheduledDates+instance Eq ScheduledDates+instance Show ScheduledDates+instance SchemaType ScheduledDates+ +-- | A scheme used to identify the type of a stream scheduled +-- servicing date. +data ScheduledDateType+data ScheduledDateTypeAttributes+instance Eq ScheduledDateType+instance Eq ScheduledDateTypeAttributes+instance Show ScheduledDateType+instance Show ScheduledDateTypeAttributes+instance SchemaType ScheduledDateType+instance Extension ScheduledDateType Scheme+ +-- | The sensitivity of a value to a defined change in input +-- parameters. +data Sensitivity+data SensitivityAttributes+instance Eq Sensitivity+instance Eq SensitivityAttributes+instance Show Sensitivity+instance Show SensitivityAttributes+instance SchemaType Sensitivity+instance Extension Sensitivity Xsd.Decimal+ +-- | A collection of sensitivities. References a definition that +-- explains the meaning/type of the sensitivities. +data SensitivitySet+instance Eq SensitivitySet+instance Show SensitivitySet+instance SchemaType SensitivitySet+ +-- | A set of valuation. +data Valuations+instance Eq Valuations+instance Show Valuations+instance SchemaType Valuations+ +-- | A set of valuation inputs and results. This structure can +-- be used for requesting valuations, or for reporting them. +-- In general, the request fills in fewer elements. +data ValuationSet+instance Eq ValuationSet+instance Show ValuationSet+instance SchemaType ValuationSet+ +-- | The amount of detail provided in the valuation set, e.g. is +-- market environment data provided, are risk definitions +-- provided, etc. +data ValuationSetDetail+data ValuationSetDetailAttributes+instance Eq ValuationSetDetail+instance Eq ValuationSetDetailAttributes+instance Show ValuationSetDetail+instance Show ValuationSetDetailAttributes+instance SchemaType ValuationSetDetail+instance Extension ValuationSetDetail Scheme+ +elementValuationSet :: XMLParser ValuationSet+elementToXMLValuationSet :: ValuationSet -> [Content ()]+ + + + +-- | A collection of related trades or positions and the +-- corresponding aggregate exposures generated by these. +data Position+instance Eq Position+instance Show Position+instance SchemaType Position+ + +-- | A list of events that have affected a position. +data PositionHistory+instance Eq PositionHistory+instance Show PositionHistory+instance SchemaType PositionHistory+ +-- | The items (trades, trade references, holdings, other +-- positions) that comprise this position. Currently a +-- position may consist only of a single trade, a reference to +-- a previously submitted position, or a reference to the +-- trade. The choice structure is optional to allow extensions +-- to be placed within this container. +data PositionConstituent+instance Eq PositionConstituent+instance Show PositionConstituent+instance SchemaType PositionConstituent
+ Data/Xmldsig/Core/Schema.hs view
@@ -0,0 +1,754 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.Xmldsig.Core.Schema+ ( module Data.Xmldsig.Core.Schema+ ) 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 Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+ +-- Some hs-boot imports are required, for fwd-declaring types.+ +newtype CryptoBinary = CryptoBinary Base64Binary deriving (Eq,Show)+instance Restricts CryptoBinary Base64Binary where+ restricts (CryptoBinary x) = x+instance SchemaType CryptoBinary where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s (CryptoBinary x) = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType CryptoBinary where+ acceptingParser = fmap CryptoBinary acceptingParser+ -- XXX should enforce the restrictions somehow?+ -- The restrictions are:+ simpleTypeText (CryptoBinary x) = simpleTypeText x+ +elementSignature :: XMLParser SignatureType+elementSignature = parseSchemaType "Signature"+elementToXMLSignature :: SignatureType -> [Content ()]+elementToXMLSignature = schemaTypeToXML "Signature"+ +data SignatureType = SignatureType+ { signatType_id :: Maybe ID+ , signatType_signedInfo :: SignedInfoType+ , signatType_signatureValue :: SignatureValueType+ , signatType_keyInfo :: Maybe KeyInfoType+ , signatType_object :: [ObjectType]+ }+ deriving (Eq,Show)+instance SchemaType SignatureType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "Id" e pos+ commit $ interior e $ return (SignatureType a0)+ `apply` elementSignedInfo+ `apply` elementSignatureValue+ `apply` optional (elementKeyInfo)+ `apply` many (elementObject)+ schemaTypeToXML s x@SignatureType{} =+ toXMLElement s [ maybe [] (toXMLAttribute "Id") $ signatType_id x+ ]+ [ elementToXMLSignedInfo $ signatType_signedInfo x+ , elementToXMLSignatureValue $ signatType_signatureValue x+ , maybe [] (elementToXMLKeyInfo) $ signatType_keyInfo x+ , concatMap (elementToXMLObject) $ signatType_object x+ ]+ +elementSignatureValue :: XMLParser SignatureValueType+elementSignatureValue = parseSchemaType "SignatureValue"+elementToXMLSignatureValue :: SignatureValueType -> [Content ()]+elementToXMLSignatureValue = schemaTypeToXML "SignatureValue"+ +data SignatureValueType = SignatureValueType Base64Binary SignatureValueTypeAttributes deriving (Eq,Show)+data SignatureValueTypeAttributes = SignatureValueTypeAttributes+ { signatValueTypeAttrib_id :: Maybe ID+ }+ deriving (Eq,Show)+instance SchemaType SignatureValueType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ do+ a0 <- optional $ getAttribute "Id" e pos+ reparse [CElem e pos]+ v <- parseSchemaType s+ return $ SignatureValueType v (SignatureValueTypeAttributes a0)+ schemaTypeToXML s (SignatureValueType bt at) =+ addXMLAttributes [ maybe [] (toXMLAttribute "Id") $ signatValueTypeAttrib_id at+ ]+ $ schemaTypeToXML s bt+instance Extension SignatureValueType Base64Binary where+ supertype (SignatureValueType s _) = s+ +elementSignedInfo :: XMLParser SignedInfoType+elementSignedInfo = parseSchemaType "SignedInfo"+elementToXMLSignedInfo :: SignedInfoType -> [Content ()]+elementToXMLSignedInfo = schemaTypeToXML "SignedInfo"+ +data SignedInfoType = SignedInfoType+ { signedInfoType_id :: Maybe ID+ , signedInfoType_canonicalizationMethod :: CanonicalizationMethodType+ , signedInfoType_signatureMethod :: SignatureMethodType+ , signedInfoType_reference :: [ReferenceType]+ }+ deriving (Eq,Show)+instance SchemaType SignedInfoType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "Id" e pos+ commit $ interior e $ return (SignedInfoType a0)+ `apply` elementCanonicalizationMethod+ `apply` elementSignatureMethod+ `apply` many1 (elementReference)+ schemaTypeToXML s x@SignedInfoType{} =+ toXMLElement s [ maybe [] (toXMLAttribute "Id") $ signedInfoType_id x+ ]+ [ elementToXMLCanonicalizationMethod $ signedInfoType_canonicalizationMethod x+ , elementToXMLSignatureMethod $ signedInfoType_signatureMethod x+ , concatMap (elementToXMLReference) $ signedInfoType_reference x+ ]+ +elementCanonicalizationMethod :: XMLParser CanonicalizationMethodType+elementCanonicalizationMethod = parseSchemaType "CanonicalizationMethod"+elementToXMLCanonicalizationMethod :: CanonicalizationMethodType -> [Content ()]+elementToXMLCanonicalizationMethod = schemaTypeToXML "CanonicalizationMethod"+ +data CanonicalizationMethodType = CanonicalizationMethodType+ { canonMethodType_algorithm :: AnyURI+ , canonMethodType_text0 :: String+ , canonMethodType_any1 :: [AnyElement]+ , canonMethodType_text2 :: String+ }+ deriving (Eq,Show)+instance SchemaType CanonicalizationMethodType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "Algorithm" e pos+ commit $ interior e $ return (CanonicalizationMethodType a0)+ `apply` parseText+ `apply` many (parseAnyElement)+ `apply` parseText+ schemaTypeToXML s x@CanonicalizationMethodType{} =+ toXMLElement s [ toXMLAttribute "Algorithm" $ canonMethodType_algorithm x+ ]+ [ toXMLText $ canonMethodType_text0 x+ , concatMap (toXMLAnyElement) $ canonMethodType_any1 x+ , toXMLText $ canonMethodType_text2 x+ ]+ +elementSignatureMethod :: XMLParser SignatureMethodType+elementSignatureMethod = parseSchemaType "SignatureMethod"+elementToXMLSignatureMethod :: SignatureMethodType -> [Content ()]+elementToXMLSignatureMethod = schemaTypeToXML "SignatureMethod"+ +data SignatureMethodType = SignatureMethodType+ { signatMethodType_algorithm :: AnyURI+ , signatMethodType_text0 :: String+ , signatMethodType_hMACOutputLength :: Maybe HMACOutputLengthType+ , signatMethodType_text2 :: String+ , signatMethodType_any3 :: [AnyElement]+ , signatMethodType_text4 :: String+ }+ deriving (Eq,Show)+instance SchemaType SignatureMethodType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "Algorithm" e pos+ commit $ interior e $ return (SignatureMethodType a0)+ `apply` parseText+ `apply` optional (parseSchemaType "HMACOutputLength")+ `apply` parseText+ `apply` many (parseAnyElement)+ `apply` parseText+ schemaTypeToXML s x@SignatureMethodType{} =+ toXMLElement s [ toXMLAttribute "Algorithm" $ signatMethodType_algorithm x+ ]+ [ toXMLText $ signatMethodType_text0 x+ , maybe [] (schemaTypeToXML "HMACOutputLength") $ signatMethodType_hMACOutputLength x+ , toXMLText $ signatMethodType_text2 x+ , concatMap (toXMLAnyElement) $ signatMethodType_any3 x+ , toXMLText $ signatMethodType_text4 x+ ]+ +elementReference :: XMLParser ReferenceType+elementReference = parseSchemaType "Reference"+elementToXMLReference :: ReferenceType -> [Content ()]+elementToXMLReference = schemaTypeToXML "Reference"+ +data ReferenceType = ReferenceType+ { refType_id :: Maybe ID+ , refType_uRI :: Maybe AnyURI+ , refType_type :: Maybe AnyURI+ , refType_transforms :: Maybe TransformsType+ , refType_digestMethod :: DigestMethodType+ , refType_digestValue :: DigestValueType+ }+ deriving (Eq,Show)+instance SchemaType ReferenceType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "Id" e pos+ a1 <- optional $ getAttribute "URI" e pos+ a2 <- optional $ getAttribute "Type" e pos+ commit $ interior e $ return (ReferenceType a0 a1 a2)+ `apply` optional (elementTransforms)+ `apply` elementDigestMethod+ `apply` elementDigestValue+ schemaTypeToXML s x@ReferenceType{} =+ toXMLElement s [ maybe [] (toXMLAttribute "Id") $ refType_id x+ , maybe [] (toXMLAttribute "URI") $ refType_uRI x+ , maybe [] (toXMLAttribute "Type") $ refType_type x+ ]+ [ maybe [] (elementToXMLTransforms) $ refType_transforms x+ , elementToXMLDigestMethod $ refType_digestMethod x+ , elementToXMLDigestValue $ refType_digestValue x+ ]+ +elementTransforms :: XMLParser TransformsType+elementTransforms = parseSchemaType "Transforms"+elementToXMLTransforms :: TransformsType -> [Content ()]+elementToXMLTransforms = schemaTypeToXML "Transforms"+ +data TransformsType = TransformsType+ { transfType_transform :: [TransformType]+ }+ deriving (Eq,Show)+instance SchemaType TransformsType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return TransformsType+ `apply` many1 (elementTransform)+ schemaTypeToXML s x@TransformsType{} =+ toXMLElement s []+ [ concatMap (elementToXMLTransform) $ transfType_transform x+ ]+ +elementTransform :: XMLParser TransformType+elementTransform = parseSchemaType "Transform"+elementToXMLTransform :: TransformType -> [Content ()]+elementToXMLTransform = schemaTypeToXML "Transform"+ +data TransformType = TransformType+ { transfType_algorithm :: AnyURI+ , transfType_choice0 :: [OneOf3 String Xsd.XsdString (AnyElement)]+ -- ^ Choice between:+ -- + -- (1) mixed text+ -- + -- (2) XPath+ -- + -- (3) unknown+ }+ deriving (Eq,Show)+instance SchemaType TransformType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "Algorithm" e pos+ commit $ interior e $ return (TransformType a0)+ `apply` many (oneOf' [ ("String", fmap OneOf3 (parseText))+ , ("Xsd.XsdString", fmap TwoOf3 (parseSchemaType "XPath"))+ , ("AnyElement", fmap ThreeOf3 (parseAnyElement))+ ])+ schemaTypeToXML s x@TransformType{} =+ toXMLElement s [ toXMLAttribute "Algorithm" $ transfType_algorithm x+ ]+ [ concatMap (foldOneOf3 (toXMLText)+ (schemaTypeToXML "XPath")+ (toXMLAnyElement)+ ) $ transfType_choice0 x+ ]+ +elementDigestMethod :: XMLParser DigestMethodType+elementDigestMethod = parseSchemaType "DigestMethod"+elementToXMLDigestMethod :: DigestMethodType -> [Content ()]+elementToXMLDigestMethod = schemaTypeToXML "DigestMethod"+ +data DigestMethodType = DigestMethodType+ { digestMethodType_algorithm :: AnyURI+ , digestMethodType_text0 :: String+ , digestMethodType_any1 :: [AnyElement]+ , digestMethodType_text2 :: String+ }+ deriving (Eq,Show)+instance SchemaType DigestMethodType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "Algorithm" e pos+ commit $ interior e $ return (DigestMethodType a0)+ `apply` parseText+ `apply` many (parseAnyElement)+ `apply` parseText+ schemaTypeToXML s x@DigestMethodType{} =+ toXMLElement s [ toXMLAttribute "Algorithm" $ digestMethodType_algorithm x+ ]+ [ toXMLText $ digestMethodType_text0 x+ , concatMap (toXMLAnyElement) $ digestMethodType_any1 x+ , toXMLText $ digestMethodType_text2 x+ ]+ +elementDigestValue :: XMLParser DigestValueType+elementDigestValue = parseSchemaType "DigestValue"+elementToXMLDigestValue :: DigestValueType -> [Content ()]+elementToXMLDigestValue = schemaTypeToXML "DigestValue"+ +newtype DigestValueType = DigestValueType Base64Binary deriving (Eq,Show)+instance Restricts DigestValueType Base64Binary where+ restricts (DigestValueType x) = x+instance SchemaType DigestValueType where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s (DigestValueType x) = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType DigestValueType where+ acceptingParser = fmap DigestValueType acceptingParser+ -- XXX should enforce the restrictions somehow?+ -- The restrictions are:+ simpleTypeText (DigestValueType x) = simpleTypeText x+ +elementKeyInfo :: XMLParser KeyInfoType+elementKeyInfo = parseSchemaType "KeyInfo"+elementToXMLKeyInfo :: KeyInfoType -> [Content ()]+elementToXMLKeyInfo = schemaTypeToXML "KeyInfo"+ +data KeyInfoType = KeyInfoType+ { keyInfoType_id :: Maybe ID+ , keyInfoType_choice0 :: [OneOf9 String Xsd.XsdString KeyValueType RetrievalMethodType X509DataType PGPDataType SPKIDataType Xsd.XsdString (AnyElement)]+ -- ^ Choice between:+ -- + -- (1) mixed text+ -- + -- (2) KeyName+ -- + -- (3) KeyValue+ -- + -- (4) RetrievalMethod+ -- + -- (5) X509Data+ -- + -- (6) PGPData+ -- + -- (7) SPKIData+ -- + -- (8) MgmtData+ -- + -- (9) unknown+ }+ deriving (Eq,Show)+instance SchemaType KeyInfoType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "Id" e pos+ commit $ interior e $ return (KeyInfoType a0)+ `apply` many1 (oneOf' [ ("String", fmap OneOf9 (parseText))+ , ("Xsd.XsdString", fmap TwoOf9 (elementKeyName))+ , ("KeyValueType", fmap ThreeOf9 (elementKeyValue))+ , ("RetrievalMethodType", fmap FourOf9 (elementRetrievalMethod))+ , ("X509DataType", fmap FiveOf9 (elementX509Data))+ , ("PGPDataType", fmap SixOf9 (elementPGPData))+ , ("SPKIDataType", fmap SevenOf9 (elementSPKIData))+ , ("Xsd.XsdString", fmap EightOf9 (elementMgmtData))+ , ("AnyElement", fmap NineOf9 (parseAnyElement))+ ])+ schemaTypeToXML s x@KeyInfoType{} =+ toXMLElement s [ maybe [] (toXMLAttribute "Id") $ keyInfoType_id x+ ]+ [ concatMap (foldOneOf9 (toXMLText)+ (elementToXMLKeyName)+ (elementToXMLKeyValue)+ (elementToXMLRetrievalMethod)+ (elementToXMLX509Data)+ (elementToXMLPGPData)+ (elementToXMLSPKIData)+ (elementToXMLMgmtData)+ (toXMLAnyElement)+ ) $ keyInfoType_choice0 x+ ]+ +elementKeyName :: XMLParser Xsd.XsdString+elementKeyName = parseSchemaType "KeyName"+elementToXMLKeyName :: Xsd.XsdString -> [Content ()]+elementToXMLKeyName = schemaTypeToXML "KeyName"+ +elementMgmtData :: XMLParser Xsd.XsdString+elementMgmtData = parseSchemaType "MgmtData"+elementToXMLMgmtData :: Xsd.XsdString -> [Content ()]+elementToXMLMgmtData = schemaTypeToXML "MgmtData"+ +elementKeyValue :: XMLParser KeyValueType+elementKeyValue = parseSchemaType "KeyValue"+elementToXMLKeyValue :: KeyValueType -> [Content ()]+elementToXMLKeyValue = schemaTypeToXML "KeyValue"+ +data KeyValueType = KeyValueType+ { keyValueType_choice0 :: OneOf4 String DSAKeyValueType RSAKeyValueType (AnyElement)+ -- ^ Choice between:+ -- + -- (1) mixed text+ -- + -- (2) DSAKeyValue+ -- + -- (3) RSAKeyValue+ -- + -- (4) unknown+ }+ deriving (Eq,Show)+instance SchemaType KeyValueType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return KeyValueType+ `apply` oneOf' [ ("String", fmap OneOf4 (parseText))+ , ("DSAKeyValueType", fmap TwoOf4 (elementDSAKeyValue))+ , ("RSAKeyValueType", fmap ThreeOf4 (elementRSAKeyValue))+ , ("AnyElement", fmap FourOf4 (parseAnyElement))+ ]+ schemaTypeToXML s x@KeyValueType{} =+ toXMLElement s []+ [ foldOneOf4 (toXMLText)+ (elementToXMLDSAKeyValue)+ (elementToXMLRSAKeyValue)+ (toXMLAnyElement)+ $ keyValueType_choice0 x+ ]+ +elementRetrievalMethod :: XMLParser RetrievalMethodType+elementRetrievalMethod = parseSchemaType "RetrievalMethod"+elementToXMLRetrievalMethod :: RetrievalMethodType -> [Content ()]+elementToXMLRetrievalMethod = schemaTypeToXML "RetrievalMethod"+ +data RetrievalMethodType = RetrievalMethodType+ { retriMethodType_uRI :: Maybe AnyURI+ , retriMethodType_type :: Maybe AnyURI+ , retriMethodType_transforms :: Maybe TransformsType+ }+ deriving (Eq,Show)+instance SchemaType RetrievalMethodType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "URI" e pos+ a1 <- optional $ getAttribute "Type" e pos+ commit $ interior e $ return (RetrievalMethodType a0 a1)+ `apply` optional (elementTransforms)+ schemaTypeToXML s x@RetrievalMethodType{} =+ toXMLElement s [ maybe [] (toXMLAttribute "URI") $ retriMethodType_uRI x+ , maybe [] (toXMLAttribute "Type") $ retriMethodType_type x+ ]+ [ maybe [] (elementToXMLTransforms) $ retriMethodType_transforms x+ ]+ +elementX509Data :: XMLParser X509DataType+elementX509Data = parseSchemaType "X509Data"+elementToXMLX509Data :: X509DataType -> [Content ()]+elementToXMLX509Data = schemaTypeToXML "X509Data"+ +data X509DataType = X509DataType+ { x509DataType_choice0 :: OneOf6 X509IssuerSerialType Base64Binary Xsd.XsdString Base64Binary Base64Binary (AnyElement)+ -- ^ Choice between:+ -- + -- (1) X509IssuerSerial+ -- + -- (2) X509SKI+ -- + -- (3) X509SubjectName+ -- + -- (4) X509Certificate+ -- + -- (5) X509CRL+ -- + -- (6) unknown+ }+ deriving (Eq,Show)+instance SchemaType X509DataType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return X509DataType+ `apply` oneOf' [ ("X509IssuerSerialType", fmap OneOf6 (parseSchemaType "X509IssuerSerial"))+ , ("Base64Binary", fmap TwoOf6 (parseSchemaType "X509SKI"))+ , ("Xsd.XsdString", fmap ThreeOf6 (parseSchemaType "X509SubjectName"))+ , ("Base64Binary", fmap FourOf6 (parseSchemaType "X509Certificate"))+ , ("Base64Binary", fmap FiveOf6 (parseSchemaType "X509CRL"))+ , ("AnyElement", fmap SixOf6 (parseAnyElement))+ ]+ schemaTypeToXML s x@X509DataType{} =+ toXMLElement s []+ [ foldOneOf6 (schemaTypeToXML "X509IssuerSerial")+ (schemaTypeToXML "X509SKI")+ (schemaTypeToXML "X509SubjectName")+ (schemaTypeToXML "X509Certificate")+ (schemaTypeToXML "X509CRL")+ (toXMLAnyElement)+ $ x509DataType_choice0 x+ ]+ +data X509IssuerSerialType = X509IssuerSerialType+ { x509IssuerSerialType_x509IssuerName :: Xsd.XsdString+ , x509IssuerSerialType_x509SerialNumber :: Integer+ }+ deriving (Eq,Show)+instance SchemaType X509IssuerSerialType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return X509IssuerSerialType+ `apply` parseSchemaType "X509IssuerName"+ `apply` parseSchemaType "X509SerialNumber"+ schemaTypeToXML s x@X509IssuerSerialType{} =+ toXMLElement s []+ [ schemaTypeToXML "X509IssuerName" $ x509IssuerSerialType_x509IssuerName x+ , schemaTypeToXML "X509SerialNumber" $ x509IssuerSerialType_x509SerialNumber x+ ]+ +elementPGPData :: XMLParser PGPDataType+elementPGPData = parseSchemaType "PGPData"+elementToXMLPGPData :: PGPDataType -> [Content ()]+elementToXMLPGPData = schemaTypeToXML "PGPData"+ +data PGPDataType = PGPDataType+ { pGPDataType_choice0 :: OneOf2 (Base64Binary,(Maybe (Base64Binary)),([AnyElement])) (Base64Binary,([AnyElement]))+ -- ^ Choice between:+ -- + -- (1) Sequence of:+ -- + -- * PGPKeyID+ -- + -- * PGPKeyPacket+ -- + -- * unknown+ -- + -- (2) Sequence of:+ -- + -- * PGPKeyPacket+ -- + -- * unknown+ }+ deriving (Eq,Show)+instance SchemaType PGPDataType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return PGPDataType+ `apply` oneOf' [ ("Base64Binary Maybe Base64Binary [AnyElement]", fmap OneOf2 (return (,,) `apply` parseSchemaType "PGPKeyID"+ `apply` optional (parseSchemaType "PGPKeyPacket")+ `apply` many (parseAnyElement)))+ , ("Base64Binary [AnyElement]", fmap TwoOf2 (return (,) `apply` parseSchemaType "PGPKeyPacket"+ `apply` many (parseAnyElement)))+ ]+ schemaTypeToXML s x@PGPDataType{} =+ toXMLElement s []+ [ foldOneOf2 (\ (a,b,c) -> concat [ schemaTypeToXML "PGPKeyID" a+ , maybe [] (schemaTypeToXML "PGPKeyPacket") b+ , concatMap (toXMLAnyElement) c+ ])+ (\ (a,b) -> concat [ schemaTypeToXML "PGPKeyPacket" a+ , concatMap (toXMLAnyElement) b+ ])+ $ pGPDataType_choice0 x+ ]+ +elementSPKIData :: XMLParser SPKIDataType+elementSPKIData = parseSchemaType "SPKIData"+elementToXMLSPKIData :: SPKIDataType -> [Content ()]+elementToXMLSPKIData = schemaTypeToXML "SPKIData"+ +data SPKIDataType = SPKIDataType+ { sPKIDataType_sPKISexp :: Base64Binary+ , sPKIDataType_any1 :: Maybe AnyElement+ }+ deriving (Eq,Show)+instance SchemaType SPKIDataType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return SPKIDataType+ `apply` parseSchemaType "SPKISexp"+ `apply` optional (parseAnyElement)+ schemaTypeToXML s x@SPKIDataType{} =+ toXMLElement s []+ [ schemaTypeToXML "SPKISexp" $ sPKIDataType_sPKISexp x+ , maybe [] (toXMLAnyElement) $ sPKIDataType_any1 x+ ]+ +elementObject :: XMLParser ObjectType+elementObject = parseSchemaType "Object"+elementToXMLObject :: ObjectType -> [Content ()]+elementToXMLObject = schemaTypeToXML "Object"+ +data ObjectType = ObjectType+ { objectType_id :: Maybe ID+ , objectType_mimeType :: Maybe Xsd.XsdString+ , objectType_encoding :: Maybe AnyURI+ , objectType_text0 :: String+ , objectType_any1 :: AnyElement+ , objectType_text2 :: String+ }+ deriving (Eq,Show)+instance SchemaType ObjectType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "Id" e pos+ a1 <- optional $ getAttribute "MimeType" e pos+ a2 <- optional $ getAttribute "Encoding" e pos+ commit $ interior e $ return (ObjectType a0 a1 a2)+ `apply` parseText+ `apply` parseAnyElement+ `apply` parseText+ schemaTypeToXML s x@ObjectType{} =+ toXMLElement s [ maybe [] (toXMLAttribute "Id") $ objectType_id x+ , maybe [] (toXMLAttribute "MimeType") $ objectType_mimeType x+ , maybe [] (toXMLAttribute "Encoding") $ objectType_encoding x+ ]+ [ toXMLText $ objectType_text0 x+ , toXMLAnyElement $ objectType_any1 x+ , toXMLText $ objectType_text2 x+ ]+ +elementManifest :: XMLParser ManifestType+elementManifest = parseSchemaType "Manifest"+elementToXMLManifest :: ManifestType -> [Content ()]+elementToXMLManifest = schemaTypeToXML "Manifest"+ +data ManifestType = ManifestType+ { manifestType_id :: Maybe ID+ , manifestType_reference :: [ReferenceType]+ }+ deriving (Eq,Show)+instance SchemaType ManifestType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "Id" e pos+ commit $ interior e $ return (ManifestType a0)+ `apply` many1 (elementReference)+ schemaTypeToXML s x@ManifestType{} =+ toXMLElement s [ maybe [] (toXMLAttribute "Id") $ manifestType_id x+ ]+ [ concatMap (elementToXMLReference) $ manifestType_reference x+ ]+ +elementSignatureProperties :: XMLParser SignaturePropertiesType+elementSignatureProperties = parseSchemaType "SignatureProperties"+elementToXMLSignatureProperties :: SignaturePropertiesType -> [Content ()]+elementToXMLSignatureProperties = schemaTypeToXML "SignatureProperties"+ +data SignaturePropertiesType = SignaturePropertiesType+ { signatPropsType_id :: Maybe ID+ , signatPropsType_signatureProperty :: [SignaturePropertyType]+ }+ deriving (Eq,Show)+instance SchemaType SignaturePropertiesType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- optional $ getAttribute "Id" e pos+ commit $ interior e $ return (SignaturePropertiesType a0)+ `apply` many1 (elementSignatureProperty)+ schemaTypeToXML s x@SignaturePropertiesType{} =+ toXMLElement s [ maybe [] (toXMLAttribute "Id") $ signatPropsType_id x+ ]+ [ concatMap (elementToXMLSignatureProperty) $ signatPropsType_signatureProperty x+ ]+ +elementSignatureProperty :: XMLParser SignaturePropertyType+elementSignatureProperty = parseSchemaType "SignatureProperty"+elementToXMLSignatureProperty :: SignaturePropertyType -> [Content ()]+elementToXMLSignatureProperty = schemaTypeToXML "SignatureProperty"+ +data SignaturePropertyType = SignaturePropertyType+ { signatPropType_target :: AnyURI+ , signatPropType_id :: Maybe ID+ , signatPropType_choice0 :: [OneOf2 String (AnyElement)]+ -- ^ Choice between:+ -- + -- (1) mixed text+ -- + -- (2) unknown+ }+ deriving (Eq,Show)+instance SchemaType SignaturePropertyType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ a0 <- getAttribute "Target" e pos+ a1 <- optional $ getAttribute "Id" e pos+ commit $ interior e $ return (SignaturePropertyType a0 a1)+ `apply` many1 (oneOf' [ ("String", fmap OneOf2 (parseText))+ , ("AnyElement", fmap TwoOf2 (parseAnyElement))+ ])+ schemaTypeToXML s x@SignaturePropertyType{} =+ toXMLElement s [ toXMLAttribute "Target" $ signatPropType_target x+ , maybe [] (toXMLAttribute "Id") $ signatPropType_id x+ ]+ [ concatMap (foldOneOf2 (toXMLText)+ (toXMLAnyElement)+ ) $ signatPropType_choice0 x+ ]+ +newtype HMACOutputLengthType = HMACOutputLengthType Integer deriving (Eq,Show)+instance Restricts HMACOutputLengthType Integer where+ restricts (HMACOutputLengthType x) = x+instance SchemaType HMACOutputLengthType where+ parseSchemaType s = do+ e <- element [s]+ commit $ interior e $ parseSimpleType+ schemaTypeToXML s (HMACOutputLengthType x) = + toXMLElement s [] [toXMLText (simpleTypeText x)]+instance SimpleType HMACOutputLengthType where+ acceptingParser = fmap HMACOutputLengthType acceptingParser+ -- XXX should enforce the restrictions somehow?+ -- The restrictions are:+ simpleTypeText (HMACOutputLengthType x) = simpleTypeText x+ +elementDSAKeyValue :: XMLParser DSAKeyValueType+elementDSAKeyValue = parseSchemaType "DSAKeyValue"+elementToXMLDSAKeyValue :: DSAKeyValueType -> [Content ()]+elementToXMLDSAKeyValue = schemaTypeToXML "DSAKeyValue"+ +data DSAKeyValueType = DSAKeyValueType+ { dSAKeyValueType_p :: CryptoBinary+ , dSAKeyValueType_q :: CryptoBinary+ , dSAKeyValueType_g :: Maybe CryptoBinary+ , dSAKeyValueType_y :: CryptoBinary+ , dSAKeyValueType_j :: Maybe CryptoBinary+ , dSAKeyValueType_seed :: CryptoBinary+ , dSAKeyValueType_pgenCounter :: CryptoBinary+ }+ deriving (Eq,Show)+instance SchemaType DSAKeyValueType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return DSAKeyValueType+ `apply` parseSchemaType "P"+ `apply` parseSchemaType "Q"+ `apply` optional (parseSchemaType "G")+ `apply` parseSchemaType "Y"+ `apply` optional (parseSchemaType "J")+ `apply` parseSchemaType "Seed"+ `apply` parseSchemaType "PgenCounter"+ schemaTypeToXML s x@DSAKeyValueType{} =+ toXMLElement s []+ [ schemaTypeToXML "P" $ dSAKeyValueType_p x+ , schemaTypeToXML "Q" $ dSAKeyValueType_q x+ , maybe [] (schemaTypeToXML "G") $ dSAKeyValueType_g x+ , schemaTypeToXML "Y" $ dSAKeyValueType_y x+ , maybe [] (schemaTypeToXML "J") $ dSAKeyValueType_j x+ , schemaTypeToXML "Seed" $ dSAKeyValueType_seed x+ , schemaTypeToXML "PgenCounter" $ dSAKeyValueType_pgenCounter x+ ]+ +elementRSAKeyValue :: XMLParser RSAKeyValueType+elementRSAKeyValue = parseSchemaType "RSAKeyValue"+elementToXMLRSAKeyValue :: RSAKeyValueType -> [Content ()]+elementToXMLRSAKeyValue = schemaTypeToXML "RSAKeyValue"+ +data RSAKeyValueType = RSAKeyValueType+ { rSAKeyValueType_modulus :: CryptoBinary+ , rSAKeyValueType_exponent :: CryptoBinary+ }+ deriving (Eq,Show)+instance SchemaType RSAKeyValueType where+ parseSchemaType s = do+ (pos,e) <- posnElement [s]+ commit $ interior e $ return RSAKeyValueType+ `apply` parseSchemaType "Modulus"+ `apply` parseSchemaType "Exponent"+ schemaTypeToXML s x@RSAKeyValueType{} =+ toXMLElement s []+ [ schemaTypeToXML "Modulus" $ rSAKeyValueType_modulus x+ , schemaTypeToXML "Exponent" $ rSAKeyValueType_exponent x+ ]
+ Data/Xmldsig/Core/Schema.hs-boot view
@@ -0,0 +1,216 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+module Data.Xmldsig.Core.Schema+ ( module Data.Xmldsig.Core.Schema+ ) where+ +import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))+import Text.XML.HaXml.Schema.Schema as Schema+import Text.XML.HaXml.Schema.PrimitiveTypes as Xsd+ +newtype CryptoBinary = CryptoBinary Base64Binary+instance Eq CryptoBinary+instance Show CryptoBinary+instance Restricts CryptoBinary Base64Binary+instance SchemaType CryptoBinary+instance SimpleType CryptoBinary+ +elementSignature :: XMLParser SignatureType+elementToXMLSignature :: SignatureType -> [Content ()]+ +data SignatureType+instance Eq SignatureType+instance Show SignatureType+instance SchemaType SignatureType+ +elementSignatureValue :: XMLParser SignatureValueType+elementToXMLSignatureValue :: SignatureValueType -> [Content ()]+ +data SignatureValueType+data SignatureValueTypeAttributes+instance Eq SignatureValueType+instance Eq SignatureValueTypeAttributes+instance Show SignatureValueType+instance Show SignatureValueTypeAttributes+instance SchemaType SignatureValueType+instance Extension SignatureValueType Base64Binary+ +elementSignedInfo :: XMLParser SignedInfoType+elementToXMLSignedInfo :: SignedInfoType -> [Content ()]+ +data SignedInfoType+instance Eq SignedInfoType+instance Show SignedInfoType+instance SchemaType SignedInfoType+ +elementCanonicalizationMethod :: XMLParser CanonicalizationMethodType+elementToXMLCanonicalizationMethod :: CanonicalizationMethodType -> [Content ()]+ +data CanonicalizationMethodType+instance Eq CanonicalizationMethodType+instance Show CanonicalizationMethodType+instance SchemaType CanonicalizationMethodType+ +elementSignatureMethod :: XMLParser SignatureMethodType+elementToXMLSignatureMethod :: SignatureMethodType -> [Content ()]+ +data SignatureMethodType+instance Eq SignatureMethodType+instance Show SignatureMethodType+instance SchemaType SignatureMethodType+ +elementReference :: XMLParser ReferenceType+elementToXMLReference :: ReferenceType -> [Content ()]+ +data ReferenceType+instance Eq ReferenceType+instance Show ReferenceType+instance SchemaType ReferenceType+ +elementTransforms :: XMLParser TransformsType+elementToXMLTransforms :: TransformsType -> [Content ()]+ +data TransformsType+instance Eq TransformsType+instance Show TransformsType+instance SchemaType TransformsType+ +elementTransform :: XMLParser TransformType+elementToXMLTransform :: TransformType -> [Content ()]+ +data TransformType+instance Eq TransformType+instance Show TransformType+instance SchemaType TransformType+ +elementDigestMethod :: XMLParser DigestMethodType+elementToXMLDigestMethod :: DigestMethodType -> [Content ()]+ +data DigestMethodType+instance Eq DigestMethodType+instance Show DigestMethodType+instance SchemaType DigestMethodType+ +elementDigestValue :: XMLParser DigestValueType+elementToXMLDigestValue :: DigestValueType -> [Content ()]+ +newtype DigestValueType = DigestValueType Base64Binary+instance Eq DigestValueType+instance Show DigestValueType+instance Restricts DigestValueType Base64Binary+instance SchemaType DigestValueType+instance SimpleType DigestValueType+ +elementKeyInfo :: XMLParser KeyInfoType+elementToXMLKeyInfo :: KeyInfoType -> [Content ()]+ +data KeyInfoType+instance Eq KeyInfoType+instance Show KeyInfoType+instance SchemaType KeyInfoType+ +elementKeyName :: XMLParser Xsd.XsdString+elementToXMLKeyName :: Xsd.XsdString -> [Content ()]+ +elementMgmtData :: XMLParser Xsd.XsdString+elementToXMLMgmtData :: Xsd.XsdString -> [Content ()]+ +elementKeyValue :: XMLParser KeyValueType+elementToXMLKeyValue :: KeyValueType -> [Content ()]+ +data KeyValueType+instance Eq KeyValueType+instance Show KeyValueType+instance SchemaType KeyValueType+ +elementRetrievalMethod :: XMLParser RetrievalMethodType+elementToXMLRetrievalMethod :: RetrievalMethodType -> [Content ()]+ +data RetrievalMethodType+instance Eq RetrievalMethodType+instance Show RetrievalMethodType+instance SchemaType RetrievalMethodType+ +elementX509Data :: XMLParser X509DataType+elementToXMLX509Data :: X509DataType -> [Content ()]+ +data X509DataType+instance Eq X509DataType+instance Show X509DataType+instance SchemaType X509DataType+ +data X509IssuerSerialType+instance Eq X509IssuerSerialType+instance Show X509IssuerSerialType+instance SchemaType X509IssuerSerialType+ +elementPGPData :: XMLParser PGPDataType+elementToXMLPGPData :: PGPDataType -> [Content ()]+ +data PGPDataType+instance Eq PGPDataType+instance Show PGPDataType+instance SchemaType PGPDataType+ +elementSPKIData :: XMLParser SPKIDataType+elementToXMLSPKIData :: SPKIDataType -> [Content ()]+ +data SPKIDataType+instance Eq SPKIDataType+instance Show SPKIDataType+instance SchemaType SPKIDataType+ +elementObject :: XMLParser ObjectType+elementToXMLObject :: ObjectType -> [Content ()]+ +data ObjectType+instance Eq ObjectType+instance Show ObjectType+instance SchemaType ObjectType+ +elementManifest :: XMLParser ManifestType+elementToXMLManifest :: ManifestType -> [Content ()]+ +data ManifestType+instance Eq ManifestType+instance Show ManifestType+instance SchemaType ManifestType+ +elementSignatureProperties :: XMLParser SignaturePropertiesType+elementToXMLSignatureProperties :: SignaturePropertiesType -> [Content ()]+ +data SignaturePropertiesType+instance Eq SignaturePropertiesType+instance Show SignaturePropertiesType+instance SchemaType SignaturePropertiesType+ +elementSignatureProperty :: XMLParser SignaturePropertyType+elementToXMLSignatureProperty :: SignaturePropertyType -> [Content ()]+ +data SignaturePropertyType+instance Eq SignaturePropertyType+instance Show SignaturePropertyType+instance SchemaType SignaturePropertyType+ +newtype HMACOutputLengthType = HMACOutputLengthType Integer+instance Eq HMACOutputLengthType+instance Show HMACOutputLengthType+instance Restricts HMACOutputLengthType Integer+instance SchemaType HMACOutputLengthType+instance SimpleType HMACOutputLengthType+ +elementDSAKeyValue :: XMLParser DSAKeyValueType+elementToXMLDSAKeyValue :: DSAKeyValueType -> [Content ()]+ +data DSAKeyValueType+instance Eq DSAKeyValueType+instance Show DSAKeyValueType+instance SchemaType DSAKeyValueType+ +elementRSAKeyValue :: XMLParser RSAKeyValueType+elementToXMLRSAKeyValue :: RSAKeyValueType -> [Content ()]+ +data RSAKeyValueType+instance Eq RSAKeyValueType+instance Show RSAKeyValueType+instance SchemaType RSAKeyValueType
+ FpMLv53.cabal view
@@ -0,0 +1,64 @@+name: FpMLv53+version: 0.1+license: LGPL+license-file: LICENCE-LGPL+copyright: (c) 2012, Malcolm Wallace+author: Malcolm Wallace <Malcolm.Wallace@me.com>+maintainer: author+homepage: http://www.fpml.org/+category: Financial, XML+synopsis: A binding for the Financial Products Markup Language (v5.3)+description:+ FpML, the Financial Products Markup Language, is the business+ exchange standard for electronic dealing and processing of+ financial derivatives instruments. It establishes a protocol+ for sharing information on, and dealing in, swaps, derivatives,+ and structured products. It is based on XML, the standard+ meta-language for describing data shared between applications.+ All categories of over-the-counter (OTC) derivatives will+ eventually be incorporated into the standard.+ + This package is an automatically-generated binding to version 5.3 of+ the FpML standard. The object-oriented typing discipline of the+ original XSD definition of FpML has been translated into Haskell's+ algebraic types. Type classes for parsing from, and outputting to,+ XML documents are instantiated for all types.+build-type: Simple+cabal-version: >=1.6+extra-source-files: COPYRIGHT++source-repository head+ type: darcs+ location: http://code.haskell.org/~malcolm/fpml-5.3++library+ build-depends: base <= 6, HaXml >= 1.23.3+ exposed-modules:+ Data.FpML.V53.Asset+ Data.FpML.V53.CD+ Data.FpML.V53.Com+ Data.FpML.V53.Doc+ Data.FpML.V53.Enum+ Data.FpML.V53.Eqd+ Data.FpML.V53.Events.Business+ Data.FpML.V53.FX+ Data.FpML.V53.Generic+ Data.FpML.V53.IRD+ Data.FpML.V53.Main+ Data.FpML.V53.Mktenv+ Data.FpML.V53.Msg+ Data.FpML.V53.Notification.CreditEvent+ Data.FpML.V53.Option.Bond+ Data.FpML.V53.Processes.Recordkeeping+ Data.FpML.V53.Reporting.Valuation+ Data.FpML.V53.Riskdef+ Data.FpML.V53.Shared.EQ+ Data.FpML.V53.Shared.Option+ Data.FpML.V53.Shared+ Data.FpML.V53.Standard+ Data.FpML.V53.Swaps.Correlation+ Data.FpML.V53.Swaps.Dividend+ Data.FpML.V53.Swaps.Return+ Data.FpML.V53.Swaps.Variance+ Data.FpML.V53.Valuation+ Data.Xmldsig.Core.Schema
+ LICENCE-LGPL view
@@ -0,0 +1,507 @@+ GNU LESSER GENERAL PUBLIC LICENSE+ Version 2.1, February 1999++ Copyright (C) 1991, 1999 Free Software Foundation, Inc.+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA+ Everyone is permitted to copy and distribute verbatim copies+ of this license document, but changing it is not allowed.++[This is the first released version of the Lesser GPL. It also counts+ as the successor of the GNU Library Public License, version 2, hence+ the version number 2.1.]++ Preamble++ The licenses for most software are designed to take away your+freedom to share and change it. By contrast, the GNU General Public+Licenses are intended to guarantee your freedom to share and change+free software--to make sure the software is free for all its users.++ This license, the Lesser General Public License, applies to some+specially designated software packages--typically libraries--of the+Free Software Foundation and other authors who decide to use it. You+can use it too, but we suggest you first think carefully about whether+this license or the ordinary General Public License is the better+strategy to use in any particular case, based on the explanations+below.++ When we speak of free software, we are referring to freedom of use,+not price. Our General Public Licenses are designed to make sure that+you have the freedom to distribute copies of free software (and charge+for this service if you wish); that you receive source code or can get+it if you want it; that you can change the software and use pieces of+it in new free programs; and that you are informed that you can do+these things.++ To protect your rights, we need to make restrictions that forbid+distributors to deny you these rights or to ask you to surrender these+rights. These restrictions translate to certain responsibilities for+you if you distribute copies of the library or if you modify it.++ For example, if you distribute copies of the library, whether gratis+or for a fee, you must give the recipients all the rights that we gave+you. You must make sure that they, too, receive or can get the source+code. If you link other code with the library, you must provide+complete object files to the recipients, so that they can relink them+with the library after making changes to the library and recompiling+it. And you must show them these terms so they know their rights.++ We protect your rights with a two-step method: (1) we copyright the+library, and (2) we offer you this license, which gives you legal+permission to copy, distribute and/or modify the library.++ To protect each distributor, we want to make it very clear that+there is no warranty for the free library. Also, if the library is+modified by someone else and passed on, the recipients should know+that what they have is not the original version, so that the original+author's reputation will not be affected by problems that might be+introduced by others.++ Finally, software patents pose a constant threat to the existence of+any free program. We wish to make sure that a company cannot+effectively restrict the users of a free program by obtaining a+restrictive license from a patent holder. Therefore, we insist that+any patent license obtained for a version of the library must be+consistent with the full freedom of use specified in this license.++ Most GNU software, including some libraries, is covered by the+ordinary GNU General Public License. This license, the GNU Lesser+General Public License, applies to certain designated libraries, and+is quite different from the ordinary General Public License. We use+this license for certain libraries in order to permit linking those+libraries into non-free programs.++ When a program is linked with a library, whether statically or using+a shared library, the combination of the two is legally speaking a+combined work, a derivative of the original library. The ordinary+General Public License therefore permits such linking only if the+entire combination fits its criteria of freedom. The Lesser General+Public License permits more lax criteria for linking other code with+the library.++ We call this license the "Lesser" General Public License because it+does Less to protect the user's freedom than the ordinary General+Public License. It also provides other free software developers Less+of an advantage over competing non-free programs. These disadvantages+are the reason we use the ordinary General Public License for many+libraries. However, the Lesser license provides advantages in certain+special circumstances.++ For example, on rare occasions, there may be a special need to+encourage the widest possible use of a certain library, so that it+becomes a de-facto standard. To achieve this, non-free programs must+be allowed to use the library. A more frequent case is that a free+library does the same job as widely used non-free libraries. In this+case, there is little to gain by limiting the free library to free+software only, so we use the Lesser General Public License.++ In other cases, permission to use a particular library in non-free+programs enables a greater number of people to use a large body of+free software. For example, permission to use the GNU C Library in+non-free programs enables many more people to use the whole GNU+operating system, as well as its variant, the GNU/Linux operating+system.++ Although the Lesser General Public License is Less protective of the+users' freedom, it does ensure that the user of a program that is+linked with the Library has the freedom and the wherewithal to run+that program using a modified version of the Library.++ The precise terms and conditions for copying, distribution and+modification follow. Pay close attention to the difference between a+"work based on the library" and a "work that uses the library". The+former contains code derived from the library, whereas the latter must+be combined with the library in order to run.+++ GNU LESSER GENERAL PUBLIC LICENSE+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION++ 0. This License Agreement applies to any software library or other+program which contains a notice placed by the copyright holder or+other authorized party saying it may be distributed under the terms of+this Lesser General Public License (also called "this License").+Each licensee is addressed as "you".++ A "library" means a collection of software functions and/or data+prepared so as to be conveniently linked with application programs+(which use some of those functions and data) to form executables.++ The "Library", below, refers to any such software library or work+which has been distributed under these terms. A "work based on the+Library" means either the Library or any derivative work under+copyright law: that is to say, a work containing the Library or a+portion of it, either verbatim or with modifications and/or translated+straightforwardly into another language. (Hereinafter, translation is+included without limitation in the term "modification".)++ "Source code" for a work means the preferred form of the work for+making modifications to it. For a library, complete source code means+all the source code for all modules it contains, plus any associated+interface definition files, plus the scripts used to control+compilation and installation of the library.++ Activities other than copying, distribution and modification are not+covered by this License; they are outside its scope. The act of+running a program using the Library is not restricted, and output from+such a program is covered only if its contents constitute a work based+on the Library (independent of the use of the Library in a tool for+writing it). Whether that is true depends on what the Library does+and what the program that uses the Library does.++ 1. You may copy and distribute verbatim copies of the Library's+complete source code as you receive it, in any medium, provided that+you conspicuously and appropriately publish on each copy an+appropriate copyright notice and disclaimer of warranty; keep intact+all the notices that refer to this License and to the absence of any+warranty; and distribute a copy of this License along with the+Library.++ You may charge a fee for the physical act of transferring a copy,+and you may at your option offer warranty protection in exchange for a+fee.++ 2. You may modify your copy or copies of the Library or any portion+of it, thus forming a work based on the Library, and copy and+distribute such modifications or work under the terms of Section 1+above, provided that you also meet all of these conditions:++ a) The modified work must itself be a software library.++ b) You must cause the files modified to carry prominent notices+ stating that you changed the files and the date of any change.++ c) You must cause the whole of the work to be licensed at no+ charge to all third parties under the terms of this License.++ d) If a facility in the modified Library refers to a function or a+ table of data to be supplied by an application program that uses+ the facility, other than as an argument passed when the facility+ is invoked, then you must make a good faith effort to ensure that,+ in the event an application does not supply such function or+ table, the facility still operates, and performs whatever part of+ its purpose remains meaningful.++ (For example, a function in a library to compute square roots has+ a purpose that is entirely well-defined independent of the+ application. Therefore, Subsection 2d requires that any+ application-supplied function or table used by this function must+ be optional: if the application does not supply it, the square+ root function must still compute square roots.)++These requirements apply to the modified work as a whole. If+identifiable sections of that work are not derived from the Library,+and can be reasonably considered independent and separate works in+themselves, then this License, and its terms, do not apply to those+sections when you distribute them as separate works. But when you+distribute the same sections as part of a whole which is a work based+on the Library, the distribution of the whole must be on the terms of+this License, whose permissions for other licensees extend to the+entire whole, and thus to each and every part regardless of who wrote+it.++Thus, it is not the intent of this section to claim rights or contest+your rights to work written entirely by you; rather, the intent is to+exercise the right to control the distribution of derivative or+collective works based on the Library.++In addition, mere aggregation of another work not based on the Library+with the Library (or with a work based on the Library) on a volume of+a storage or distribution medium does not bring the other work under+the scope of this License.++ 3. You may opt to apply the terms of the ordinary GNU General Public+License instead of this License to a given copy of the Library. To do+this, you must alter all the notices that refer to this License, so+that they refer to the ordinary GNU General Public License, version 2,+instead of to this License. (If a newer version than version 2 of the+ordinary GNU General Public License has appeared, then you can specify+that version instead if you wish.) Do not make any other change in+these notices.++ Once this change is made in a given copy, it is irreversible for+that copy, so the ordinary GNU General Public License applies to all+subsequent copies and derivative works made from that copy.++ This option is useful when you wish to copy part of the code of+the Library into a program that is not a library.++ 4. You may copy and distribute the Library (or a portion or+derivative of it, under Section 2) in object code or executable form+under the terms of Sections 1 and 2 above provided that you accompany+it with the complete corresponding machine-readable source code, which+must be distributed under the terms of Sections 1 and 2 above on a+medium customarily used for software interchange.++ If distribution of object code is made by offering access to copy+from a designated place, then offering equivalent access to copy the+source code from the same place satisfies the requirement to+distribute the source code, even though third parties are not+compelled to copy the source along with the object code.++ 5. A program that contains no derivative of any portion of the+Library, but is designed to work with the Library by being compiled or+linked with it, is called a "work that uses the Library". Such a+work, in isolation, is not a derivative work of the Library, and+therefore falls outside the scope of this License.++ However, linking a "work that uses the Library" with the Library+creates an executable that is a derivative of the Library (because it+contains portions of the Library), rather than a "work that uses the+library". The executable is therefore covered by this License.+Section 6 states terms for distribution of such executables.++ When a "work that uses the Library" uses material from a header file+that is part of the Library, the object code for the work may be a+derivative work of the Library even though the source code is not.+Whether this is true is especially significant if the work can be+linked without the Library, or if the work is itself a library. The+threshold for this to be true is not precisely defined by law.++ If such an object file uses only numerical parameters, data+structure layouts and accessors, and small macros and small inline+functions (ten lines or less in length), then the use of the object+file is unrestricted, regardless of whether it is legally a derivative+work. (Executables containing this object code plus portions of the+Library will still fall under Section 6.)++ Otherwise, if the work is a derivative of the Library, you may+distribute the object code for the work under the terms of Section 6.+Any executables containing that work also fall under Section 6,+whether or not they are linked directly with the Library itself.++ 6. As an exception to the Sections above, you may also combine or+link a "work that uses the Library" with the Library to produce a+work containing portions of the Library, and distribute that work+under terms of your choice, provided that the terms permit+modification of the work for the customer's own use and reverse+engineering for debugging such modifications.++ You must give prominent notice with each copy of the work that the+Library is used in it and that the Library and its use are covered by+this License. You must supply a copy of this License. If the work+during execution displays copyright notices, you must include the+copyright notice for the Library among them, as well as a reference+directing the user to the copy of this License. Also, you must do one+of these things:++ a) Accompany the work with the complete corresponding+ machine-readable source code for the Library including whatever+ changes were used in the work (which must be distributed under+ Sections 1 and 2 above); and, if the work is an executable linked+ with the Library, with the complete machine-readable "work that+ uses the Library", as object code and/or source code, so that the+ user can modify the Library and then relink to produce a modified+ executable containing the modified Library. (It is understood+ that the user who changes the contents of definitions files in the+ Library will not necessarily be able to recompile the application+ to use the modified definitions.)++ b) Use a suitable shared library mechanism for linking with the+ Library. A suitable mechanism is one that (1) uses at run time a+ copy of the library already present on the user's computer system,+ rather than copying library functions into the executable, and (2)+ will operate properly with a modified version of the library, if+ the user installs one, as long as the modified version is+ interface-compatible with the version that the work was made with.++ c) Accompany the work with a written offer, valid for at least+ three years, to give the same user the materials specified in+ Subsection 6a, above, for a charge no more than the cost of+ performing this distribution.++ d) If distribution of the work is made by offering access to copy+ from a designated place, offer equivalent access to copy the above+ specified materials from the same place.++ e) Verify that the user has already received a copy of these+ materials or that you have already sent this user a copy.++ For an executable, the required form of the "work that uses the+Library" must include any data and utility programs needed for+reproducing the executable from it. However, as a special exception,+the materials to be distributed need not include anything that is+normally distributed (in either source or binary form) with the major+components (compiler, kernel, and so on) of the operating system on+which the executable runs, unless that component itself accompanies+the executable.++ It may happen that this requirement contradicts the license+restrictions of other proprietary libraries that do not normally+accompany the operating system. Such a contradiction means you cannot+use both them and the Library together in an executable that you+distribute.++ 7. You may place library facilities that are a work based on the+Library side-by-side in a single library together with other library+facilities not covered by this License, and distribute such a combined+library, provided that the separate distribution of the work based on+the Library and of the other library facilities is otherwise+permitted, and provided that you do these two things:++ a) Accompany the combined library with a copy of the same work+ based on the Library, uncombined with any other library+ facilities. This must be distributed under the terms of the+ Sections above.++ b) Give prominent notice with the combined library of the fact+ that part of it is a work based on the Library, and explaining+ where to find the accompanying uncombined form of the same work.++ 8. You may not copy, modify, sublicense, link with, or distribute+the Library except as expressly provided under this License. Any+attempt otherwise to copy, modify, sublicense, link with, or+distribute the Library is void, and will automatically terminate your+rights under this License. However, parties who have received copies,+or rights, from you under this License will not have their licenses+terminated so long as such parties remain in full compliance.++ 9. You are not required to accept this License, since you have not+signed it. However, nothing else grants you permission to modify or+distribute the Library or its derivative works. These actions are+prohibited by law if you do not accept this License. Therefore, by+modifying or distributing the Library (or any work based on the+Library), you indicate your acceptance of this License to do so, and+all its terms and conditions for copying, distributing or modifying+the Library or works based on it.++ 10. Each time you redistribute the Library (or any work based on the+Library), the recipient automatically receives a license from the+original licensor to copy, distribute, link with or modify the Library+subject to these terms and conditions. You may not impose any further+restrictions on the recipients' exercise of the rights granted herein.+You are not responsible for enforcing compliance by third parties with+this License.++ 11. If, as a consequence of a court judgment or allegation of patent+infringement or for any other reason (not limited to patent issues),+conditions are imposed on you (whether by court order, agreement or+otherwise) that contradict the conditions of this License, they do not+excuse you from the conditions of this License. If you cannot+distribute so as to satisfy simultaneously your obligations under this+License and any other pertinent obligations, then as a consequence you+may not distribute the Library at all. For example, if a patent+license would not permit royalty-free redistribution of the Library by+all those who receive copies directly or indirectly through you, then+the only way you could satisfy both it and this License would be to+refrain entirely from distribution of the Library.++If any portion of this section is held invalid or unenforceable under+any particular circumstance, the balance of the section is intended to+apply, and the section as a whole is intended to apply in other+circumstances.++It is not the purpose of this section to induce you to infringe any+patents or other property right claims or to contest validity of any+such claims; this section has the sole purpose of protecting the+integrity of the free software distribution system which is+implemented by public license practices. Many people have made+generous contributions to the wide range of software distributed+through that system in reliance on consistent application of that+system; it is up to the author/donor to decide if he or she is willing+to distribute software through any other system and a licensee cannot+impose that choice.++This section is intended to make thoroughly clear what is believed to+be a consequence of the rest of this License.++ 12. If the distribution and/or use of the Library is restricted in+certain countries either by patents or by copyrighted interfaces, the+original copyright holder who places the Library under this License+may add an explicit geographical distribution limitation excluding those+countries, so that distribution is permitted only in or among+countries not thus excluded. In such case, this License incorporates+the limitation as if written in the body of this License.++ 13. The Free Software Foundation may publish revised and/or new+versions of the Lesser General Public License from time to time.+Such new versions will be similar in spirit to the present version,+but may differ in detail to address new problems or concerns.++Each version is given a distinguishing version number. If the Library+specifies a version number of this License which applies to it and+"any later version", you have the option of following the terms and+conditions either of that version or of any later version published by+the Free Software Foundation. If the Library does not specify a+license version number, you may choose any version ever published by+the Free Software Foundation.++ 14. If you wish to incorporate parts of the Library into other free+programs whose distribution conditions are incompatible with these,+write to the author to ask for permission. For software which is+copyrighted by the Free Software Foundation, write to the Free+Software Foundation; we sometimes make exceptions for this. Our+decision will be guided by the two goals of preserving the free status+of all derivatives of our free software and of promoting the sharing+and reuse of software generally.++ NO WARRANTY++ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.++ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH+DAMAGES.++ END OF TERMS AND CONDITIONS+++ How to Apply These Terms to Your New Libraries++ If you develop a new library, and you want it to be of the greatest+possible use to the public, we recommend making it free software that+everyone can redistribute and change. You can do so by permitting+redistribution under these terms (or, alternatively, under the terms of the+ordinary General Public License).++ To apply these terms, attach the following notices to the library. It is+safest to attach them to the start of each source file to most effectively+convey the exclusion of warranty; and each file should have at least the+"copyright" line and a pointer to where the full notice is found.++ <one line to give the library's name and a brief idea of what it does.>+ Copyright (C) <year> <name of author>++ This library is free software; you can redistribute it and/or+ modify it under the terms of the GNU Lesser General Public+ License as published by the Free Software Foundation; either+ version 2.1 of the License, or (at your option) any later version.++ This library is distributed in the hope that it will be useful,+ but WITHOUT ANY WARRANTY; without even the implied warranty of+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU+ Lesser General Public License for more details.++ You should have received a copy of the GNU Lesser General Public+ License along with this library; if not, write to the Free Software+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA++Also add information on how to contact you by electronic and paper mail.++You should also get your employer (if you work as a programmer) or your+school, if any, to sign a "copyright disclaimer" for the library, if+necessary. Here is a sample; alter the names:++ Yoyodyne, Inc., hereby disclaims all copyright interest in the+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.++ <signature of Ty Coon>, 1 April 1990+ Ty Coon, President of Vice++That's all there is to it!+
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain