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
import Data.FpML.V53.FX ( FxEuropeanExercise )
import Data.FpML.V53.FX ( FxDigitalAmericanExercise )
import Data.FpML.V53.Com ( CommodityPhysicalEuropeanExercise )
import Data.FpML.V53.Com ( CommodityPhysicalAmericanExercise )
import Data.FpML.V53.Com ( CommodityEuropeanExercise )
import Data.FpML.V53.Com ( CommodityAmericanExercise )
import Data.FpML.V53.Eqd ( EquityEuropeanExercise )
import Data.FpML.V53.IRD ( InterestRateStream )
import Data.FpML.V53.FX ( FxSwapLeg )
import Data.FpML.V53.Shared.EQ ( DirectionalLeg )
import Data.FpML.V53.Com ( CommoditySwapLeg )
import Data.FpML.V53.Com ( CommodityForwardLeg )
import Data.FpML.V53.CD ( FeeLeg )
import Data.FpML.V53.Asset ( PendingPayment )
import Data.FpML.V53.Shared.Option ( FeaturePayment )
import Data.FpML.V53.IRD ( PaymentCalculationPeriod )
import Data.FpML.V53.Shared.EQ ( ReturnSwapAdditionalPayment )
import Data.FpML.V53.Shared.EQ ( EquityPremium )
import Data.FpML.V53.Doc ( PaymentDetail )
import Data.FpML.V53.Swaps.Dividend ( FixedPaymentAmount )
import Data.FpML.V53.CD ( SinglePayment )
import Data.FpML.V53.CD ( PeriodicPayment )
import Data.FpML.V53.CD ( InitialPayment )
import Data.FpML.V53.Eqd ( PrePayment )
import Data.FpML.V53.Mktenv ( YieldCurve )
import Data.FpML.V53.Mktenv ( VolatilityRepresentation )
import Data.FpML.V53.Mktenv ( FxCurve )
import Data.FpML.V53.Mktenv ( CreditCurve )
import Data.FpML.V53.Standard ( StandardProduct )
import Data.FpML.V53.Shared.Option ( Option )
import Data.FpML.V53.IRD ( Swaption )
import Data.FpML.V53.IRD ( Swap )
import Data.FpML.V53.IRD ( Fra )
import Data.FpML.V53.IRD ( CapFloor )
import Data.FpML.V53.IRD ( BulletPayment )
import Data.FpML.V53.Generic ( GenericProduct )
import Data.FpML.V53.FX ( TermDeposit )
import Data.FpML.V53.FX ( FxSwap )
import Data.FpML.V53.FX ( FxSingleLeg )
import Data.FpML.V53.Shared.EQ ( ReturnSwapBase )
import Data.FpML.V53.Shared.EQ ( NettedSwapBase )
import Data.FpML.V53.Doc ( Strategy )
import Data.FpML.V53.Doc ( InstrumentTradeDetails )
import Data.FpML.V53.Swaps.Dividend ( DividendSwapTransactionSupplement )
import Data.FpML.V53.Com ( CommoditySwaption )
import Data.FpML.V53.Com ( CommoditySwap )
import Data.FpML.V53.Com ( CommodityOption )
import Data.FpML.V53.Com ( CommodityForward )
import Data.FpML.V53.CD ( CreditDefaultSwap )
import Data.FpML.V53.Eqd ( EquityDerivativeBase )
import Data.FpML.V53.Swaps.Variance ( VarianceSwapTransactionSupplement )
import Data.FpML.V53.Asset ( AssetReference )
import Data.FpML.V53.Asset ( AnyAssetReference )
import Data.FpML.V53.Shared.Option ( CreditEventsReference )
import Data.FpML.V53.IRD ( ValuationDatesReference )
import Data.FpML.V53.IRD ( ResetDatesReference )
import Data.FpML.V53.IRD ( RelevantUnderlyingDateReference )
import Data.FpML.V53.IRD ( PaymentDatesReference )
import Data.FpML.V53.IRD ( InterestRateStreamReference )
import Data.FpML.V53.IRD ( CalculationPeriodDatesReference )
import Data.FpML.V53.FX ( MoneyReference )
import Data.FpML.V53.Shared.EQ ( InterestLegCalculationPeriodDatesReference )
import Data.FpML.V53.Shared.EQ ( FloatingRateCalculationReference )
import Data.FpML.V53.Com ( SettlementPeriodsReference )
import Data.FpML.V53.Com ( QuantityReference )
import Data.FpML.V53.Com ( QuantityScheduleReference )
import Data.FpML.V53.Com ( LagReference )
import Data.FpML.V53.Com ( CalculationPeriodsScheduleReference )
import Data.FpML.V53.Com ( CalculationPeriodsReference )
import Data.FpML.V53.Com ( CalculationPeriodsDatesReference )
import Data.FpML.V53.CD ( SettlementTermsReference )
import Data.FpML.V53.CD ( ProtectionTermsReference )
import Data.FpML.V53.CD ( FixedRateReference )
import Data.FpML.V53.Riskdef ( ValuationScenarioReference )
import Data.FpML.V53.Riskdef ( ValuationReference )
import Data.FpML.V53.Riskdef ( SensitivitySetDefinitionReference )
import Data.FpML.V53.Riskdef ( PricingParameterDerivativeReference )
import Data.FpML.V53.Riskdef ( PricingDataPointCoordinateReference )
import Data.FpML.V53.Riskdef ( MarketReference )
import Data.FpML.V53.Riskdef ( AssetOrTermPointOrPricingStructureReference )
import Data.FpML.V53.Standard ( elementStandardProduct, elementToXMLStandardProduct )
import Data.FpML.V53.IRD ( elementSwaption, elementToXMLSwaption )
import Data.FpML.V53.IRD ( elementSwap, elementToXMLSwap )
import Data.FpML.V53.IRD ( elementFra, elementToXMLFra )
import Data.FpML.V53.IRD ( elementCapFloor, elementToXMLCapFloor )
import Data.FpML.V53.IRD ( elementBulletPayment, elementToXMLBulletPayment )
import Data.FpML.V53.Generic ( elementNonSchemaProduct, elementToXMLNonSchemaProduct )
import Data.FpML.V53.Generic ( elementGenericProduct, elementToXMLGenericProduct )
import Data.FpML.V53.FX ( elementTermDeposit, elementToXMLTermDeposit )
import Data.FpML.V53.FX ( elementFxDigitalOption, elementToXMLFxDigitalOption )
import Data.FpML.V53.FX ( elementFxOption, elementToXMLFxOption )
import Data.FpML.V53.FX ( elementFxSwap, elementToXMLFxSwap )
import Data.FpML.V53.FX ( elementFxSingleLeg, elementToXMLFxSingleLeg )
import Data.FpML.V53.Shared.EQ ( elementReturnSwap, elementToXMLReturnSwap )
import Data.FpML.V53.Doc ( elementStrategy, elementToXMLStrategy )
import Data.FpML.V53.Doc ( elementInstrumentTradeDetails, elementToXMLInstrumentTradeDetails )
import Data.FpML.V53.Swaps.Dividend ( elementDividendSwapTransactionSupplement, elementToXMLDividendSwapTransactionSupplement )
import Data.FpML.V53.Swaps.Correlation ( elementCorrelationSwap, elementToXMLCorrelationSwap )
import Data.FpML.V53.Com ( elementCommoditySwaption, elementToXMLCommoditySwaption )
import Data.FpML.V53.Com ( elementCommoditySwap, elementToXMLCommoditySwap )
import Data.FpML.V53.Com ( elementCommodityOption, elementToXMLCommodityOption )
import Data.FpML.V53.Com ( elementCommodityForward, elementToXMLCommodityForward )
import Data.FpML.V53.CD ( elementCreditDefaultSwapOption, elementToXMLCreditDefaultSwapOption )
import Data.FpML.V53.CD ( elementCreditDefaultSwap, elementToXMLCreditDefaultSwap )
import Data.FpML.V53.Option.Bond ( elementBondOption, elementToXMLBondOption )
import Data.FpML.V53.Swaps.Return ( elementEquitySwapTransactionSupplement, elementToXMLEquitySwapTransactionSupplement )
import Data.FpML.V53.Eqd ( elementEquityOptionTransactionSupplement, elementToXMLEquityOptionTransactionSupplement )
import Data.FpML.V53.Eqd ( elementEquityOption, elementToXMLEquityOption )
import Data.FpML.V53.Eqd ( elementEquityForward, elementToXMLEquityForward )
import Data.FpML.V53.Eqd ( elementBrokerEquityOption, elementToXMLBrokerEquityOption )
import Data.FpML.V53.Swaps.Variance ( elementVarianceSwapTransactionSupplement, elementToXMLVarianceSwapTransactionSupplement )
import Data.FpML.V53.Swaps.Variance ( elementVarianceSwap, elementToXMLVarianceSwap )
import Data.FpML.V53.Swaps.Variance ( elementVarianceOptionTransactionSupplement, elementToXMLVarianceOptionTransactionSupplement )
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
simpleTypeText (CorrelationValue x) = simpleTypeText x
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
simpleTypeText (HourMinuteTime x) = simpleTypeText x
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
simpleTypeText (NonNegativeDecimal x) = simpleTypeText x
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
simpleTypeText (PositiveDecimal x) = simpleTypeText x
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
simpleTypeText (RestrictedPercentage x) = simpleTypeText x
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
simpleTypeText (Scheme x) = simpleTypeText x
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
simpleTypeText (Token60 x) = simpleTypeText x
data Account = Account
{ account_ID :: Xsd.ID
, account_id :: Maybe AccountId
, account_name :: Maybe AccountName
, account_beneficiary :: Maybe PartyReference
, account_servicingParty :: Maybe PartyReference
}
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
]
data AccountId = AccountId Scheme AccountIdAttributes deriving (Eq,Show)
data AccountIdAttributes = AccountIdAttributes
{ accountIdAttrib_accountIdScheme :: Maybe Xsd.AnyURI
}
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
data AccountName = AccountName Scheme AccountNameAttributes deriving (Eq,Show)
data AccountNameAttributes = AccountNameAttributes
{ accountNameAttrib_accountNameScheme :: Maybe Xsd.AnyURI
}
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
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
data Address = Address
{ address_streetAddress :: Maybe StreetAddress
, address_city :: Maybe Xsd.XsdString
, address_state :: Maybe Xsd.XsdString
, address_country :: Maybe CountryCode
, address_postalCode :: Maybe Xsd.XsdString
}
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
]
data BusinessUnit = BusinessUnit
{ businessUnit_ID :: Maybe Xsd.ID
, businessUnit_name :: Maybe Xsd.XsdString
, businessUnit_id :: Maybe Unit
, businessUnit_contactInfo :: Maybe ContactInformation
, businessUnit_country :: Maybe CountryCode
}
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
]
data Person = Person
{ person_ID :: Maybe Xsd.ID
, person_honorific :: Maybe Xsd.NormalizedString
, person_firstName :: Maybe Xsd.NormalizedString
, person_choice2 :: (Maybe (OneOf2 [Xsd.NormalizedString] [Initial]))
, person_surname :: Maybe Xsd.NormalizedString
, person_suffix :: Maybe Xsd.NormalizedString
, person_id :: [PersonId]
, person_businessUnitReference :: Maybe BusinessUnitReference
, person_contactInfo :: Maybe ContactInformation
, person_country :: Maybe CountryCode
}
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
simpleTypeText (Initial x) = simpleTypeText x
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
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
data ContactInformation = ContactInformation
{ contactInfo_telephone :: [TelephoneNumber]
, contactInfo_email :: [Xsd.NormalizedString]
, contactInfo_address :: Maybe 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
]
data TelephoneNumber = TelephoneNumber
{ telephNumber_type :: Maybe TelephoneTypeEnum
, telephNumber_number :: Maybe Xsd.XsdString
}
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
]
data AdjustableDate = AdjustableDate
{ adjustDate_ID :: Maybe Xsd.ID
, adjustDate_unadjustedDate :: IdentifiedDate
, adjustDate_dateAdjustments :: Maybe BusinessDayAdjustments
, adjustDate_adjustedDate :: Maybe IdentifiedDate
}
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
]
data AdjustableDate2 = AdjustableDate2
{ adjustDate2_ID :: Maybe Xsd.ID
, adjustDate2_unadjustedDate :: IdentifiedDate
, adjustDate2_choice1 :: (Maybe (OneOf2 BusinessDayAdjustments BusinessDayAdjustmentsReference))
, adjustDate2_adjustedDate :: Maybe IdentifiedDate
}
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
]
data AdjustableDates = AdjustableDates
{ adjustDates_ID :: Maybe Xsd.ID
, adjustDates_unadjustedDate :: [IdentifiedDate]
, adjustDates_dateAdjustments :: Maybe BusinessDayAdjustments
, adjustDates_adjustedDate :: [IdentifiedDate]
}
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
]
data AdjustableDatesOrRelativeDateOffset = AdjustableDatesOrRelativeDateOffset
{ adordo_choice0 :: (Maybe (OneOf2 AdjustableDates RelativeDateOffset))
}
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
]
data AdjustableOrAdjustedDate = AdjustableOrAdjustedDate
{ adjustOrAdjustDate_ID :: Maybe Xsd.ID
, adjustOrAdjustDate_choice0 :: OneOf2 (IdentifiedDate,(Maybe (BusinessDayAdjustments)),(Maybe (IdentifiedDate))) IdentifiedDate
}
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
]
data AdjustableOrRelativeDate = AdjustableOrRelativeDate
{ adjustOrRelatDate_ID :: Maybe Xsd.ID
, adjustOrRelatDate_choice0 :: (Maybe (OneOf2 AdjustableDate RelativeDateOffset))
}
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
]
data AdjustableOrRelativeDates = AdjustableOrRelativeDates
{ adjustOrRelatDates_ID :: Maybe Xsd.ID
, adjustOrRelatDates_choice0 :: (Maybe (OneOf2 AdjustableDates RelativeDates))
}
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))
}
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
]
data AdjustableRelativeOrPeriodicDates2 = AdjustableRelativeOrPeriodicDates2
{ adjustRelatOrPeriodDates2_ID :: Maybe Xsd.ID
, adjustRelatOrPeriodDates2_choice0 :: (Maybe (OneOf3 AdjustableDates RelativeDates 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
]
data AdjustedRelativeDateOffset = AdjustedRelativeDateOffset
{ adjustRelatDateOffset_ID :: Maybe Xsd.ID
, adjustRelatDateOffset_periodMultiplier :: Xsd.Integer
, adjustRelatDateOffset_period :: PeriodEnum
, adjustRelatDateOffset_dayType :: Maybe DayTypeEnum
, adjustRelatDateOffset_businessDayConvention :: Maybe BusinessDayConventionEnum
, adjustRelatDateOffset_choice4 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))
, adjustRelatDateOffset_dateRelativeTo :: Maybe DateReference
, adjustRelatDateOffset_adjustedDate :: Maybe IdentifiedDate
, adjustRelatDateOffset_relativeDateAdjustments :: Maybe BusinessDayAdjustments
}
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
data AmericanExercise = AmericanExercise
{ americExerc_ID :: Maybe Xsd.ID
, americExerc_commencementDate :: Maybe AdjustableOrRelativeDate
, americExerc_expirationDate :: Maybe AdjustableOrRelativeDate
, americExerc_relevantUnderlyingDate :: Maybe AdjustableOrRelativeDates
, americExerc_earliestExerciseTime :: Maybe BusinessCenterTime
, americExerc_latestExerciseTime :: Maybe BusinessCenterTime
, americExerc_expirationTime :: Maybe BusinessCenterTime
, americExerc_multipleExercise :: Maybe MultipleExercise
, americExerc_exerciseFeeSchedule :: Maybe ExerciseFeeSchedule
}
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
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
data AmountSchedule = AmountSchedule
{ amountSched_ID :: Maybe Xsd.ID
, amountSched_initialValue :: Xsd.Decimal
, amountSched_step :: [Step]
, amountSched_currency :: Maybe Currency
}
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
data AutomaticExercise = AutomaticExercise
{ automExerc_thresholdRate :: Maybe Xsd.Decimal
}
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
]
data AverageDailyTradingVolumeLimit = AverageDailyTradingVolumeLimit
{ averageDailyTradingVolumeLimit_limitationPercentage :: Maybe RestrictedPercentage
, averageDailyTradingVolumeLimit_limitationPeriod :: Maybe Xsd.NonNegativeInteger
}
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
]
data Beneficiary = Beneficiary
{ beneficiary_choice0 :: (Maybe (OneOf3 RoutingIds RoutingExplicitDetails RoutingIdsAndExplicitDetails))
, beneficiary_partyReference :: Maybe PartyReference
}
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
]
data BermudaExercise = BermudaExercise
{ bermudaExerc_ID :: Maybe Xsd.ID
, bermudaExercise_dates :: Maybe AdjustableOrRelativeDates
, bermudaExerc_relevantUnderlyingDate :: Maybe AdjustableOrRelativeDates
, bermudaExerc_earliestExerciseTime :: Maybe BusinessCenterTime
, bermudaExerc_latestExerciseTime :: Maybe BusinessCenterTime
, bermudaExerc_expirationTime :: Maybe BusinessCenterTime
, bermudaExerc_multipleExercise :: Maybe MultipleExercise
, bermudaExerc_exerciseFeeSchedule :: Maybe ExerciseFeeSchedule
}
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
data BrokerConfirmation = BrokerConfirmation
{ brokerConfirmation_type :: Maybe BrokerConfirmationType
}
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
]
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
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
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
]
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
data BusinessCenterTime = BusinessCenterTime
{ busCenterTime_hourMinuteTime :: Maybe HourMinuteTime
, 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
]
data BusinessDateRange = BusinessDateRange
{ busDateRange_unadjustedFirstDate :: Maybe Xsd.Date
, busDateRange_unadjustedLastDate :: Maybe Xsd.Date
, busDateRange_businessDayConvention :: Maybe BusinessDayConventionEnum
, busDateRange_choice3 :: (Maybe (OneOf2 BusinessCentersReference 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
data BusinessDayAdjustments = BusinessDayAdjustments
{ busDayAdjust_ID :: Maybe Xsd.ID
, busDayAdjust_businessDayConvention :: Maybe BusinessDayConventionEnum
, busDayAdjust_choice1 :: (Maybe (OneOf2 BusinessCentersReference 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
]
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
data CalculationAgent = CalculationAgent
{ calcAgent_choice0 :: (Maybe (OneOf2 [PartyReference] CalculationAgentPartyEnum))
}
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
]
data CalculationPeriodFrequency = CalculationPeriodFrequency
{ calcPeriodFrequ_ID :: Maybe Xsd.ID
, calcPeriodFrequ_periodMultiplier :: Maybe Xsd.PositiveInteger
, calcPeriodFrequ_period :: Maybe PeriodExtendedEnum
, calcPeriodFrequ_rollConvention :: Maybe RollConventionEnum
}
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
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
data CashflowNotional = CashflowNotional
{ cashflNotion_ID :: Maybe Xsd.ID
, cashflNotion_choice0 :: (Maybe (OneOf2 Currency Xsd.NormalizedString))
, cashflNotion_amount :: Xsd.Decimal
}
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
]
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
data CashSettlementReferenceBanks = CashSettlementReferenceBanks
{ cashSettlRefBanks_ID :: Maybe Xsd.ID
, cashSettlRefBanks_referenceBank :: [ReferenceBank]
}
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
]
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
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
, contrMatrix_publicationDate :: Maybe Xsd.Date
, contrMatrix_matrixTerm :: Maybe MatrixTerm
}
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
]
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
data ContractualTermsSupplement = ContractualTermsSupplement
{ contrTermsSuppl_type :: Maybe ContractualSupplement
, contrTermsSuppl_publicationDate :: Maybe Xsd.Date
}
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
]
data CorrespondentInformation = CorrespondentInformation
{ corresInfo_choice0 :: (Maybe (OneOf3 RoutingIds RoutingExplicitDetails RoutingIdsAndExplicitDetails))
, corresInfo_correspondentPartyReference :: Maybe PartyReference
}
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
]
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
data CreditSeniority = CreditSeniority Scheme CreditSeniorityAttributes deriving (Eq,Show)
data CreditSeniorityAttributes = CreditSeniorityAttributes
{ creditSeniorAttrib_creditSeniorityScheme :: Maybe Xsd.AnyURI
}
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
data CreditSupportAgreement = CreditSupportAgreement
{ creditSupportAgreem_type :: Maybe CreditSupportAgreementType
, creditSupportAgreem_date :: Maybe Xsd.Date
, creditSupportAgreem_identifier :: Maybe CreditSupportAgreementIdentifier
}
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
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
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
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
]
data DateOffset = DateOffset
{ dateOffset_ID :: Maybe Xsd.ID
, dateOffset_periodMultiplier :: Xsd.Integer
, dateOffset_period :: PeriodEnum
, dateOffset_dayType :: Maybe DayTypeEnum
, dateOffset_businessDayConvention :: Maybe BusinessDayConventionEnum
}
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)
data DateRange = DateRange
{ dateRange_unadjustedFirstDate :: Maybe Xsd.Date
, dateRange_unadjustedLastDate :: Maybe Xsd.Date
}
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
]
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
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
]
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
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
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
data Documentation = Documentation
{ docum_masterAgreement :: Maybe MasterAgreement
, docum_choice1 :: (Maybe (OneOf2 MasterConfirmation BrokerConfirmation))
, docum_contractualDefinitions :: [ContractualDefinitions]
, docum_contractualTermsSupplement :: [ContractualTermsSupplement]
, docum_contractualMatrix :: [ContractualMatrix]
, docum_creditSupportAgreement :: Maybe CreditSupportAgreement
, docum_attachment :: [Resource]
}
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
]
data ExternalDocument = ExternalDocument
{ externDocum_mimeType :: Maybe MimeType
, externDocum_choice1 :: (Maybe (OneOf5 Xsd.XsdString Xsd.HexBinary Xsd.Base64Binary Xsd.AnyURI HTTPAttachmentReference))
}
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
]
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
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 []
[]
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
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
data EuropeanExercise = EuropeanExercise
{ europExerc_ID :: Maybe Xsd.ID
, europExerc_expirationDate :: AdjustableOrRelativeDate
, europExerc_relevantUnderlyingDate :: Maybe AdjustableOrRelativeDates
, europExerc_earliestExerciseTime :: Maybe BusinessCenterTime
, europExerc_expirationTime :: Maybe BusinessCenterTime
, europExerc_partialExercise :: Maybe PartialExercise
, europExerc_exerciseFee :: Maybe ExerciseFee
}
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
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
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
data ExerciseFee = ExerciseFee
{ exerciseFee_payerPartyReference :: Maybe PartyReference
, exerciseFee_payerAccountReference :: Maybe AccountReference
, exerciseFee_receiverPartyReference :: Maybe PartyReference
, exerciseFee_receiverAccountReference :: Maybe AccountReference
, exerciseFee_notionalReference :: Maybe NotionalReference
, exerciseFee_choice5 :: (Maybe (OneOf2 Xsd.Decimal Xsd.Decimal))
, exerciseFee_feePaymentDate :: Maybe RelativeDateOffset
}
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
]
data ExerciseFeeSchedule = ExerciseFeeSchedule
{ exercFeeSched_payerPartyReference :: Maybe PartyReference
, exercFeeSched_payerAccountReference :: Maybe AccountReference
, exercFeeSched_receiverPartyReference :: Maybe PartyReference
, exercFeeSched_receiverAccountReference :: Maybe AccountReference
, exercFeeSched_notionalReference :: Maybe ScheduleReference
, exercFeeSched_choice5 :: (Maybe (OneOf2 AmountSchedule Schedule))
, exercFeeSched_feePaymentDate :: Maybe RelativeDateOffset
}
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
]
data ExerciseNotice = ExerciseNotice
{ exercNotice_partyReference :: Maybe PartyReference
, exerciseNotice_partyReference :: Maybe PartyReference
, 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
]
data ExerciseProcedure = ExerciseProcedure
{ exercProced_choice0 :: (Maybe (OneOf2 ManualExercise AutomaticExercise))
, exercProced_followUpConfirmation :: Maybe Xsd.Boolean
, exercProced_limitedRightToConfirm :: Maybe Xsd.Boolean
, exercProced_splitTicket :: Maybe Xsd.Boolean
}
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
]
data ExerciseProcedureOption = ExerciseProcedureOption
{ exercProcedOption_choice0 :: OneOf2 Empty Empty
}
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
]
data FloatingRate = FloatingRate
{ floatingRate_ID :: Maybe Xsd.ID
, floatingRate_index :: FloatingRateIndex
, floatingRate_indexTenor :: Maybe Period
, floatingRate_multiplierSchedule :: Maybe Schedule
, floatingRate_spreadSchedule :: [SpreadSchedule]
, floatingRate_rateTreatment :: Maybe RateTreatmentEnum
, floatingRate_capRateSchedule :: [StrikeSchedule]
, floatingRate_floorRateSchedule :: [StrikeSchedule]
}
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
data FloatingRateCalculation = FloatingRateCalculation
{ floatRateCalc_ID :: Maybe Xsd.ID
, floatRateCalc_floatingRateIndex :: FloatingRateIndex
, floatRateCalc_indexTenor :: Maybe Period
, floatRateCalc_floatingRateMultiplierSchedule :: Maybe Schedule
, floatRateCalc_spreadSchedule :: [SpreadSchedule]
, floatRateCalc_rateTreatment :: Maybe RateTreatmentEnum
, floatRateCalc_capRateSchedule :: [StrikeSchedule]
, floatRateCalc_floorRateSchedule :: [StrikeSchedule]
, floatRateCalc_initialRate :: Maybe Xsd.Decimal
, floatRateCalc_finalRateRounding :: Maybe Rounding
, floatRateCalc_averagingMethod :: Maybe AveragingMethodEnum
, floatRateCalc_negativeInterestRateTreatment :: Maybe NegativeInterestRateTreatmentEnum
}
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)
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
data ForecastRateIndex = ForecastRateIndex
{ forecRateIndex_floatingRateIndex :: Maybe FloatingRateIndex
, forecRateIndex_indexTenor :: Maybe Period
}
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
]
data Formula = Formula
{ formula_description :: Maybe Xsd.XsdString
, formula_math :: Maybe Math
, formula_component :: [FormulaComponent]
}
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
]
data FormulaComponent = FormulaComponent
{ formulaCompon_name :: Maybe Xsd.NormalizedString
, formulaCompon_componentDescription :: Maybe Xsd.XsdString
, formulaCompon_formula :: Maybe Formula
}
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
]
data Frequency = Frequency
{ frequency_ID :: Maybe Xsd.ID
, frequency_periodMultiplier :: Maybe Xsd.PositiveInteger
, frequency_period :: Maybe PeriodExtendedEnum
}
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
]
data FutureValueAmount = FutureValueAmount
{ futureValueAmount_ID :: Maybe Xsd.ID
, futureValueAmount_currency :: Currency
, futureValueAmount_amount :: NonNegativeDecimal
, futureValueAmount_calculationPeriodNumberOfDays :: Maybe Xsd.PositiveInteger
, futureValueAmount_valueDate :: Maybe Xsd.Date
}
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)
data FxFixing = FxFixing
{ fxFixing_quotedCurrencyPair :: Maybe QuotedCurrencyPair
, fxFixing_fixingDate :: Maybe Xsd.Date
, fxFixing_fxSpotRateSource :: Maybe FxSpotRateSource
}
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
]
data FxCashSettlement = FxCashSettlement
{ fxCashSettl_settlementCurrency :: Maybe Currency
, fxCashSettl_fixing :: [FxFixing]
}
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
]
data FxRate = FxRate
{ fxRate_quotedCurrencyPair :: Maybe QuotedCurrencyPair
, fxRate_rate :: Maybe Xsd.Decimal
}
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
]
data FxSpotRateSource = FxSpotRateSource
{ fxSpotRateSource_primaryRateSource :: Maybe InformationSource
, fxSpotRateSource_secondaryRateSource :: Maybe InformationSource
, fxSpotRateSource_fixingTime :: Maybe BusinessCenterTime
}
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
]
data GenericAgreement = GenericAgreement
{ genericAgreem_type :: Maybe AgreementType
, genericAgreem_version :: Maybe AgreementVersion
, genericAgreem_date :: Maybe Xsd.Date
, genericAgreem_amendmentDate :: [Xsd.Date]
, genericAgreem_governingLaw :: Maybe GoverningLaw
}
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
]
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
data GrossCashflow = GrossCashflow
{ grossCashfl_cashflowId :: Maybe CashflowId
, grossCashfl_partyTradeIdentifierReference :: Maybe PartyTradeIdentifierReference
, grossCashfl_payerPartyReference :: Maybe PartyReference
, grossCashfl_payerAccountReference :: Maybe AccountReference
, grossCashfl_receiverPartyReference :: Maybe PartyReference
, grossCashfl_receiverAccountReference :: Maybe AccountReference
, grossCashfl_cashflowAmount :: Maybe Money
, grossCashfl_cashflowType :: Maybe CashflowType
}
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
]
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
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
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
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
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
data InformationSource = InformationSource
{ infoSource_rateSource :: Maybe InformationProvider
, infoSource_rateSourcePage :: Maybe RateSourcePage
, infoSource_rateSourcePageHeading :: Maybe Xsd.XsdString
}
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
]
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
data InterestAccrualsCompoundingMethod = InterestAccrualsCompoundingMethod
{ interAccruCompoMethod_choice0 :: OneOf2 FloatingRateCalculation Xsd.Decimal
, interAccruCompoMethod_compoundingMethod :: Maybe CompoundingMethodEnum
}
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
data InterestAccrualsMethod = InterestAccrualsMethod
{ interAccruMethod_choice0 :: OneOf2 FloatingRateCalculation Xsd.Decimal
}
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
]
data IntermediaryInformation = IntermediaryInformation
{ intermInfo_choice0 :: (Maybe (OneOf3 RoutingIds RoutingExplicitDetails RoutingIdsAndExplicitDetails))
, intermInfo_intermediarySequenceNumber :: Maybe Xsd.PositiveInteger
, intermInfo_intermediaryPartyReference :: Maybe PartyReference
}
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
]
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
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
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
data LegalEntity = LegalEntity
{ legalEntity_ID :: Maybe Xsd.ID
, legalEntity_choice0 :: (Maybe (OneOf1 ((Maybe (EntityName)),[EntityId])))
}
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
]
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
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
data ManualExercise = ManualExercise
{ manualExerc_exerciseNotice :: Maybe ExerciseNotice
, manualExerc_fallbackExercise :: Maybe Xsd.Boolean
}
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
]
data MasterAgreement = MasterAgreement
{ masterAgreement_type :: Maybe MasterAgreementType
, masterAgreement_version :: Maybe MasterAgreementVersion
, masterAgreement_date :: Maybe Xsd.Date
}
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
data MasterConfirmation = MasterConfirmation
{ masterConfirmation_type :: Maybe MasterConfirmationType
, masterConfirmation_date :: Maybe Xsd.Date
, masterConfirmation_annexDate :: Maybe Xsd.Date
, masterConfirmation_annexType :: Maybe MasterConfirmationAnnexType
}
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
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
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
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
data Money = Money
{ money_ID :: Maybe Xsd.ID
, money_currency :: Currency
, money_amount :: Xsd.Decimal
}
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
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
data MultipleExercise = MultipleExercise
{ multiExerc_notionalReference :: [NotionalReference]
, multiExerc_integralMultipleAmount :: Maybe Xsd.Decimal
, multiExerc_choice2 :: (Maybe (OneOf2 Xsd.Decimal Xsd.NonNegativeInteger))
, multiExerc_choice3 :: (Maybe (OneOf2 Xsd.Decimal NonNegativeDecimal))
}
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
]
data NonNegativeAmountSchedule = NonNegativeAmountSchedule
{ nonNegatAmountSched_ID :: Maybe Xsd.ID
, nonNegatAmountSched_initialValue :: NonNegativeDecimal
, nonNegatAmountSched_step :: [NonNegativeStep]
, nonNegatAmountSched_currency :: Maybe Currency
}
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
data NonNegativeMoney = NonNegativeMoney
{ nonNegatMoney_ID :: Maybe Xsd.ID
, nonNegatMoney_currency :: Currency
, nonNegatMoney_amount :: NonNegativeDecimal
}
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
data NonNegativePayment = NonNegativePayment
{ nonNegatPayment_ID :: Maybe Xsd.ID
, nonNegatPayment_payerPartyReference :: Maybe PartyReference
, nonNegatPayment_payerAccountReference :: Maybe AccountReference
, nonNegatPayment_receiverPartyReference :: Maybe PartyReference
, nonNegatPayment_receiverAccountReference :: Maybe AccountReference
, nonNegatPayment_paymentDate :: Maybe AdjustableOrRelativeDate
, nonNegatPayment_paymentAmount :: Maybe NonNegativeMoney
}
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)
data NonNegativeSchedule = NonNegativeSchedule
{ nonNegatSched_ID :: Maybe Xsd.ID
, nonNegatSched_initialValue :: NonNegativeDecimal
, nonNegatSched_step :: [NonNegativeStep]
}
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
]
data NonNegativeStep = NonNegativeStep
{ nonNegatStep_ID :: Maybe Xsd.ID
, nonNegatStep_stepDate :: Maybe Xsd.Date
, nonNegatStep_stepValue :: Maybe NonNegativeDecimal
}
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
data NotionalAmount = NotionalAmount
{ notionAmount_ID :: Maybe Xsd.ID
, notionAmount_currency :: Currency
, notionAmount_amount :: NonNegativeDecimal
}
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)
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
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
data Offset = Offset
{ offset_ID :: Maybe Xsd.ID
, offset_periodMultiplier :: Xsd.Integer
, offset_period :: PeriodEnum
, offset_dayType :: Maybe DayTypeEnum
}
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
data OffsetPrevailingTime = OffsetPrevailingTime
{ offsetPrevaTime_time :: Maybe PrevailingTime
, offsetPrevaTime_offset :: Maybe Offset
}
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
, onBehalfOf_accountReference :: [AccountReference]
}
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
data PartialExercise = PartialExercise
{ partialExerc_notionalReference :: [NotionalReference]
, partialExerc_integralMultipleAmount :: Maybe Xsd.Decimal
, partialExerc_choice2 :: (Maybe (OneOf2 Xsd.Decimal Xsd.NonNegativeInteger))
}
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
, party_id :: [PartyId]
, party_name :: Maybe PartyName
, party_classification :: [IndustryClassification]
, party_creditRating :: [CreditRating]
, party_country :: Maybe CountryCode
, party_jurisdiction :: [GoverningLaw]
, party_organizationType :: Maybe OrganizationType
, party_contactInfo :: Maybe ContactInformation
, party_businessUnit :: [BusinessUnit]
, party_person :: [Person]
}
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
]
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
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
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
, partyRelat_accountReference :: Maybe AccountReference
, partyRelat_role :: Maybe PartyRole
, partyRelat_type :: Maybe PartyRoleType
, partyRelat_effectiveDate :: Maybe Xsd.Date
, partyRelat_terminationDate :: Maybe Xsd.Date
, partyRelat_documentation :: Maybe PartyRelationshipDocumentation
}
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
]
data PartyRelationshipDocumentation = PartyRelationshipDocumentation
{ partyRelatDocum_choice0 :: [OneOf3 MasterAgreement CreditSupportAgreement GenericAgreement]
}
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
]
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
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
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
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
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
data Payment = Payment
{ payment_ID :: Maybe Xsd.ID
, payment_href :: Maybe Xsd.IDREF
, payment_payerPartyReference :: Maybe PartyReference
, payment_payerAccountReference :: Maybe AccountReference
, payment_receiverPartyReference :: Maybe PartyReference
, payment_receiverAccountReference :: Maybe AccountReference
, payment_amount :: NonNegativeMoney
, payment_date :: Maybe AdjustableOrAdjustedDate
, payment_type :: Maybe PaymentType
, payment_settlementInformation :: Maybe SettlementInformation
, payment_discountFactor :: Maybe Xsd.Decimal
, payment_presentValueAmount :: Maybe Money
}
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
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
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
data PaymentDetails = PaymentDetails
{ paymentDetails_paymentReference :: Maybe PaymentReference
, paymentDetails_grossCashflow :: [GrossCashflow]
, paymentDetails_settlementInformation :: Maybe SettlementInformation
}
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
]
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
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
data Period = Period
{ period_ID :: Maybe Xsd.ID
, period_multiplier :: Xsd.Integer
, period :: PeriodEnum
}
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
, periodDates_calculationPeriodDatesAdjustments :: Maybe BusinessDayAdjustments
}
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
]
data PositiveAmountSchedule = PositiveAmountSchedule
{ positAmountSched_ID :: Maybe Xsd.ID
, positAmountSched_initialValue :: PositiveDecimal
, positAmountSched_step :: [PositiveStep]
, positAmountSched_currency :: Maybe Currency
}
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
data PositiveMoney = PositiveMoney
{ positMoney_ID :: Maybe Xsd.ID
, positMoney_currency :: Currency
, positMoney_amount :: Maybe PositiveDecimal
}
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
data PositivePayment = PositivePayment
{ positPayment_ID :: Maybe Xsd.ID
, positPayment_payerPartyReference :: Maybe PartyReference
, positPayment_payerAccountReference :: Maybe AccountReference
, positPayment_receiverPartyReference :: Maybe PartyReference
, positPayment_receiverAccountReference :: Maybe AccountReference
, positPayment_paymentDate :: Maybe AdjustableOrRelativeDate
, positPayment_paymentAmount :: Maybe PositiveMoney
}
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)
data PositiveSchedule = PositiveSchedule
{ positSched_ID :: Maybe Xsd.ID
, positSched_initialValue :: PositiveDecimal
, positSched_step :: [PositiveStep]
}
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
]
data PositiveStep = PositiveStep
{ positiveStep_ID :: Maybe Xsd.ID
, positiveStep_stepDate :: Maybe Xsd.Date
, positiveStep_stepValue :: Maybe PositiveDecimal
}
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
data PrevailingTime = PrevailingTime
{ prevaTime_hourMinuteTime :: Maybe HourMinuteTime
, prevaTime_location :: Maybe TimezoneLocation
}
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
]
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
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
data PrincipalExchanges = PrincipalExchanges
{ princExchan_ID :: Maybe Xsd.ID
, princExchan_initialExchange :: Maybe Xsd.Boolean
, princExchan_finalExchange :: Maybe Xsd.Boolean
, princExchan_intermediateExchange :: Maybe Xsd.Boolean
}
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
]
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
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
data QuotedCurrencyPair = QuotedCurrencyPair
{ quotedCurrenPair_currency1 :: Maybe Currency
, quotedCurrenPair_currency2 :: Maybe Currency
, quotedCurrenPair_quoteBasis :: Maybe QuoteBasisEnum
}
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
]
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
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
]
[]
data RateObservation = RateObservation
{ rateObserv_ID :: Maybe Xsd.ID
, rateObserv_resetDate :: Maybe Xsd.Date
, rateObserv_adjustedFixingDate :: Maybe Xsd.Date
, rateObserv_observedRate :: Maybe Xsd.Decimal
, rateObserv_treatedRate :: Maybe Xsd.Decimal
, rateObserv_observationWeight :: Maybe Xsd.PositiveInteger
, rateObserv_rateReference :: Maybe RateReference
, rateObserv_forecastRate :: Maybe Xsd.Decimal
, rateObserv_treatedForecastRate :: Maybe Xsd.Decimal
}
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
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
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
data ReferenceBank = ReferenceBank
{ referenceBank_id :: Maybe ReferenceBankId
, referenceBank_name :: Maybe Xsd.XsdString
}
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
, relatedBusUnit_role :: BusinessUnitRole
}
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
, relatedParty_accountReference :: Maybe AccountReference
, relatedParty_role :: PartyRole
, relatedParty_type :: Maybe PartyRoleType
}
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
, relatedPerson_role :: PersonRole
}
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
]
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
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
data RelativeDateOffset = RelativeDateOffset
{ relatDateOffset_ID :: Maybe Xsd.ID
, relatDateOffset_periodMultiplier :: Xsd.Integer
, relatDateOffset_period :: PeriodEnum
, relatDateOffset_dayType :: Maybe DayTypeEnum
, relatDateOffset_businessDayConvention :: Maybe BusinessDayConventionEnum
, relatDateOffset_choice4 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))
, relatDateOffset_dateRelativeTo :: Maybe DateReference
, relatDateOffset_adjustedDate :: Maybe IdentifiedDate
}
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)
data RelativeDates = RelativeDates
{ relatDates_ID :: Maybe Xsd.ID
, relatDates_periodMultiplier :: Xsd.Integer
, relatDates_period :: PeriodEnum
, relatDates_dayType :: Maybe DayTypeEnum
, relatDates_businessDayConvention :: Maybe BusinessDayConventionEnum
, relatDates_choice4 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))
, relatDates_dateRelativeTo :: Maybe DateReference
, relatDates_adjustedDate :: Maybe IdentifiedDate
, relatDates_periodSkip :: Maybe Xsd.PositiveInteger
, relatDates_scheduleBounds :: Maybe DateRange
}
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)
data RelativeDateSequence = RelativeDateSequence
{ relatDateSequen_dateRelativeTo :: Maybe DateReference
, relatDateSequen_dateOffset :: [DateOffset]
, relatDateSequen_choice2 :: (Maybe (OneOf2 BusinessCentersReference 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
]
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
data ResetFrequency = ResetFrequency
{ resetFrequ_ID :: Maybe Xsd.ID
, resetFrequ_periodMultiplier :: Maybe Xsd.PositiveInteger
, resetFrequ_period :: Maybe PeriodExtendedEnum
, resetFrequ_weeklyRollConvention :: Maybe WeeklyRollConventionEnum
}
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
data Resource = Resource
{ resource_id :: Maybe ResourceId
, resource_type :: Maybe ResourceType
, resource_language :: Maybe Language
, resource_sizeInBytes :: Maybe Xsd.Decimal
, resource_length :: Maybe ResourceLength
, resource_mimeType :: Maybe MimeType
, resource_name :: Maybe Xsd.NormalizedString
, resource_comments :: Maybe Xsd.XsdString
, resource_choice8 :: (Maybe (OneOf4 Xsd.XsdString Xsd.HexBinary Xsd.Base64Binary Xsd.AnyURI))
}
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
]
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
data ResourceLength = ResourceLength
{ resourLength_lengthUnit :: Maybe LengthUnitEnum
, resourLength_lengthValue :: Maybe Xsd.Decimal
}
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
]
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
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
data Rounding = Rounding
{ rounding_direction :: Maybe RoundingDirectionEnum
, rounding_precision :: Maybe Xsd.NonNegativeInteger
}
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
]
data Routing = Routing
{ routing_choice0 :: (Maybe (OneOf3 RoutingIds RoutingExplicitDetails RoutingIdsAndExplicitDetails))
}
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
]
data RoutingExplicitDetails = RoutingExplicitDetails
{ routingExplicDetails_routingName :: Maybe Xsd.XsdString
, routingExplicDetails_routingAddress :: Maybe Address
, routingExplicDetails_routingAccountNumber :: Maybe Xsd.XsdString
, routingExplicDetails_routingReferenceText :: [Xsd.XsdString]
}
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
data RoutingIds = RoutingIds
{ routingIds_routingId :: [RoutingId]
}
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
]
data RoutingIdsAndExplicitDetails = RoutingIdsAndExplicitDetails
{ routingIdsAndExplicDetails_routingIds :: [RoutingIds]
, routingIdsAndExplicDetails_routingName :: Maybe Xsd.XsdString
, routingIdsAndExplicDetails_routingAddress :: Maybe Address
, routingIdsAndExplicDetails_routingAccountNumber :: Maybe Xsd.XsdString
, routingIdsAndExplicDetails_routingReferenceText :: [Xsd.XsdString]
}
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
]
data Schedule = Schedule
{ schedule_ID :: Maybe Xsd.ID
, schedule_initialValue :: Xsd.Decimal
, schedule_step :: [Step]
}
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
]
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
data SettlementInformation = SettlementInformation
{ settlInfo_choice0 :: (Maybe (OneOf2 StandardSettlementStyleEnum SettlementInstruction))
}
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
]
data SettlementInstruction = SettlementInstruction
{ settlInstr_settlementMethod :: Maybe SettlementMethod
, settlInstr_correspondentInformation :: Maybe CorrespondentInformation
, settlInstr_intermediaryInformation :: [IntermediaryInformation]
, settlInstr_beneficiaryBank :: Maybe Beneficiary
, settlInstr_beneficiary :: Maybe Beneficiary
, settlInstr_depositoryPartyReference :: Maybe PartyReference
, settlInstr_splitSettlement :: [SplitSettlement]
}
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
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
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
data SettlementRateSource = SettlementRateSource
{ settlRateSource_choice0 :: (Maybe (OneOf2 InformationSource CashSettlementReferenceBanks))
}
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
]
data SharedAmericanExercise = SharedAmericanExercise
{ sharedAmericExerc_ID :: Maybe Xsd.ID
, sharedAmericExerc_commencementDate :: Maybe AdjustableOrRelativeDate
, sharedAmericExerc_expirationDate :: Maybe AdjustableOrRelativeDate
, sharedAmericExerc_choice2 :: (Maybe (OneOf2 BusinessCenterTime DeterminationMethod))
}
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
data SimplePayment = SimplePayment
{ simplePayment_ID :: Maybe Xsd.ID
, simplePayment_payerPartyReference :: Maybe PartyReference
, simplePayment_payerAccountReference :: Maybe AccountReference
, simplePayment_receiverPartyReference :: Maybe PartyReference
, simplePayment_receiverAccountReference :: Maybe AccountReference
, simplePayment_paymentAmount :: Maybe NonNegativeMoney
, simplePayment_paymentDate :: Maybe AdjustableOrRelativeDate
}
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
data SplitSettlement = SplitSettlement
{ splitSettlement_amount :: Maybe Money
, splitSettl_beneficiaryBank :: Maybe Routing
, splitSettl_beneficiary :: Maybe Routing
}
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
]
data SpreadSchedule = SpreadSchedule
{ spreadSched_ID :: Maybe Xsd.ID
, spreadSched_initialValue :: Xsd.Decimal
, spreadSched_step :: [Step]
, 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
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
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
data Step = Step
{ step_ID :: Maybe Xsd.ID
, step_date :: Maybe Xsd.Date
, step_value :: Maybe Xsd.Decimal
}
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
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
data StreetAddress = StreetAddress
{ streetAddress_streetLine :: [Xsd.XsdString]
}
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
]
data Strike = Strike
{ strike_ID :: Maybe Xsd.ID
, strike_rate :: Maybe Xsd.Decimal
, strike_buyer :: Maybe IdentifiedPayerReceiver
, strike_seller :: Maybe IdentifiedPayerReceiver
}
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
]
data StrikeSchedule = StrikeSchedule
{ strikeSched_ID :: Maybe Xsd.ID
, strikeSched_initialValue :: Xsd.Decimal
, strikeSched_step :: [Step]
, strikeSched_buyer :: Maybe IdentifiedPayerReceiver
, strikeSched_seller :: Maybe IdentifiedPayerReceiver
}
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
data Stub = Stub
{ stub_choice0 :: (Maybe (OneOf3 [FloatingRate] Xsd.Decimal Money))
, stub_startDate :: Maybe AdjustableOrRelativeDate
, stub_endDate :: Maybe AdjustableOrRelativeDate
}
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
data StubValue = StubValue
{ stubValue_choice0 :: (Maybe (OneOf3 [FloatingRate] Xsd.Decimal Money))
}
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
]
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
elementAmericanExercise :: XMLParser AmericanExercise
elementAmericanExercise = parseSchemaType "americanExercise"
elementToXMLAmericanExercise :: AmericanExercise -> [Content ()]
elementToXMLAmericanExercise = schemaTypeToXML "americanExercise"
elementBermudaExercise :: XMLParser BermudaExercise
elementBermudaExercise = parseSchemaType "bermudaExercise"
elementToXMLBermudaExercise :: BermudaExercise -> [Content ()]
elementToXMLBermudaExercise = schemaTypeToXML "bermudaExercise"
elementEuropeanExercise :: XMLParser EuropeanExercise
elementEuropeanExercise = parseSchemaType "europeanExercise"
elementToXMLEuropeanExercise :: EuropeanExercise -> [Content ()]
elementToXMLEuropeanExercise = schemaTypeToXML "europeanExercise"
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"
elementProduct :: XMLParser Product
elementProduct = fmap supertype elementStandardProduct
`onFail`
fmap supertype elementSwaption
`onFail`
fmap supertype elementSwap
`onFail`
fmap supertype elementFra
`onFail`
fmap supertype elementCapFloor
`onFail`
fmap supertype elementBulletPayment
`onFail`
fmap supertype elementNonSchemaProduct
`onFail`
fmap supertype elementGenericProduct
`onFail`
fmap supertype elementTermDeposit
`onFail`
fmap supertype elementFxDigitalOption
`onFail`
fmap supertype elementFxOption
`onFail`
fmap supertype elementFxSwap
`onFail`
fmap supertype elementFxSingleLeg
`onFail`
fmap supertype elementReturnSwap
`onFail`
fmap supertype elementStrategy
`onFail`
fmap supertype elementInstrumentTradeDetails
`onFail`
fmap supertype elementDividendSwapTransactionSupplement
`onFail`
fmap supertype elementCorrelationSwap
`onFail`
fmap supertype elementCommoditySwaption
`onFail`
fmap supertype elementCommoditySwap
`onFail`
fmap supertype elementCommodityOption
`onFail`
fmap supertype elementCommodityForward
`onFail`
fmap supertype elementCreditDefaultSwapOption
`onFail`
fmap supertype elementCreditDefaultSwap
`onFail`
fmap supertype elementBondOption
`onFail`
fmap supertype elementEquitySwapTransactionSupplement
`onFail`
fmap supertype elementEquityOptionTransactionSupplement
`onFail`
fmap supertype elementEquityOption
`onFail`
fmap supertype elementEquityForward
`onFail`
fmap supertype elementBrokerEquityOption
`onFail`
fmap supertype elementVarianceSwapTransactionSupplement
`onFail`
fmap supertype elementVarianceSwap
`onFail`
fmap supertype elementVarianceOptionTransactionSupplement
`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"
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