module Data.FpML.V53.Com
( module Data.FpML.V53.Com
, module Data.FpML.V53.Shared.Option
) where
import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))
import Text.XML.HaXml.Schema.Schema as Schema
import Text.XML.HaXml.OneOfN
import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd
import Data.FpML.V53.Shared.Option
data AbsoluteTolerance = AbsoluteTolerance
{ absToler_positive :: Maybe Xsd.Decimal
, absToler_negative :: Maybe Xsd.Decimal
, absToler_unit :: Maybe QuantityUnit
, absToler_optionOwnerPartyReference :: Maybe PartyReference
}
deriving (Eq,Show)
instance SchemaType AbsoluteTolerance where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return AbsoluteTolerance
`apply` optional (parseSchemaType "positive")
`apply` optional (parseSchemaType "negative")
`apply` optional (parseSchemaType "unit")
`apply` optional (parseSchemaType "optionOwnerPartyReference")
schemaTypeToXML s x@AbsoluteTolerance{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "positive") $ absToler_positive x
, maybe [] (schemaTypeToXML "negative") $ absToler_negative x
, maybe [] (schemaTypeToXML "unit") $ absToler_unit x
, maybe [] (schemaTypeToXML "optionOwnerPartyReference") $ absToler_optionOwnerPartyReference x
]
data BullionDeliveryLocation = BullionDeliveryLocation Scheme BullionDeliveryLocationAttributes deriving (Eq,Show)
data BullionDeliveryLocationAttributes = BullionDeliveryLocationAttributes
{ bullionDelivLocatAttrib_bullionDeliveryLocationScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType BullionDeliveryLocation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "bullionDeliveryLocationScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ BullionDeliveryLocation v (BullionDeliveryLocationAttributes a0)
schemaTypeToXML s (BullionDeliveryLocation bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "bullionDeliveryLocationScheme") $ bullionDelivLocatAttrib_bullionDeliveryLocationScheme at
]
$ schemaTypeToXML s bt
instance Extension BullionDeliveryLocation Scheme where
supertype (BullionDeliveryLocation s _) = s
data BullionPhysicalLeg = BullionPhysicalLeg
{ bullionPhysicLeg_ID :: Maybe Xsd.ID
, bullionPhysicLeg_payerPartyReference :: Maybe PartyReference
, bullionPhysicLeg_payerAccountReference :: Maybe AccountReference
, bullionPhysicLeg_receiverPartyReference :: Maybe PartyReference
, bullionPhysicLeg_receiverAccountReference :: Maybe AccountReference
, bullionPhysicLeg_bullionType :: Maybe BullionTypeEnum
, bullionPhysicLeg_deliveryLocation :: Maybe BullionDeliveryLocation
, bullionPhysicLeg_choice6 :: (Maybe (OneOf2 CommodityNotionalQuantity CommodityPhysicalQuantitySchedule))
, bullionPhysicLeg_totalPhysicalQuantity :: UnitQuantity
, bullionPhysicLeg_settlementDate :: Maybe AdjustableOrRelativeDate
}
deriving (Eq,Show)
instance SchemaType BullionPhysicalLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (BullionPhysicalLeg a0)
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` optional (parseSchemaType "bullionType")
`apply` optional (parseSchemaType "deliveryLocation")
`apply` optional (oneOf' [ ("CommodityNotionalQuantity", fmap OneOf2 (parseSchemaType "physicalQuantity"))
, ("CommodityPhysicalQuantitySchedule", fmap TwoOf2 (parseSchemaType "physicalQuantitySchedule"))
])
`apply` parseSchemaType "totalPhysicalQuantity"
`apply` optional (parseSchemaType "settlementDate")
schemaTypeToXML s x@BullionPhysicalLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ bullionPhysicLeg_ID x
]
[ maybe [] (schemaTypeToXML "payerPartyReference") $ bullionPhysicLeg_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ bullionPhysicLeg_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ bullionPhysicLeg_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ bullionPhysicLeg_receiverAccountReference x
, maybe [] (schemaTypeToXML "bullionType") $ bullionPhysicLeg_bullionType x
, maybe [] (schemaTypeToXML "deliveryLocation") $ bullionPhysicLeg_deliveryLocation x
, maybe [] (foldOneOf2 (schemaTypeToXML "physicalQuantity")
(schemaTypeToXML "physicalQuantitySchedule")
) $ bullionPhysicLeg_choice6 x
, schemaTypeToXML "totalPhysicalQuantity" $ bullionPhysicLeg_totalPhysicalQuantity x
, maybe [] (schemaTypeToXML "settlementDate") $ bullionPhysicLeg_settlementDate x
]
instance Extension BullionPhysicalLeg PhysicalForwardLeg where
supertype v = PhysicalForwardLeg_BullionPhysicalLeg v
instance Extension BullionPhysicalLeg CommodityForwardLeg where
supertype = (supertype :: PhysicalForwardLeg -> CommodityForwardLeg)
. (supertype :: BullionPhysicalLeg -> PhysicalForwardLeg)
instance Extension BullionPhysicalLeg Leg where
supertype = (supertype :: CommodityForwardLeg -> Leg)
. (supertype :: PhysicalForwardLeg -> CommodityForwardLeg)
. (supertype :: BullionPhysicalLeg -> PhysicalForwardLeg)
data CalculationPeriodsDatesReference = CalculationPeriodsDatesReference
{ calcPeriodsDatesRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType CalculationPeriodsDatesReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (CalculationPeriodsDatesReference a0)
schemaTypeToXML s x@CalculationPeriodsDatesReference{} =
toXMLElement s [ toXMLAttribute "href" $ calcPeriodsDatesRef_href x
]
[]
instance Extension CalculationPeriodsDatesReference Reference where
supertype v = Reference_CalculationPeriodsDatesReference v
data CalculationPeriodsReference = CalculationPeriodsReference
{ calcPeriodsRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType CalculationPeriodsReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (CalculationPeriodsReference a0)
schemaTypeToXML s x@CalculationPeriodsReference{} =
toXMLElement s [ toXMLAttribute "href" $ calcPeriodsRef_href x
]
[]
instance Extension CalculationPeriodsReference Reference where
supertype v = Reference_CalculationPeriodsReference v
data CalculationPeriodsScheduleReference = CalculationPeriodsScheduleReference
{ cpsr_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType CalculationPeriodsScheduleReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (CalculationPeriodsScheduleReference a0)
schemaTypeToXML s x@CalculationPeriodsScheduleReference{} =
toXMLElement s [ toXMLAttribute "href" $ cpsr_href x
]
[]
instance Extension CalculationPeriodsScheduleReference Reference where
supertype v = Reference_CalculationPeriodsScheduleReference v
data CoalAttributeDecimal = CoalAttributeDecimal
{ coalAttribDecimal_choice0 :: (Maybe (OneOf1 ((Maybe (Xsd.Decimal)),(Maybe (Xsd.Decimal)))))
}
deriving (Eq,Show)
instance SchemaType CoalAttributeDecimal where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CoalAttributeDecimal
`apply` optional (oneOf' [ ("Maybe Xsd.Decimal Maybe Xsd.Decimal", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "standardContent")
`apply` optional (parseSchemaType "rejectionLimit")))
])
schemaTypeToXML s x@CoalAttributeDecimal{} =
toXMLElement s []
[ maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "standardContent") a
, maybe [] (schemaTypeToXML "rejectionLimit") b
])
) $ coalAttribDecimal_choice0 x
]
data CoalAttributePercentage = CoalAttributePercentage
{ coalAttribPercen_choice0 :: (Maybe (OneOf1 ((Maybe (RestrictedPercentage)),(Maybe (RestrictedPercentage)))))
}
deriving (Eq,Show)
instance SchemaType CoalAttributePercentage where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CoalAttributePercentage
`apply` optional (oneOf' [ ("Maybe RestrictedPercentage Maybe RestrictedPercentage", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "standardContent")
`apply` optional (parseSchemaType "rejectionLimit")))
])
schemaTypeToXML s x@CoalAttributePercentage{} =
toXMLElement s []
[ maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "standardContent") a
, maybe [] (schemaTypeToXML "rejectionLimit") b
])
) $ coalAttribPercen_choice0 x
]
data CoalDelivery = CoalDelivery
{ coalDelivery_choice0 :: OneOf2 CoalDeliveryPoint Xsd.Boolean
, coalDelivery_quantityVariationAdjustment :: Maybe Xsd.Boolean
, coalDelivery_transportationEquipment :: Maybe CoalTransportationEquipment
, coalDelivery_risk :: Maybe CommodityDeliveryRisk
}
deriving (Eq,Show)
instance SchemaType CoalDelivery where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CoalDelivery
`apply` oneOf' [ ("CoalDeliveryPoint", fmap OneOf2 (parseSchemaType "deliveryPoint"))
, ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "deliveryAtSource"))
]
`apply` optional (parseSchemaType "quantityVariationAdjustment")
`apply` optional (parseSchemaType "transportationEquipment")
`apply` optional (parseSchemaType "risk")
schemaTypeToXML s x@CoalDelivery{} =
toXMLElement s []
[ foldOneOf2 (schemaTypeToXML "deliveryPoint")
(schemaTypeToXML "deliveryAtSource")
$ coalDelivery_choice0 x
, maybe [] (schemaTypeToXML "quantityVariationAdjustment") $ coalDelivery_quantityVariationAdjustment x
, maybe [] (schemaTypeToXML "transportationEquipment") $ coalDelivery_transportationEquipment x
, maybe [] (schemaTypeToXML "risk") $ coalDelivery_risk x
]
data CoalDeliveryPoint = CoalDeliveryPoint Scheme CoalDeliveryPointAttributes deriving (Eq,Show)
data CoalDeliveryPointAttributes = CoalDeliveryPointAttributes
{ coalDelivPointAttrib_deliveryPointScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CoalDeliveryPoint where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "deliveryPointScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CoalDeliveryPoint v (CoalDeliveryPointAttributes a0)
schemaTypeToXML s (CoalDeliveryPoint bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "deliveryPointScheme") $ coalDelivPointAttrib_deliveryPointScheme at
]
$ schemaTypeToXML s bt
instance Extension CoalDeliveryPoint Scheme where
supertype (CoalDeliveryPoint s _) = s
data CoalPhysicalLeg = CoalPhysicalLeg
{ coalPhysicLeg_ID :: Maybe Xsd.ID
, coalPhysicLeg_payerPartyReference :: Maybe PartyReference
, coalPhysicLeg_payerAccountReference :: Maybe AccountReference
, coalPhysicLeg_receiverPartyReference :: Maybe PartyReference
, coalPhysicLeg_receiverAccountReference :: Maybe AccountReference
, coalPhysicLeg_deliveryPeriods :: Maybe CommodityDeliveryPeriods
, coalPhysicLeg_coal :: CoalProduct
, coalPhysicLeg_deliveryConditions :: CoalDelivery
, coalPhysicLeg_deliveryQuantity :: CommodityPhysicalQuantity
}
deriving (Eq,Show)
instance SchemaType CoalPhysicalLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CoalPhysicalLeg a0)
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` optional (parseSchemaType "deliveryPeriods")
`apply` parseSchemaType "coal"
`apply` parseSchemaType "deliveryConditions"
`apply` parseSchemaType "deliveryQuantity"
schemaTypeToXML s x@CoalPhysicalLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ coalPhysicLeg_ID x
]
[ maybe [] (schemaTypeToXML "payerPartyReference") $ coalPhysicLeg_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ coalPhysicLeg_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ coalPhysicLeg_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ coalPhysicLeg_receiverAccountReference x
, maybe [] (schemaTypeToXML "deliveryPeriods") $ coalPhysicLeg_deliveryPeriods x
, schemaTypeToXML "coal" $ coalPhysicLeg_coal x
, schemaTypeToXML "deliveryConditions" $ coalPhysicLeg_deliveryConditions x
, schemaTypeToXML "deliveryQuantity" $ coalPhysicLeg_deliveryQuantity x
]
instance Extension CoalPhysicalLeg PhysicalSwapLeg where
supertype v = PhysicalSwapLeg_CoalPhysicalLeg v
instance Extension CoalPhysicalLeg CommoditySwapLeg where
supertype = (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)
. (supertype :: CoalPhysicalLeg -> PhysicalSwapLeg)
instance Extension CoalPhysicalLeg Leg where
supertype = (supertype :: CommoditySwapLeg -> Leg)
. (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)
. (supertype :: CoalPhysicalLeg -> PhysicalSwapLeg)
data CoalProduct = CoalProduct
{ coalProduct_choice0 :: OneOf2 CoalProductType CoalProductSpecifications
, coalProduct_source :: [CoalProductSource]
, coalProduct_btuQualityAdjustment :: Maybe CoalQualityAdjustments
, coalProduct_so2QualityAdjustment :: Maybe CoalQualityAdjustments
}
deriving (Eq,Show)
instance SchemaType CoalProduct where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CoalProduct
`apply` oneOf' [ ("CoalProductType", fmap OneOf2 (parseSchemaType "type"))
, ("CoalProductSpecifications", fmap TwoOf2 (parseSchemaType "coalProductSpecifications"))
]
`apply` many (parseSchemaType "source")
`apply` optional (parseSchemaType "btuQualityAdjustment")
`apply` optional (parseSchemaType "so2QualityAdjustment")
schemaTypeToXML s x@CoalProduct{} =
toXMLElement s []
[ foldOneOf2 (schemaTypeToXML "type")
(schemaTypeToXML "coalProductSpecifications")
$ coalProduct_choice0 x
, concatMap (schemaTypeToXML "source") $ coalProduct_source x
, maybe [] (schemaTypeToXML "btuQualityAdjustment") $ coalProduct_btuQualityAdjustment x
, maybe [] (schemaTypeToXML "so2QualityAdjustment") $ coalProduct_so2QualityAdjustment x
]
data CoalProductSource = CoalProductSource Scheme CoalProductSourceAttributes deriving (Eq,Show)
data CoalProductSourceAttributes = CoalProductSourceAttributes
{ coalProductSourceAttrib_commodityCoalProductSourceScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CoalProductSource where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "commodityCoalProductSourceScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CoalProductSource v (CoalProductSourceAttributes a0)
schemaTypeToXML s (CoalProductSource bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "commodityCoalProductSourceScheme") $ coalProductSourceAttrib_commodityCoalProductSourceScheme at
]
$ schemaTypeToXML s bt
instance Extension CoalProductSource Scheme where
supertype (CoalProductSource s _) = s
data CoalProductSpecifications = CoalProductSpecifications
{ coalProductSpecif_choice0 :: (Maybe (OneOf2 CoalStandardQuality CoalStandardQualitySchedule))
}
deriving (Eq,Show)
instance SchemaType CoalProductSpecifications where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CoalProductSpecifications
`apply` optional (oneOf' [ ("CoalStandardQuality", fmap OneOf2 (parseSchemaType "standardQuality"))
, ("CoalStandardQualitySchedule", fmap TwoOf2 (parseSchemaType "standardQualitySchedule"))
])
schemaTypeToXML s x@CoalProductSpecifications{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "standardQuality")
(schemaTypeToXML "standardQualitySchedule")
) $ coalProductSpecif_choice0 x
]
data CoalProductType = CoalProductType Scheme CoalProductTypeAttributes deriving (Eq,Show)
data CoalProductTypeAttributes = CoalProductTypeAttributes
{ coalProductTypeAttrib_commodityCoalProductTypeScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CoalProductType where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "commodityCoalProductTypeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CoalProductType v (CoalProductTypeAttributes a0)
schemaTypeToXML s (CoalProductType bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "commodityCoalProductTypeScheme") $ coalProductTypeAttrib_commodityCoalProductTypeScheme at
]
$ schemaTypeToXML s bt
instance Extension CoalProductType Scheme where
supertype (CoalProductType s _) = s
data CoalQualityAdjustments = CoalQualityAdjustments Scheme CoalQualityAdjustmentsAttributes deriving (Eq,Show)
data CoalQualityAdjustmentsAttributes = CoalQualityAdjustmentsAttributes
{ coalQualityAdjustAttrib_commodityCoalQualityAdjustmentsScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CoalQualityAdjustments where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "commodityCoalQualityAdjustmentsScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CoalQualityAdjustments v (CoalQualityAdjustmentsAttributes a0)
schemaTypeToXML s (CoalQualityAdjustments bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "commodityCoalQualityAdjustmentsScheme") $ coalQualityAdjustAttrib_commodityCoalQualityAdjustmentsScheme at
]
$ schemaTypeToXML s bt
instance Extension CoalQualityAdjustments Scheme where
supertype (CoalQualityAdjustments s _) = s
data CoalStandardQuality = CoalStandardQuality
{ coalStdQuality_moisture :: Maybe CoalAttributePercentage
, coalStdQuality_ash :: Maybe CoalAttributePercentage
, coalStdQuality_sulfur :: Maybe CoalAttributePercentage
, coalStdQuality_sO2 :: Maybe CoalAttributePercentage
, coalStdQuality_volatile :: Maybe CoalAttributePercentage
, coalStdQuality_bTUperLB :: Maybe CoalAttributeDecimal
, coalStdQuality_topSize :: Maybe CoalAttributeDecimal
, coalStdQuality_finesPassingScreen :: Maybe CoalAttributeDecimal
, coalStdQuality_grindability :: Maybe CoalAttributeDecimal
, coalStdQuality_ashFusionTemperature :: Maybe CoalAttributeDecimal
, coalStdQuality_initialDeformation :: Maybe CoalAttributeDecimal
, coalStdQuality_softeningHeightWidth :: Maybe CoalAttributeDecimal
, coalStdQuality_softeningHeightHalfWidth :: Maybe CoalAttributeDecimal
, coalStdQuality_fluid :: Maybe CoalAttributeDecimal
}
deriving (Eq,Show)
instance SchemaType CoalStandardQuality where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CoalStandardQuality
`apply` optional (parseSchemaType "moisture")
`apply` optional (parseSchemaType "ash")
`apply` optional (parseSchemaType "sulfur")
`apply` optional (parseSchemaType "SO2")
`apply` optional (parseSchemaType "volatile")
`apply` optional (parseSchemaType "BTUperLB")
`apply` optional (parseSchemaType "topSize")
`apply` optional (parseSchemaType "finesPassingScreen")
`apply` optional (parseSchemaType "grindability")
`apply` optional (parseSchemaType "ashFusionTemperature")
`apply` optional (parseSchemaType "initialDeformation")
`apply` optional (parseSchemaType "softeningHeightWidth")
`apply` optional (parseSchemaType "softeningHeightHalfWidth")
`apply` optional (parseSchemaType "fluid")
schemaTypeToXML s x@CoalStandardQuality{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "moisture") $ coalStdQuality_moisture x
, maybe [] (schemaTypeToXML "ash") $ coalStdQuality_ash x
, maybe [] (schemaTypeToXML "sulfur") $ coalStdQuality_sulfur x
, maybe [] (schemaTypeToXML "SO2") $ coalStdQuality_sO2 x
, maybe [] (schemaTypeToXML "volatile") $ coalStdQuality_volatile x
, maybe [] (schemaTypeToXML "BTUperLB") $ coalStdQuality_bTUperLB x
, maybe [] (schemaTypeToXML "topSize") $ coalStdQuality_topSize x
, maybe [] (schemaTypeToXML "finesPassingScreen") $ coalStdQuality_finesPassingScreen x
, maybe [] (schemaTypeToXML "grindability") $ coalStdQuality_grindability x
, maybe [] (schemaTypeToXML "ashFusionTemperature") $ coalStdQuality_ashFusionTemperature x
, maybe [] (schemaTypeToXML "initialDeformation") $ coalStdQuality_initialDeformation x
, maybe [] (schemaTypeToXML "softeningHeightWidth") $ coalStdQuality_softeningHeightWidth x
, maybe [] (schemaTypeToXML "softeningHeightHalfWidth") $ coalStdQuality_softeningHeightHalfWidth x
, maybe [] (schemaTypeToXML "fluid") $ coalStdQuality_fluid x
]
data CoalStandardQualitySchedule = CoalStandardQualitySchedule
{ coalStdQualitySched_standardQualityStep :: [CoalStandardQuality]
, coalStdQualitySched_choice1 :: (Maybe (OneOf2 CalculationPeriodsReference CalculationPeriodsScheduleReference))
}
deriving (Eq,Show)
instance SchemaType CoalStandardQualitySchedule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CoalStandardQualitySchedule
`apply` many (parseSchemaType "StandardQualityStep")
`apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf2 (parseSchemaType "deliveryPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf2 (parseSchemaType "deliveryPeriodsScheduleReference"))
])
schemaTypeToXML s x@CoalStandardQualitySchedule{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "StandardQualityStep") $ coalStdQualitySched_standardQualityStep x
, maybe [] (foldOneOf2 (schemaTypeToXML "deliveryPeriodsReference")
(schemaTypeToXML "deliveryPeriodsScheduleReference")
) $ coalStdQualitySched_choice1 x
]
data CoalTransportationEquipment = CoalTransportationEquipment Scheme CoalTransportationEquipmentAttributes deriving (Eq,Show)
data CoalTransportationEquipmentAttributes = CoalTransportationEquipmentAttributes
{ ctea_commodityCoalTransportationEquipmentScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CoalTransportationEquipment where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "commodityCoalTransportationEquipmentScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CoalTransportationEquipment v (CoalTransportationEquipmentAttributes a0)
schemaTypeToXML s (CoalTransportationEquipment bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "commodityCoalTransportationEquipmentScheme") $ ctea_commodityCoalTransportationEquipmentScheme at
]
$ schemaTypeToXML s bt
instance Extension CoalTransportationEquipment Scheme where
supertype (CoalTransportationEquipment s _) = s
data CommodityAmericanExercise = CommodityAmericanExercise
{ commodAmericExerc_ID :: Maybe Xsd.ID
, commodAmericExerc_exercisePeriod :: [CommodityExercisePeriods]
, commodAmericExerc_exerciseFrequency :: Maybe Frequency
, commodAmericExerc_choice2 :: (Maybe (OneOf2 BusinessCenterTime DeterminationMethod))
, commodAmericExerc_expirationTime :: Maybe BusinessCenterTime
, commodAmericExerc_multipleExercise :: Maybe CommodityMultipleExercise
}
deriving (Eq,Show)
instance SchemaType CommodityAmericanExercise where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityAmericanExercise a0)
`apply` many (parseSchemaType "exercisePeriod")
`apply` optional (parseSchemaType "exerciseFrequency")
`apply` optional (oneOf' [ ("BusinessCenterTime", fmap OneOf2 (parseSchemaType "latestExerciseTime"))
, ("DeterminationMethod", fmap TwoOf2 (parseSchemaType "latestExerciseTimeDetermination"))
])
`apply` optional (parseSchemaType "expirationTime")
`apply` optional (parseSchemaType "multipleExercise")
schemaTypeToXML s x@CommodityAmericanExercise{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodAmericExerc_ID x
]
[ concatMap (schemaTypeToXML "exercisePeriod") $ commodAmericExerc_exercisePeriod x
, maybe [] (schemaTypeToXML "exerciseFrequency") $ commodAmericExerc_exerciseFrequency x
, maybe [] (foldOneOf2 (schemaTypeToXML "latestExerciseTime")
(schemaTypeToXML "latestExerciseTimeDetermination")
) $ commodAmericExerc_choice2 x
, maybe [] (schemaTypeToXML "expirationTime") $ commodAmericExerc_expirationTime x
, maybe [] (schemaTypeToXML "multipleExercise") $ commodAmericExerc_multipleExercise x
]
instance Extension CommodityAmericanExercise Exercise where
supertype v = Exercise_CommodityAmericanExercise v
data CommodityCalculationPeriodsSchedule = CommodityCalculationPeriodsSchedule
{ ccps_ID :: Maybe Xsd.ID
, ccps_periodMultiplier :: Maybe Xsd.PositiveInteger
, ccps_period :: Maybe PeriodExtendedEnum
, ccps_balanceOfFirstPeriod :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType CommodityCalculationPeriodsSchedule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityCalculationPeriodsSchedule a0)
`apply` optional (parseSchemaType "periodMultiplier")
`apply` optional (parseSchemaType "period")
`apply` optional (parseSchemaType "balanceOfFirstPeriod")
schemaTypeToXML s x@CommodityCalculationPeriodsSchedule{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ ccps_ID x
]
[ maybe [] (schemaTypeToXML "periodMultiplier") $ ccps_periodMultiplier x
, maybe [] (schemaTypeToXML "period") $ ccps_period x
, maybe [] (schemaTypeToXML "balanceOfFirstPeriod") $ ccps_balanceOfFirstPeriod x
]
instance Extension CommodityCalculationPeriodsSchedule Frequency where
supertype (CommodityCalculationPeriodsSchedule a0 e0 e1 e2) =
Frequency a0 e0 e1
data CommodityDeliveryPeriods = CommodityDeliveryPeriods
{ commodDelivPeriods_ID :: Maybe Xsd.ID
, commodDelivPeriods_choice0 :: OneOf3 AdjustableDates CommodityCalculationPeriodsSchedule ((Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference)))
}
deriving (Eq,Show)
instance SchemaType CommodityDeliveryPeriods where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityDeliveryPeriods a0)
`apply` oneOf' [ ("AdjustableDates", fmap OneOf3 (parseSchemaType "periods"))
, ("CommodityCalculationPeriodsSchedule", fmap TwoOf3 (parseSchemaType "periodsSchedule"))
, ("(Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))", fmap ThreeOf3 (optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))
, ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))
])))
]
schemaTypeToXML s x@CommodityDeliveryPeriods{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodDelivPeriods_ID x
]
[ foldOneOf3 (schemaTypeToXML "periods")
(schemaTypeToXML "periodsSchedule")
(maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")
(schemaTypeToXML "calculationPeriodsScheduleReference")
(schemaTypeToXML "calculationPeriodsDatesReference")
))
$ commodDelivPeriods_choice0 x
]
data CommodityDeliveryPoint = CommodityDeliveryPoint Scheme CommodityDeliveryPointAttributes deriving (Eq,Show)
data CommodityDeliveryPointAttributes = CommodityDeliveryPointAttributes
{ commodDelivPointAttrib_deliveryPointScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CommodityDeliveryPoint where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "deliveryPointScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CommodityDeliveryPoint v (CommodityDeliveryPointAttributes a0)
schemaTypeToXML s (CommodityDeliveryPoint bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "deliveryPointScheme") $ commodDelivPointAttrib_deliveryPointScheme at
]
$ schemaTypeToXML s bt
instance Extension CommodityDeliveryPoint Scheme where
supertype (CommodityDeliveryPoint s _) = s
data CommodityDeliveryRisk = CommodityDeliveryRisk Scheme CommodityDeliveryRiskAttributes deriving (Eq,Show)
data CommodityDeliveryRiskAttributes = CommodityDeliveryRiskAttributes
{ commodDelivRiskAttrib_deliveryRiskScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CommodityDeliveryRisk where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "deliveryRiskScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CommodityDeliveryRisk v (CommodityDeliveryRiskAttributes a0)
schemaTypeToXML s (CommodityDeliveryRisk bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "deliveryRiskScheme") $ commodDelivRiskAttrib_deliveryRiskScheme at
]
$ schemaTypeToXML s bt
instance Extension CommodityDeliveryRisk Scheme where
supertype (CommodityDeliveryRisk s _) = s
data CommodityEuropeanExercise = CommodityEuropeanExercise
{ commodEuropExerc_ID :: Maybe Xsd.ID
, commodEuropExerc_expirationDate :: [AdjustableOrRelativeDate]
, commodEuropExerc_exerciseFrequency :: Maybe Frequency
, commodEuropExerc_expirationTime :: Maybe BusinessCenterTime
}
deriving (Eq,Show)
instance SchemaType CommodityEuropeanExercise where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityEuropeanExercise a0)
`apply` many (parseSchemaType "expirationDate")
`apply` optional (parseSchemaType "exerciseFrequency")
`apply` optional (parseSchemaType "expirationTime")
schemaTypeToXML s x@CommodityEuropeanExercise{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodEuropExerc_ID x
]
[ concatMap (schemaTypeToXML "expirationDate") $ commodEuropExerc_expirationDate x
, maybe [] (schemaTypeToXML "exerciseFrequency") $ commodEuropExerc_exerciseFrequency x
, maybe [] (schemaTypeToXML "expirationTime") $ commodEuropExerc_expirationTime x
]
instance Extension CommodityEuropeanExercise Exercise where
supertype v = Exercise_CommodityEuropeanExercise v
data CommodityExercise = CommodityExercise
{ commodExerc_choice0 :: (Maybe (OneOf2 CommodityAmericanExercise CommodityEuropeanExercise))
, commodExerc_automaticExercise :: Maybe Xsd.Boolean
, commodExerc_writtenConfirmation :: Maybe Xsd.Boolean
, commodExerc_settlementCurrency :: Maybe IdentifiedCurrency
, commodExerc_fx :: Maybe CommodityFx
, commodExerc_conversionFactor :: Maybe Xsd.Decimal
, commodExerc_choice6 :: OneOf2 CommodityRelativePaymentDates ((Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean)))
}
deriving (Eq,Show)
instance SchemaType CommodityExercise where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CommodityExercise
`apply` optional (oneOf' [ ("CommodityAmericanExercise", fmap OneOf2 (parseSchemaType "americanExercise"))
, ("CommodityEuropeanExercise", fmap TwoOf2 (parseSchemaType "europeanExercise"))
])
`apply` optional (parseSchemaType "automaticExercise")
`apply` optional (parseSchemaType "writtenConfirmation")
`apply` optional (parseSchemaType "settlementCurrency")
`apply` optional (parseSchemaType "fx")
`apply` optional (parseSchemaType "conversionFactor")
`apply` oneOf' [ ("CommodityRelativePaymentDates", fmap OneOf2 (parseSchemaType "relativePaymentDates"))
, ("(Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean))", fmap TwoOf2 (optional (oneOf' [ ("AdjustableDatesOrRelativeDateOffset", fmap OneOf2 (parseSchemaType "paymentDates"))
, ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "masterAgreementPaymentDates"))
])))
]
schemaTypeToXML s x@CommodityExercise{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "americanExercise")
(schemaTypeToXML "europeanExercise")
) $ commodExerc_choice0 x
, maybe [] (schemaTypeToXML "automaticExercise") $ commodExerc_automaticExercise x
, maybe [] (schemaTypeToXML "writtenConfirmation") $ commodExerc_writtenConfirmation x
, maybe [] (schemaTypeToXML "settlementCurrency") $ commodExerc_settlementCurrency x
, maybe [] (schemaTypeToXML "fx") $ commodExerc_fx x
, maybe [] (schemaTypeToXML "conversionFactor") $ commodExerc_conversionFactor x
, foldOneOf2 (schemaTypeToXML "relativePaymentDates")
(maybe [] (foldOneOf2 (schemaTypeToXML "paymentDates")
(schemaTypeToXML "masterAgreementPaymentDates")
))
$ commodExerc_choice6 x
]
data CommodityExercisePeriods = CommodityExercisePeriods
{ commodExercPeriods_commencementDate :: Maybe AdjustableOrRelativeDate
, commodExercPeriods_expirationDate :: Maybe AdjustableOrRelativeDate
}
deriving (Eq,Show)
instance SchemaType CommodityExercisePeriods where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CommodityExercisePeriods
`apply` optional (parseSchemaType "commencementDate")
`apply` optional (parseSchemaType "expirationDate")
schemaTypeToXML s x@CommodityExercisePeriods{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "commencementDate") $ commodExercPeriods_commencementDate x
, maybe [] (schemaTypeToXML "expirationDate") $ commodExercPeriods_expirationDate x
]
data CommodityExpireRelativeToEvent = CommodityExpireRelativeToEvent Scheme CommodityExpireRelativeToEventAttributes deriving (Eq,Show)
data CommodityExpireRelativeToEventAttributes = CommodityExpireRelativeToEventAttributes
{ certea_commodityExpireRelativeToEventScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CommodityExpireRelativeToEvent where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "commodityExpireRelativeToEventScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CommodityExpireRelativeToEvent v (CommodityExpireRelativeToEventAttributes a0)
schemaTypeToXML s (CommodityExpireRelativeToEvent bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "commodityExpireRelativeToEventScheme") $ certea_commodityExpireRelativeToEventScheme at
]
$ schemaTypeToXML s bt
instance Extension CommodityExpireRelativeToEvent Scheme where
supertype (CommodityExpireRelativeToEvent s _) = s
data CommodityForward = CommodityForward
{ commodForward_ID :: Maybe Xsd.ID
, commodForward_primaryAssetClass :: Maybe AssetClass
, commodForward_secondaryAssetClass :: [AssetClass]
, commodForward_productType :: [ProductType]
, commodForward_productId :: [ProductId]
, commodForward_valueDate :: Maybe AdjustableOrRelativeDate
, commodForward_fixedLeg :: Maybe NonPeriodicFixedPriceLeg
, commodityForward_leg :: Maybe CommodityForwardLeg
, commodForward_commonPricing :: Maybe Xsd.Boolean
, commodForward_marketDisruption :: Maybe CommodityMarketDisruption
, commodForward_settlementDisruption :: Maybe CommodityBullionSettlementDisruptionEnum
, commodForward_rounding :: Maybe Rounding
}
deriving (Eq,Show)
instance SchemaType CommodityForward where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityForward a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` optional (parseSchemaType "valueDate")
`apply` optional (parseSchemaType "fixedLeg")
`apply` optional (elementCommodityForwardLeg)
`apply` optional (parseSchemaType "commonPricing")
`apply` optional (parseSchemaType "marketDisruption")
`apply` optional (parseSchemaType "settlementDisruption")
`apply` optional (parseSchemaType "rounding")
schemaTypeToXML s x@CommodityForward{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodForward_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ commodForward_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ commodForward_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ commodForward_productType x
, concatMap (schemaTypeToXML "productId") $ commodForward_productId x
, maybe [] (schemaTypeToXML "valueDate") $ commodForward_valueDate x
, maybe [] (schemaTypeToXML "fixedLeg") $ commodForward_fixedLeg x
, maybe [] (elementToXMLCommodityForwardLeg) $ commodityForward_leg x
, maybe [] (schemaTypeToXML "commonPricing") $ commodForward_commonPricing x
, maybe [] (schemaTypeToXML "marketDisruption") $ commodForward_marketDisruption x
, maybe [] (schemaTypeToXML "settlementDisruption") $ commodForward_settlementDisruption x
, maybe [] (schemaTypeToXML "rounding") $ commodForward_rounding x
]
instance Extension CommodityForward Product where
supertype v = Product_CommodityForward v
data CommodityFixedPriceSchedule = CommodityFixedPriceSchedule
{ commodFixedPriceSched_choice0 :: (Maybe (OneOf4 [FixedPrice] [Xsd.Decimal] [NonNegativeMoney] [CommoditySettlementPeriodsPriceSchedule]))
, commodFixedPriceSched_choice1 :: (Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))
}
deriving (Eq,Show)
instance SchemaType CommodityFixedPriceSchedule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CommodityFixedPriceSchedule
`apply` optional (oneOf' [ ("[FixedPrice]", fmap OneOf4 (many1 (parseSchemaType "fixedPriceStep")))
, ("[Xsd.Decimal]", fmap TwoOf4 (many1 (parseSchemaType "worldscaleRateStep")))
, ("[NonNegativeMoney]", fmap ThreeOf4 (many1 (parseSchemaType "contractRateStep")))
, ("[CommoditySettlementPeriodsPriceSchedule]", fmap FourOf4 (many1 (parseSchemaType "settlementPeriodsPriceSchedule")))
])
`apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))
, ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))
])
schemaTypeToXML s x@CommodityFixedPriceSchedule{} =
toXMLElement s []
[ maybe [] (foldOneOf4 (concatMap (schemaTypeToXML "fixedPriceStep"))
(concatMap (schemaTypeToXML "worldscaleRateStep"))
(concatMap (schemaTypeToXML "contractRateStep"))
(concatMap (schemaTypeToXML "settlementPeriodsPriceSchedule"))
) $ commodFixedPriceSched_choice0 x
, maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")
(schemaTypeToXML "calculationPeriodsScheduleReference")
(schemaTypeToXML "calculationPeriodsDatesReference")
) $ commodFixedPriceSched_choice1 x
]
data CommodityForwardLeg
= CommodityForwardLeg_PhysicalForwardLeg PhysicalForwardLeg
deriving (Eq,Show)
instance SchemaType CommodityForwardLeg where
parseSchemaType s = do
(fmap CommodityForwardLeg_PhysicalForwardLeg $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of CommodityForwardLeg,\n\
\ namely one of:\n\
\PhysicalForwardLeg"
schemaTypeToXML _s (CommodityForwardLeg_PhysicalForwardLeg x) = schemaTypeToXML "physicalForwardLeg" x
instance Extension CommodityForwardLeg Leg where
supertype v = Leg_CommodityForwardLeg v
data CommodityFrequencyType = CommodityFrequencyType Scheme CommodityFrequencyTypeAttributes deriving (Eq,Show)
data CommodityFrequencyTypeAttributes = CommodityFrequencyTypeAttributes
{ commodFrequTypeAttrib_commodityFrequencyTypeScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CommodityFrequencyType where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "commodityFrequencyTypeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CommodityFrequencyType v (CommodityFrequencyTypeAttributes a0)
schemaTypeToXML s (CommodityFrequencyType bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "commodityFrequencyTypeScheme") $ commodFrequTypeAttrib_commodityFrequencyTypeScheme at
]
$ schemaTypeToXML s bt
instance Extension CommodityFrequencyType Scheme where
supertype (CommodityFrequencyType s _) = s
data CommodityFx = CommodityFx
{ commodityFx_primaryRateSource :: Maybe InformationSource
, commodityFx_secondaryRateSource :: Maybe InformationSource
, commodityFx_fxType :: Maybe CommodityFxType
, commodityFx_averagingMethod :: Maybe AveragingMethodEnum
, commodityFx_choice4 :: OneOf2 [AdjustableDates] ((Maybe (CommodityDayTypeEnum)),((Maybe (OneOf2 ((Maybe (CommodityFrequencyType)),(Maybe (Xsd.PositiveInteger))) ([DayOfWeekEnum],(Maybe (Xsd.Integer)))))),((Maybe (OneOf2 Lag LagReference))),((Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))))
, commodityFx_fixingTime :: Maybe BusinessCenterTime
}
deriving (Eq,Show)
instance SchemaType CommodityFx where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CommodityFx
`apply` optional (parseSchemaType "primaryRateSource")
`apply` optional (parseSchemaType "secondaryRateSource")
`apply` optional (parseSchemaType "fxType")
`apply` optional (parseSchemaType "averagingMethod")
`apply` oneOf' [ ("[AdjustableDates]", fmap OneOf2 (many1 (parseSchemaType "fxObservationDates")))
, ("Maybe CommodityDayTypeEnum (Maybe (OneOf2 ((Maybe (CommodityFrequencyType)),(Maybe (Xsd.PositiveInteger))) ([DayOfWeekEnum],(Maybe (Xsd.Integer))))) (Maybe (OneOf2 Lag LagReference)) (Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))", fmap TwoOf2 (return (,,,) `apply` optional (parseSchemaType "dayType")
`apply` optional (oneOf' [ ("Maybe CommodityFrequencyType Maybe Xsd.PositiveInteger", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "dayDistribution")
`apply` optional (parseSchemaType "dayCount")))
, ("[DayOfWeekEnum] Maybe Xsd.Integer", fmap TwoOf2 (return (,) `apply` between (Occurs (Just 0) (Just 7))
(parseSchemaType "dayOfWeek")
`apply` optional (parseSchemaType "dayNumber")))
])
`apply` optional (oneOf' [ ("Lag", fmap OneOf2 (parseSchemaType "lag"))
, ("LagReference", fmap TwoOf2 (parseSchemaType "lagReference"))
])
`apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))
, ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))
])))
]
`apply` optional (parseSchemaType "fixingTime")
schemaTypeToXML s x@CommodityFx{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "primaryRateSource") $ commodityFx_primaryRateSource x
, maybe [] (schemaTypeToXML "secondaryRateSource") $ commodityFx_secondaryRateSource x
, maybe [] (schemaTypeToXML "fxType") $ commodityFx_fxType x
, maybe [] (schemaTypeToXML "averagingMethod") $ commodityFx_averagingMethod x
, foldOneOf2 (concatMap (schemaTypeToXML "fxObservationDates"))
(\ (a,b,c,d) -> concat [ maybe [] (schemaTypeToXML "dayType") a
, maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "dayDistribution") a
, maybe [] (schemaTypeToXML "dayCount") b
])
(\ (a,b) -> concat [ concatMap (schemaTypeToXML "dayOfWeek") a
, maybe [] (schemaTypeToXML "dayNumber") b
])
) b
, maybe [] (foldOneOf2 (schemaTypeToXML "lag")
(schemaTypeToXML "lagReference")
) c
, maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")
(schemaTypeToXML "calculationPeriodsScheduleReference")
(schemaTypeToXML "calculationPeriodsDatesReference")
) d
])
$ commodityFx_choice4 x
, maybe [] (schemaTypeToXML "fixingTime") $ commodityFx_fixingTime x
]
data CommodityFxType = CommodityFxType Scheme CommodityFxTypeAttributes deriving (Eq,Show)
data CommodityFxTypeAttributes = CommodityFxTypeAttributes
{ commodFxTypeAttrib_commodityFxTypeScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CommodityFxType where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "commodityFxTypeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CommodityFxType v (CommodityFxTypeAttributes a0)
schemaTypeToXML s (CommodityFxType bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "commodityFxTypeScheme") $ commodFxTypeAttrib_commodityFxTypeScheme at
]
$ schemaTypeToXML s bt
instance Extension CommodityFxType Scheme where
supertype (CommodityFxType s _) = s
data CommodityHub = CommodityHub
{ commodityHub_partyReference :: PartyReference
, commodityHub_accountReference :: Maybe AccountReference
, commodityHub_hubCode :: Maybe CommodityHubCode
}
deriving (Eq,Show)
instance SchemaType CommodityHub where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CommodityHub
`apply` parseSchemaType "partyReference"
`apply` optional (parseSchemaType "accountReference")
`apply` optional (parseSchemaType "hubCode")
schemaTypeToXML s x@CommodityHub{} =
toXMLElement s []
[ schemaTypeToXML "partyReference" $ commodityHub_partyReference x
, maybe [] (schemaTypeToXML "accountReference") $ commodityHub_accountReference x
, maybe [] (schemaTypeToXML "hubCode") $ commodityHub_hubCode x
]
data CommodityHubCode = CommodityHubCode Scheme CommodityHubCodeAttributes deriving (Eq,Show)
data CommodityHubCodeAttributes = CommodityHubCodeAttributes
{ commodHubCodeAttrib_hubCodeScheme :: Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CommodityHubCode where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- getAttribute "hubCodeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CommodityHubCode v (CommodityHubCodeAttributes a0)
schemaTypeToXML s (CommodityHubCode bt at) =
addXMLAttributes [ toXMLAttribute "hubCodeScheme" $ commodHubCodeAttrib_hubCodeScheme at
]
$ schemaTypeToXML s bt
instance Extension CommodityHubCode Scheme where
supertype (CommodityHubCode s _) = s
data CommodityMarketDisruption = CommodityMarketDisruption
{ commodMarketDisrup_choice0 :: (Maybe (OneOf2 ((Maybe (MarketDisruptionEventsEnum)),[MarketDisruptionEvent]) [MarketDisruptionEvent]))
, commodMarketDisrup_choice1 :: (Maybe (OneOf2 DisruptionFallbacksEnum [SequencedDisruptionFallback]))
, commodMarketDisrup_fallbackReferencePrice :: Maybe Underlyer
, commodMarketDisrup_maximumNumberOfDaysOfDisruption :: Maybe Xsd.NonNegativeInteger
, commodMarketDisrup_priceMaterialityPercentage :: Maybe Xsd.Decimal
, commodMarketDisrup_minimumFuturesContracts :: Maybe Xsd.PositiveInteger
}
deriving (Eq,Show)
instance SchemaType CommodityMarketDisruption where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CommodityMarketDisruption
`apply` optional (oneOf' [ ("Maybe MarketDisruptionEventsEnum [MarketDisruptionEvent]", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "marketDisruptionEvents")
`apply` many (parseSchemaType "additionalMarketDisruptionEvent")))
, ("[MarketDisruptionEvent]", fmap TwoOf2 (many1 (parseSchemaType "marketDisruptionEvent")))
])
`apply` optional (oneOf' [ ("DisruptionFallbacksEnum", fmap OneOf2 (parseSchemaType "disruptionFallbacks"))
, ("[SequencedDisruptionFallback]", fmap TwoOf2 (many1 (parseSchemaType "disruptionFallback")))
])
`apply` optional (parseSchemaType "fallbackReferencePrice")
`apply` optional (parseSchemaType "maximumNumberOfDaysOfDisruption")
`apply` optional (parseSchemaType "priceMaterialityPercentage")
`apply` optional (parseSchemaType "minimumFuturesContracts")
schemaTypeToXML s x@CommodityMarketDisruption{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "marketDisruptionEvents") a
, concatMap (schemaTypeToXML "additionalMarketDisruptionEvent") b
])
(concatMap (schemaTypeToXML "marketDisruptionEvent"))
) $ commodMarketDisrup_choice0 x
, maybe [] (foldOneOf2 (schemaTypeToXML "disruptionFallbacks")
(concatMap (schemaTypeToXML "disruptionFallback"))
) $ commodMarketDisrup_choice1 x
, maybe [] (schemaTypeToXML "fallbackReferencePrice") $ commodMarketDisrup_fallbackReferencePrice x
, maybe [] (schemaTypeToXML "maximumNumberOfDaysOfDisruption") $ commodMarketDisrup_maximumNumberOfDaysOfDisruption x
, maybe [] (schemaTypeToXML "priceMaterialityPercentage") $ commodMarketDisrup_priceMaterialityPercentage x
, maybe [] (schemaTypeToXML "minimumFuturesContracts") $ commodMarketDisrup_minimumFuturesContracts x
]
data CommodityMultipleExercise = CommodityMultipleExercise
{ commodMultiExerc_integralMultipleQuantity :: Maybe CommodityNotionalQuantity
, commodMultiExerc_minimumNotionalQuantity :: Maybe CommodityNotionalQuantity
}
deriving (Eq,Show)
instance SchemaType CommodityMultipleExercise where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CommodityMultipleExercise
`apply` optional (parseSchemaType "integralMultipleQuantity")
`apply` optional (parseSchemaType "minimumNotionalQuantity")
schemaTypeToXML s x@CommodityMultipleExercise{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "integralMultipleQuantity") $ commodMultiExerc_integralMultipleQuantity x
, maybe [] (schemaTypeToXML "minimumNotionalQuantity") $ commodMultiExerc_minimumNotionalQuantity x
]
data CommodityNotionalQuantity = CommodityNotionalQuantity
{ commodNotionQuant_ID :: Maybe Xsd.ID
, commodNotionQuant_quantityUnit :: QuantityUnit
, commodNotionQuant_quantityFrequency :: Maybe CommodityQuantityFrequency
, commodNotionQuant_quantity :: Maybe Xsd.Decimal
}
deriving (Eq,Show)
instance SchemaType CommodityNotionalQuantity where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityNotionalQuantity a0)
`apply` parseSchemaType "quantityUnit"
`apply` optional (parseSchemaType "quantityFrequency")
`apply` optional (parseSchemaType "quantity")
schemaTypeToXML s x@CommodityNotionalQuantity{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodNotionQuant_ID x
]
[ schemaTypeToXML "quantityUnit" $ commodNotionQuant_quantityUnit x
, maybe [] (schemaTypeToXML "quantityFrequency") $ commodNotionQuant_quantityFrequency x
, maybe [] (schemaTypeToXML "quantity") $ commodNotionQuant_quantity x
]
data CommodityNotionalQuantitySchedule = CommodityNotionalQuantitySchedule
{ commodNotionQuantSched_ID :: Maybe Xsd.ID
, commodNotionQuantSched_choice0 :: (Maybe (OneOf2 [CommodityNotionalQuantity] [CommoditySettlementPeriodsNotionalQuantitySchedule]))
, commodNotionQuantSched_choice1 :: (Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))
}
deriving (Eq,Show)
instance SchemaType CommodityNotionalQuantitySchedule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityNotionalQuantitySchedule a0)
`apply` optional (oneOf' [ ("[CommodityNotionalQuantity]", fmap OneOf2 (many1 (parseSchemaType "notionalStep")))
, ("[CommoditySettlementPeriodsNotionalQuantitySchedule]", fmap TwoOf2 (many1 (parseSchemaType "settlementPeriodsNotionalQuantitySchedule")))
])
`apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))
, ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))
])
schemaTypeToXML s x@CommodityNotionalQuantitySchedule{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodNotionQuantSched_ID x
]
[ maybe [] (foldOneOf2 (concatMap (schemaTypeToXML "notionalStep"))
(concatMap (schemaTypeToXML "settlementPeriodsNotionalQuantitySchedule"))
) $ commodNotionQuantSched_choice0 x
, maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")
(schemaTypeToXML "calculationPeriodsScheduleReference")
(schemaTypeToXML "calculationPeriodsDatesReference")
) $ commodNotionQuantSched_choice1 x
]
data CommodityOption = CommodityOption
{ commodOption_ID :: Maybe Xsd.ID
, commodOption_primaryAssetClass :: Maybe AssetClass
, commodOption_secondaryAssetClass :: [AssetClass]
, commodOption_productType :: [ProductType]
, commodOption_productId :: [ProductId]
, commodOption_buyerPartyReference :: Maybe PartyReference
, commodOption_buyerAccountReference :: Maybe AccountReference
, commodOption_sellerPartyReference :: Maybe PartyReference
, commodOption_sellerAccountReference :: Maybe AccountReference
, commodOption_optionType :: Maybe PutCallEnum
, commodOption_choice9 :: OneOf2 ((Maybe (Commodity)),(Maybe (AdjustableOrRelativeDate)),((Maybe (OneOf2 CommodityCalculationPeriodsSchedule AdjustableDates))),(Maybe (CommodityPricingDates)),(Maybe (AveragingMethodEnum)),(OneOf2 ((OneOf3 CommodityNotionalQuantitySchedule CommodityNotionalQuantity [CommoditySettlementPeriodsNotionalQuantity]),Xsd.Decimal) QuantityReference),(Maybe (CommodityExercise)),(OneOf2 NonNegativeMoney CommodityStrikeSchedule)) (((Maybe (OneOf2 CommoditySwap CommodityForward))),(Maybe (CommodityPhysicalExercise)))
, commodOption_premium :: [CommodityPremium]
, commodOption_commonPricing :: Maybe Xsd.Boolean
, commodOption_marketDisruption :: Maybe CommodityMarketDisruption
, commodOption_settlementDisruption :: Maybe CommodityBullionSettlementDisruptionEnum
, commodOption_rounding :: Maybe Rounding
}
deriving (Eq,Show)
instance SchemaType CommodityOption where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityOption a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` optional (parseSchemaType "buyerPartyReference")
`apply` optional (parseSchemaType "buyerAccountReference")
`apply` optional (parseSchemaType "sellerPartyReference")
`apply` optional (parseSchemaType "sellerAccountReference")
`apply` optional (parseSchemaType "optionType")
`apply` oneOf' [ ("Maybe Commodity Maybe AdjustableOrRelativeDate (Maybe (OneOf2 CommodityCalculationPeriodsSchedule AdjustableDates)) Maybe CommodityPricingDates Maybe AveragingMethodEnum OneOf2 ((OneOf3 CommodityNotionalQuantitySchedule CommodityNotionalQuantity [CommoditySettlementPeriodsNotionalQuantity]),Xsd.Decimal) QuantityReference Maybe CommodityExercise OneOf2 NonNegativeMoney CommodityStrikeSchedule", fmap OneOf2 (return (,,,,,,,) `apply` optional (parseSchemaType "commodity")
`apply` optional (parseSchemaType "effectiveDate")
`apply` optional (oneOf' [ ("CommodityCalculationPeriodsSchedule", fmap OneOf2 (parseSchemaType "calculationPeriodsSchedule"))
, ("AdjustableDates", fmap TwoOf2 (parseSchemaType "calculationPeriods"))
])
`apply` optional (parseSchemaType "pricingDates")
`apply` optional (parseSchemaType "averagingMethod")
`apply` oneOf' [ ("OneOf3 CommodityNotionalQuantitySchedule CommodityNotionalQuantity [CommoditySettlementPeriodsNotionalQuantity] Xsd.Decimal", fmap OneOf2 (return (,) `apply` oneOf' [ ("CommodityNotionalQuantitySchedule", fmap OneOf3 (parseSchemaType "notionalQuantitySchedule"))
, ("CommodityNotionalQuantity", fmap TwoOf3 (parseSchemaType "notionalQuantity"))
, ("[CommoditySettlementPeriodsNotionalQuantity]", fmap ThreeOf3 (many1 (parseSchemaType "settlementPeriodsNotionalQuantity")))
]
`apply` parseSchemaType "totalNotionalQuantity"))
, ("QuantityReference", fmap TwoOf2 (parseSchemaType "quantityReference"))
]
`apply` optional (parseSchemaType "exercise")
`apply` oneOf' [ ("NonNegativeMoney", fmap OneOf2 (parseSchemaType "strikePricePerUnit"))
, ("CommodityStrikeSchedule", fmap TwoOf2 (parseSchemaType "strikePricePerUnitSchedule"))
]))
, ("(Maybe (OneOf2 CommoditySwap CommodityForward)) Maybe CommodityPhysicalExercise", fmap TwoOf2 (return (,) `apply` optional (oneOf' [ ("CommoditySwap", fmap OneOf2 (elementCommoditySwap))
, ("CommodityForward", fmap TwoOf2 (elementCommodityForward))
])
`apply` optional (parseSchemaType "physicalExercise")))
]
`apply` many (parseSchemaType "premium")
`apply` optional (parseSchemaType "commonPricing")
`apply` optional (parseSchemaType "marketDisruption")
`apply` optional (parseSchemaType "settlementDisruption")
`apply` optional (parseSchemaType "rounding")
schemaTypeToXML s x@CommodityOption{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodOption_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ commodOption_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ commodOption_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ commodOption_productType x
, concatMap (schemaTypeToXML "productId") $ commodOption_productId x
, maybe [] (schemaTypeToXML "buyerPartyReference") $ commodOption_buyerPartyReference x
, maybe [] (schemaTypeToXML "buyerAccountReference") $ commodOption_buyerAccountReference x
, maybe [] (schemaTypeToXML "sellerPartyReference") $ commodOption_sellerPartyReference x
, maybe [] (schemaTypeToXML "sellerAccountReference") $ commodOption_sellerAccountReference x
, maybe [] (schemaTypeToXML "optionType") $ commodOption_optionType x
, foldOneOf2 (\ (a,b,c,d,e,f,g,h) -> concat [ maybe [] (schemaTypeToXML "commodity") a
, maybe [] (schemaTypeToXML "effectiveDate") b
, maybe [] (foldOneOf2 (schemaTypeToXML "calculationPeriodsSchedule")
(schemaTypeToXML "calculationPeriods")
) c
, maybe [] (schemaTypeToXML "pricingDates") d
, maybe [] (schemaTypeToXML "averagingMethod") e
, foldOneOf2 (\ (a,b) -> concat [ foldOneOf3 (schemaTypeToXML "notionalQuantitySchedule")
(schemaTypeToXML "notionalQuantity")
(concatMap (schemaTypeToXML "settlementPeriodsNotionalQuantity"))
a
, schemaTypeToXML "totalNotionalQuantity" b
])
(schemaTypeToXML "quantityReference")
f
, maybe [] (schemaTypeToXML "exercise") g
, foldOneOf2 (schemaTypeToXML "strikePricePerUnit")
(schemaTypeToXML "strikePricePerUnitSchedule")
h
])
(\ (a,b) -> concat [ maybe [] (foldOneOf2 (elementToXMLCommoditySwap)
(elementToXMLCommodityForward)
) a
, maybe [] (schemaTypeToXML "physicalExercise") b
])
$ commodOption_choice9 x
, concatMap (schemaTypeToXML "premium") $ commodOption_premium x
, maybe [] (schemaTypeToXML "commonPricing") $ commodOption_commonPricing x
, maybe [] (schemaTypeToXML "marketDisruption") $ commodOption_marketDisruption x
, maybe [] (schemaTypeToXML "settlementDisruption") $ commodOption_settlementDisruption x
, maybe [] (schemaTypeToXML "rounding") $ commodOption_rounding x
]
instance Extension CommodityOption Product where
supertype v = Product_CommodityOption v
data CommodityPayRelativeToEvent = CommodityPayRelativeToEvent Scheme CommodityPayRelativeToEventAttributes deriving (Eq,Show)
data CommodityPayRelativeToEventAttributes = CommodityPayRelativeToEventAttributes
{ cprtea_commodityPayRelativeToEventScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CommodityPayRelativeToEvent where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "commodityPayRelativeToEventScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CommodityPayRelativeToEvent v (CommodityPayRelativeToEventAttributes a0)
schemaTypeToXML s (CommodityPayRelativeToEvent bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "commodityPayRelativeToEventScheme") $ cprtea_commodityPayRelativeToEventScheme at
]
$ schemaTypeToXML s bt
instance Extension CommodityPayRelativeToEvent Scheme where
supertype (CommodityPayRelativeToEvent s _) = s
data CommodityPhysicalAmericanExercise = CommodityPhysicalAmericanExercise
{ commodPhysicAmericExerc_ID :: Maybe Xsd.ID
, commodPhysicAmericExerc_choice0 :: (Maybe (OneOf2 ((Maybe (AdjustableOrRelativeDates)),(Maybe (AdjustableOrRelativeDates))) ((Maybe (CommodityRelativeExpirationDates)),(Maybe (CommodityRelativeExpirationDates)))))
, commodPhysicAmericExerc_latestExerciseTime :: Maybe PrevailingTime
, commodPhysicAmericExerc_expirationTime :: Maybe PrevailingTime
}
deriving (Eq,Show)
instance SchemaType CommodityPhysicalAmericanExercise where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityPhysicalAmericanExercise a0)
`apply` optional (oneOf' [ ("Maybe AdjustableOrRelativeDates Maybe AdjustableOrRelativeDates", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "commencementDates")
`apply` optional (parseSchemaType "expirationDates")))
, ("Maybe CommodityRelativeExpirationDates Maybe CommodityRelativeExpirationDates", fmap TwoOf2 (return (,) `apply` optional (parseSchemaType "relativeCommencementDates")
`apply` optional (parseSchemaType "relativeExpirationDates")))
])
`apply` optional (parseSchemaType "latestExerciseTime")
`apply` optional (parseSchemaType "expirationTime")
schemaTypeToXML s x@CommodityPhysicalAmericanExercise{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodPhysicAmericExerc_ID x
]
[ maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "commencementDates") a
, maybe [] (schemaTypeToXML "expirationDates") b
])
(\ (a,b) -> concat [ maybe [] (schemaTypeToXML "relativeCommencementDates") a
, maybe [] (schemaTypeToXML "relativeExpirationDates") b
])
) $ commodPhysicAmericExerc_choice0 x
, maybe [] (schemaTypeToXML "latestExerciseTime") $ commodPhysicAmericExerc_latestExerciseTime x
, maybe [] (schemaTypeToXML "expirationTime") $ commodPhysicAmericExerc_expirationTime x
]
instance Extension CommodityPhysicalAmericanExercise Exercise where
supertype v = Exercise_CommodityPhysicalAmericanExercise v
data CommodityPhysicalEuropeanExercise = CommodityPhysicalEuropeanExercise
{ commodPhysicEuropExerc_ID :: Maybe Xsd.ID
, commodPhysicEuropExerc_choice0 :: (Maybe (OneOf3 AdjustableOrRelativeDate AdjustableRelativeOrPeriodicDates2 CommodityRelativeExpirationDates))
, commodPhysicEuropExerc_expirationTime :: Maybe PrevailingTime
}
deriving (Eq,Show)
instance SchemaType CommodityPhysicalEuropeanExercise where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityPhysicalEuropeanExercise a0)
`apply` optional (oneOf' [ ("AdjustableOrRelativeDate", fmap OneOf3 (parseSchemaType "expirationDate"))
, ("AdjustableRelativeOrPeriodicDates2", fmap TwoOf3 (parseSchemaType "expirationDates"))
, ("CommodityRelativeExpirationDates", fmap ThreeOf3 (parseSchemaType "relativeExpirationDates"))
])
`apply` optional (parseSchemaType "expirationTime")
schemaTypeToXML s x@CommodityPhysicalEuropeanExercise{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodPhysicEuropExerc_ID x
]
[ maybe [] (foldOneOf3 (schemaTypeToXML "expirationDate")
(schemaTypeToXML "expirationDates")
(schemaTypeToXML "relativeExpirationDates")
) $ commodPhysicEuropExerc_choice0 x
, maybe [] (schemaTypeToXML "expirationTime") $ commodPhysicEuropExerc_expirationTime x
]
instance Extension CommodityPhysicalEuropeanExercise Exercise where
supertype v = Exercise_CommodityPhysicalEuropeanExercise v
data CommodityPhysicalExercise = CommodityPhysicalExercise
{ commodPhysicExerc_choice0 :: (Maybe (OneOf2 CommodityPhysicalAmericanExercise CommodityPhysicalEuropeanExercise))
, commodPhysicExerc_automaticExercise :: Maybe Xsd.Boolean
, commodPhysicExerc_writtenConfirmation :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType CommodityPhysicalExercise where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CommodityPhysicalExercise
`apply` optional (oneOf' [ ("CommodityPhysicalAmericanExercise", fmap OneOf2 (parseSchemaType "americanExercise"))
, ("CommodityPhysicalEuropeanExercise", fmap TwoOf2 (parseSchemaType "europeanExercise"))
])
`apply` optional (parseSchemaType "automaticExercise")
`apply` optional (parseSchemaType "writtenConfirmation")
schemaTypeToXML s x@CommodityPhysicalExercise{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "americanExercise")
(schemaTypeToXML "europeanExercise")
) $ commodPhysicExerc_choice0 x
, maybe [] (schemaTypeToXML "automaticExercise") $ commodPhysicExerc_automaticExercise x
, maybe [] (schemaTypeToXML "writtenConfirmation") $ commodPhysicExerc_writtenConfirmation x
]
data CommodityPhysicalQuantity = CommodityPhysicalQuantity
{ commodPhysicQuant_ID :: Maybe Xsd.ID
, commodPhysicQuant_choice0 :: (Maybe (OneOf2 CommodityNotionalQuantity CommodityPhysicalQuantitySchedule))
, commodPhysicQuant_totalPhysicalQuantity :: UnitQuantity
}
deriving (Eq,Show)
instance SchemaType CommodityPhysicalQuantity where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityPhysicalQuantity a0)
`apply` optional (oneOf' [ ("CommodityNotionalQuantity", fmap OneOf2 (parseSchemaType "physicalQuantity"))
, ("CommodityPhysicalQuantitySchedule", fmap TwoOf2 (parseSchemaType "physicalQuantitySchedule"))
])
`apply` parseSchemaType "totalPhysicalQuantity"
schemaTypeToXML s x@CommodityPhysicalQuantity{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodPhysicQuant_ID x
]
[ maybe [] (foldOneOf2 (schemaTypeToXML "physicalQuantity")
(schemaTypeToXML "physicalQuantitySchedule")
) $ commodPhysicQuant_choice0 x
, schemaTypeToXML "totalPhysicalQuantity" $ commodPhysicQuant_totalPhysicalQuantity x
]
instance Extension CommodityPhysicalQuantity CommodityPhysicalQuantityBase where
supertype v = CommodityPhysicalQuantityBase_CommodityPhysicalQuantity v
data CommodityPhysicalQuantityBase
= CommodityPhysicalQuantityBase_GasPhysicalQuantity GasPhysicalQuantity
| CommodityPhysicalQuantityBase_ElectricityPhysicalQuantity ElectricityPhysicalQuantity
| CommodityPhysicalQuantityBase_CommodityPhysicalQuantity CommodityPhysicalQuantity
deriving (Eq,Show)
instance SchemaType CommodityPhysicalQuantityBase where
parseSchemaType s = do
(fmap CommodityPhysicalQuantityBase_GasPhysicalQuantity $ parseSchemaType s)
`onFail`
(fmap CommodityPhysicalQuantityBase_ElectricityPhysicalQuantity $ parseSchemaType s)
`onFail`
(fmap CommodityPhysicalQuantityBase_CommodityPhysicalQuantity $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of CommodityPhysicalQuantityBase,\n\
\ namely one of:\n\
\GasPhysicalQuantity,ElectricityPhysicalQuantity,CommodityPhysicalQuantity"
schemaTypeToXML _s (CommodityPhysicalQuantityBase_GasPhysicalQuantity x) = schemaTypeToXML "gasPhysicalQuantity" x
schemaTypeToXML _s (CommodityPhysicalQuantityBase_ElectricityPhysicalQuantity x) = schemaTypeToXML "electricityPhysicalQuantity" x
schemaTypeToXML _s (CommodityPhysicalQuantityBase_CommodityPhysicalQuantity x) = schemaTypeToXML "commodityPhysicalQuantity" x
data CommodityPhysicalQuantitySchedule = CommodityPhysicalQuantitySchedule
{ commodPhysicQuantSched_ID :: Maybe Xsd.ID
, commodPhysicQuantSched_quantityStep :: [CommodityNotionalQuantity]
, commodPhysicQuantSched_choice1 :: (Maybe (OneOf2 CalculationPeriodsReference CalculationPeriodsScheduleReference))
}
deriving (Eq,Show)
instance SchemaType CommodityPhysicalQuantitySchedule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityPhysicalQuantitySchedule a0)
`apply` many (parseSchemaType "quantityStep")
`apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf2 (parseSchemaType "deliveryPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf2 (parseSchemaType "deliveryPeriodsScheduleReference"))
])
schemaTypeToXML s x@CommodityPhysicalQuantitySchedule{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodPhysicQuantSched_ID x
]
[ concatMap (schemaTypeToXML "quantityStep") $ commodPhysicQuantSched_quantityStep x
, maybe [] (foldOneOf2 (schemaTypeToXML "deliveryPeriodsReference")
(schemaTypeToXML "deliveryPeriodsScheduleReference")
) $ commodPhysicQuantSched_choice1 x
]
data CommodityPipeline = CommodityPipeline Scheme CommodityPipelineAttributes deriving (Eq,Show)
data CommodityPipelineAttributes = CommodityPipelineAttributes
{ commodPipelAttrib_pipelineScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CommodityPipeline where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "pipelineScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CommodityPipeline v (CommodityPipelineAttributes a0)
schemaTypeToXML s (CommodityPipeline bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "pipelineScheme") $ commodPipelAttrib_pipelineScheme at
]
$ schemaTypeToXML s bt
instance Extension CommodityPipeline Scheme where
supertype (CommodityPipeline s _) = s
data CommodityPipelineCycle = CommodityPipelineCycle Scheme CommodityPipelineCycleAttributes deriving (Eq,Show)
data CommodityPipelineCycleAttributes = CommodityPipelineCycleAttributes
{ commodPipelCycleAttrib_pipelineCycleScheme :: Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CommodityPipelineCycle where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- getAttribute "pipelineCycleScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CommodityPipelineCycle v (CommodityPipelineCycleAttributes a0)
schemaTypeToXML s (CommodityPipelineCycle bt at) =
addXMLAttributes [ toXMLAttribute "pipelineCycleScheme" $ commodPipelCycleAttrib_pipelineCycleScheme at
]
$ schemaTypeToXML s bt
instance Extension CommodityPipelineCycle Scheme where
supertype (CommodityPipelineCycle s _) = s
data CommodityPremium = CommodityPremium
{ commodPremium_ID :: Maybe Xsd.ID
, commodPremium_payerPartyReference :: Maybe PartyReference
, commodPremium_payerAccountReference :: Maybe AccountReference
, commodPremium_receiverPartyReference :: Maybe PartyReference
, commodPremium_receiverAccountReference :: Maybe AccountReference
, commodPremium_paymentDate :: Maybe AdjustableOrRelativeDate
, commodPremium_paymentAmount :: Maybe NonNegativeMoney
, commodPremium_premiumPerUnit :: NonNegativeMoney
}
deriving (Eq,Show)
instance SchemaType CommodityPremium where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityPremium a0)
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` optional (parseSchemaType "paymentDate")
`apply` optional (parseSchemaType "paymentAmount")
`apply` parseSchemaType "premiumPerUnit"
schemaTypeToXML s x@CommodityPremium{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodPremium_ID x
]
[ maybe [] (schemaTypeToXML "payerPartyReference") $ commodPremium_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ commodPremium_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ commodPremium_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ commodPremium_receiverAccountReference x
, maybe [] (schemaTypeToXML "paymentDate") $ commodPremium_paymentDate x
, maybe [] (schemaTypeToXML "paymentAmount") $ commodPremium_paymentAmount x
, schemaTypeToXML "premiumPerUnit" $ commodPremium_premiumPerUnit x
]
instance Extension CommodityPremium NonNegativePayment where
supertype (CommodityPremium a0 e0 e1 e2 e3 e4 e5 e6) =
NonNegativePayment a0 e0 e1 e2 e3 e4 e5
instance Extension CommodityPremium PaymentBaseExtended where
supertype = (supertype :: NonNegativePayment -> PaymentBaseExtended)
. (supertype :: CommodityPremium -> NonNegativePayment)
instance Extension CommodityPremium PaymentBase where
supertype = (supertype :: PaymentBaseExtended -> PaymentBase)
. (supertype :: NonNegativePayment -> PaymentBaseExtended)
. (supertype :: CommodityPremium -> NonNegativePayment)
data CommodityPricingDates = CommodityPricingDates
{ commodPricingDates_ID :: Maybe Xsd.ID
, commodPricingDates_choice0 :: (Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))
, commodPricingDates_choice1 :: OneOf2 ((Maybe (Lag)),(OneOf3 ((Maybe (CommodityDayTypeEnum)),((Maybe (OneOf2 ((Maybe (CommodityFrequencyType)),(Maybe (Xsd.PositiveInteger))) ([DayOfWeekEnum],(Maybe (Xsd.Integer)))))),(Maybe (CommodityBusinessCalendar))) [SettlementPeriods] [SettlementPeriodsReference])) [AdjustableDates]
}
deriving (Eq,Show)
instance SchemaType CommodityPricingDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityPricingDates a0)
`apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))
, ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))
])
`apply` oneOf' [ ("Maybe Lag OneOf3 ((Maybe (CommodityDayTypeEnum)),((Maybe (OneOf2 ((Maybe (CommodityFrequencyType)),(Maybe (Xsd.PositiveInteger))) ([DayOfWeekEnum],(Maybe (Xsd.Integer)))))),(Maybe (CommodityBusinessCalendar))) [SettlementPeriods] [SettlementPeriodsReference]", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "lag")
`apply` oneOf' [ ("Maybe CommodityDayTypeEnum (Maybe (OneOf2 ((Maybe (CommodityFrequencyType)),(Maybe (Xsd.PositiveInteger))) ([DayOfWeekEnum],(Maybe (Xsd.Integer))))) Maybe CommodityBusinessCalendar", fmap OneOf3 (return (,,) `apply` optional (parseSchemaType "dayType")
`apply` optional (oneOf' [ ("Maybe CommodityFrequencyType Maybe Xsd.PositiveInteger", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "dayDistribution")
`apply` optional (parseSchemaType "dayCount")))
, ("[DayOfWeekEnum] Maybe Xsd.Integer", fmap TwoOf2 (return (,) `apply` between (Occurs (Just 0) (Just 7))
(parseSchemaType "dayOfWeek")
`apply` optional (parseSchemaType "dayNumber")))
])
`apply` optional (parseSchemaType "businessCalendar")))
, ("[SettlementPeriods]", fmap TwoOf3 (many1 (parseSchemaType "settlementPeriods")))
, ("[SettlementPeriodsReference]", fmap ThreeOf3 (many1 (parseSchemaType "settlementPeriodsReference")))
]))
, ("[AdjustableDates]", fmap TwoOf2 (many1 (parseSchemaType "pricingDates")))
]
schemaTypeToXML s x@CommodityPricingDates{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodPricingDates_ID x
]
[ maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")
(schemaTypeToXML "calculationPeriodsScheduleReference")
(schemaTypeToXML "calculationPeriodsDatesReference")
) $ commodPricingDates_choice0 x
, foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "lag") a
, foldOneOf3 (\ (a,b,c) -> concat [ maybe [] (schemaTypeToXML "dayType") a
, maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "dayDistribution") a
, maybe [] (schemaTypeToXML "dayCount") b
])
(\ (a,b) -> concat [ concatMap (schemaTypeToXML "dayOfWeek") a
, maybe [] (schemaTypeToXML "dayNumber") b
])
) b
, maybe [] (schemaTypeToXML "businessCalendar") c
])
(concatMap (schemaTypeToXML "settlementPeriods"))
(concatMap (schemaTypeToXML "settlementPeriodsReference"))
b
])
(concatMap (schemaTypeToXML "pricingDates"))
$ commodPricingDates_choice1 x
]
data CommodityProductGrade = CommodityProductGrade Scheme CommodityProductGradeAttributes deriving (Eq,Show)
data CommodityProductGradeAttributes = CommodityProductGradeAttributes
{ commodProductGradeAttrib_productGradeScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CommodityProductGrade where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "productGradeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CommodityProductGrade v (CommodityProductGradeAttributes a0)
schemaTypeToXML s (CommodityProductGrade bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "productGradeScheme") $ commodProductGradeAttrib_productGradeScheme at
]
$ schemaTypeToXML s bt
instance Extension CommodityProductGrade Scheme where
supertype (CommodityProductGrade s _) = s
data CommodityQuantityFrequency = CommodityQuantityFrequency Scheme CommodityQuantityFrequencyAttributes deriving (Eq,Show)
data CommodityQuantityFrequencyAttributes = CommodityQuantityFrequencyAttributes
{ cqfa_quantityFrequencyScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CommodityQuantityFrequency where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "quantityFrequencyScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CommodityQuantityFrequency v (CommodityQuantityFrequencyAttributes a0)
schemaTypeToXML s (CommodityQuantityFrequency bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "quantityFrequencyScheme") $ cqfa_quantityFrequencyScheme at
]
$ schemaTypeToXML s bt
instance Extension CommodityQuantityFrequency Scheme where
supertype (CommodityQuantityFrequency s _) = s
data CommodityRelativeExpirationDates = CommodityRelativeExpirationDates
{ commodRelatExpirDates_ID :: Maybe Xsd.ID
, commodRelatExpirDates_expireRelativeToEvent :: Maybe CommodityExpireRelativeToEvent
, commodRelatExpirDates_expirationDateOffset :: Maybe DateOffset
, commodRelatExpirDates_choice2 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))
}
deriving (Eq,Show)
instance SchemaType CommodityRelativeExpirationDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityRelativeExpirationDates a0)
`apply` optional (parseSchemaType "expireRelativeToEvent")
`apply` optional (parseSchemaType "expirationDateOffset")
`apply` optional (oneOf' [ ("BusinessCentersReference", fmap OneOf2 (parseSchemaType "businessCentersReference"))
, ("BusinessCenters", fmap TwoOf2 (parseSchemaType "businessCenters"))
])
schemaTypeToXML s x@CommodityRelativeExpirationDates{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodRelatExpirDates_ID x
]
[ maybe [] (schemaTypeToXML "expireRelativeToEvent") $ commodRelatExpirDates_expireRelativeToEvent x
, maybe [] (schemaTypeToXML "expirationDateOffset") $ commodRelatExpirDates_expirationDateOffset x
, maybe [] (foldOneOf2 (schemaTypeToXML "businessCentersReference")
(schemaTypeToXML "businessCenters")
) $ commodRelatExpirDates_choice2 x
]
data CommodityRelativePaymentDates = CommodityRelativePaymentDates
{ commodRelatPaymentDates_ID :: Maybe Xsd.ID
, commodRelatPaymentDates_choice0 :: (Maybe (OneOf2 PayRelativeToEnum CommodityPayRelativeToEvent))
, commodRelatPaymentDates_choice1 :: (Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))
, commodRelatPaymentDates_paymentDaysOffset :: Maybe DateOffset
, commodRelatPaymentDates_choice3 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))
}
deriving (Eq,Show)
instance SchemaType CommodityRelativePaymentDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommodityRelativePaymentDates a0)
`apply` optional (oneOf' [ ("PayRelativeToEnum", fmap OneOf2 (parseSchemaType "payRelativeTo"))
, ("CommodityPayRelativeToEvent", fmap TwoOf2 (parseSchemaType "payRelativeToEvent"))
])
`apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))
, ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))
])
`apply` optional (parseSchemaType "paymentDaysOffset")
`apply` optional (oneOf' [ ("BusinessCentersReference", fmap OneOf2 (parseSchemaType "businessCentersReference"))
, ("BusinessCenters", fmap TwoOf2 (parseSchemaType "businessCenters"))
])
schemaTypeToXML s x@CommodityRelativePaymentDates{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodRelatPaymentDates_ID x
]
[ maybe [] (foldOneOf2 (schemaTypeToXML "payRelativeTo")
(schemaTypeToXML "payRelativeToEvent")
) $ commodRelatPaymentDates_choice0 x
, maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")
(schemaTypeToXML "calculationPeriodsScheduleReference")
(schemaTypeToXML "calculationPeriodsDatesReference")
) $ commodRelatPaymentDates_choice1 x
, maybe [] (schemaTypeToXML "paymentDaysOffset") $ commodRelatPaymentDates_paymentDaysOffset x
, maybe [] (foldOneOf2 (schemaTypeToXML "businessCentersReference")
(schemaTypeToXML "businessCenters")
) $ commodRelatPaymentDates_choice3 x
]
data CommoditySettlementPeriodsNotionalQuantity = CommoditySettlementPeriodsNotionalQuantity
{ cspnq_ID :: Maybe Xsd.ID
, cspnq_quantityUnit :: QuantityUnit
, cspnq_quantityFrequency :: Maybe CommodityQuantityFrequency
, cspnq_quantity :: Maybe Xsd.Decimal
, cspnq_settlementPeriodsReference :: [SettlementPeriodsReference]
}
deriving (Eq,Show)
instance SchemaType CommoditySettlementPeriodsNotionalQuantity where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommoditySettlementPeriodsNotionalQuantity a0)
`apply` parseSchemaType "quantityUnit"
`apply` optional (parseSchemaType "quantityFrequency")
`apply` optional (parseSchemaType "quantity")
`apply` many (parseSchemaType "settlementPeriodsReference")
schemaTypeToXML s x@CommoditySettlementPeriodsNotionalQuantity{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ cspnq_ID x
]
[ schemaTypeToXML "quantityUnit" $ cspnq_quantityUnit x
, maybe [] (schemaTypeToXML "quantityFrequency") $ cspnq_quantityFrequency x
, maybe [] (schemaTypeToXML "quantity") $ cspnq_quantity x
, concatMap (schemaTypeToXML "settlementPeriodsReference") $ cspnq_settlementPeriodsReference x
]
instance Extension CommoditySettlementPeriodsNotionalQuantity CommodityNotionalQuantity where
supertype (CommoditySettlementPeriodsNotionalQuantity a0 e0 e1 e2 e3) =
CommodityNotionalQuantity a0 e0 e1 e2
data CommoditySettlementPeriodsNotionalQuantitySchedule = CommoditySettlementPeriodsNotionalQuantitySchedule
{ cspnqs_settlementPeriodsNotionalQuantityStep :: [CommodityNotionalQuantity]
, cspnqs_settlementPeriodsReference :: [SettlementPeriodsReference]
}
deriving (Eq,Show)
instance SchemaType CommoditySettlementPeriodsNotionalQuantitySchedule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CommoditySettlementPeriodsNotionalQuantitySchedule
`apply` many (parseSchemaType "settlementPeriodsNotionalQuantityStep")
`apply` many (parseSchemaType "settlementPeriodsReference")
schemaTypeToXML s x@CommoditySettlementPeriodsNotionalQuantitySchedule{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "settlementPeriodsNotionalQuantityStep") $ cspnqs_settlementPeriodsNotionalQuantityStep x
, concatMap (schemaTypeToXML "settlementPeriodsReference") $ cspnqs_settlementPeriodsReference x
]
data CommoditySettlementPeriodsPriceSchedule = CommoditySettlementPeriodsPriceSchedule
{ cspps_settlementPeriodsPriceStep :: [FixedPrice]
, cspps_settlementPeriodsReference :: [SettlementPeriodsReference]
}
deriving (Eq,Show)
instance SchemaType CommoditySettlementPeriodsPriceSchedule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CommoditySettlementPeriodsPriceSchedule
`apply` many (parseSchemaType "settlementPeriodsPriceStep")
`apply` many (parseSchemaType "settlementPeriodsReference")
schemaTypeToXML s x@CommoditySettlementPeriodsPriceSchedule{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "settlementPeriodsPriceStep") $ cspps_settlementPeriodsPriceStep x
, concatMap (schemaTypeToXML "settlementPeriodsReference") $ cspps_settlementPeriodsReference x
]
data CommoditySpread = CommoditySpread
{ commodSpread_ID :: Maybe Xsd.ID
, commodSpread_currency :: Currency
, commodSpread_amount :: Xsd.Decimal
, commodSpread_spreadConversionFactor :: Maybe Xsd.Decimal
, commodSpread_spreadUnit :: Maybe QuantityUnit
}
deriving (Eq,Show)
instance SchemaType CommoditySpread where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommoditySpread a0)
`apply` parseSchemaType "currency"
`apply` parseSchemaType "amount"
`apply` optional (parseSchemaType "spreadConversionFactor")
`apply` optional (parseSchemaType "spreadUnit")
schemaTypeToXML s x@CommoditySpread{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodSpread_ID x
]
[ schemaTypeToXML "currency" $ commodSpread_currency x
, schemaTypeToXML "amount" $ commodSpread_amount x
, maybe [] (schemaTypeToXML "spreadConversionFactor") $ commodSpread_spreadConversionFactor x
, maybe [] (schemaTypeToXML "spreadUnit") $ commodSpread_spreadUnit x
]
instance Extension CommoditySpread Money where
supertype (CommoditySpread a0 e0 e1 e2 e3) =
Money a0 e0 e1
instance Extension CommoditySpread MoneyBase where
supertype = (supertype :: Money -> MoneyBase)
. (supertype :: CommoditySpread -> Money)
data CommoditySpreadSchedule = CommoditySpreadSchedule
{ commodSpreadSched_spreadStep :: [CommoditySpread]
, commodSpreadSched_choice1 :: (Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))
}
deriving (Eq,Show)
instance SchemaType CommoditySpreadSchedule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CommoditySpreadSchedule
`apply` many (parseSchemaType "spreadStep")
`apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))
, ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))
])
schemaTypeToXML s x@CommoditySpreadSchedule{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "spreadStep") $ commodSpreadSched_spreadStep x
, maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")
(schemaTypeToXML "calculationPeriodsScheduleReference")
(schemaTypeToXML "calculationPeriodsDatesReference")
) $ commodSpreadSched_choice1 x
]
data CommodityStrikeSchedule = CommodityStrikeSchedule
{ commodStrikeSched_strikePricePerUnitStep :: [NonNegativeMoney]
, commodStrikeSched_choice1 :: (Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))
}
deriving (Eq,Show)
instance SchemaType CommodityStrikeSchedule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CommodityStrikeSchedule
`apply` many (parseSchemaType "strikePricePerUnitStep")
`apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))
, ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))
])
schemaTypeToXML s x@CommodityStrikeSchedule{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "strikePricePerUnitStep") $ commodStrikeSched_strikePricePerUnitStep x
, maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")
(schemaTypeToXML "calculationPeriodsScheduleReference")
(schemaTypeToXML "calculationPeriodsDatesReference")
) $ commodStrikeSched_choice1 x
]
data CommoditySwap = CommoditySwap
{ commodSwap_ID :: Maybe Xsd.ID
, commodSwap_primaryAssetClass :: Maybe AssetClass
, commodSwap_secondaryAssetClass :: [AssetClass]
, commodSwap_productType :: [ProductType]
, commodSwap_productId :: [ProductId]
, commodSwap_effectiveDate :: AdjustableOrRelativeDate
, commodSwap_terminationDate :: AdjustableOrRelativeDate
, commodSwap_settlementCurrency :: Maybe IdentifiedCurrency
, commoditySwap_leg :: [CommoditySwapLeg]
, commodSwap_commonPricing :: Maybe Xsd.Boolean
, commodSwap_marketDisruption :: Maybe CommodityMarketDisruption
, commodSwap_settlementDisruption :: Maybe CommodityBullionSettlementDisruptionEnum
, commodSwap_rounding :: Maybe Rounding
}
deriving (Eq,Show)
instance SchemaType CommoditySwap where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommoditySwap a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` parseSchemaType "effectiveDate"
`apply` parseSchemaType "terminationDate"
`apply` optional (parseSchemaType "settlementCurrency")
`apply` many (elementCommoditySwapLeg)
`apply` optional (parseSchemaType "commonPricing")
`apply` optional (parseSchemaType "marketDisruption")
`apply` optional (parseSchemaType "settlementDisruption")
`apply` optional (parseSchemaType "rounding")
schemaTypeToXML s x@CommoditySwap{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodSwap_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ commodSwap_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ commodSwap_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ commodSwap_productType x
, concatMap (schemaTypeToXML "productId") $ commodSwap_productId x
, schemaTypeToXML "effectiveDate" $ commodSwap_effectiveDate x
, schemaTypeToXML "terminationDate" $ commodSwap_terminationDate x
, maybe [] (schemaTypeToXML "settlementCurrency") $ commodSwap_settlementCurrency x
, concatMap (elementToXMLCommoditySwapLeg) $ commoditySwap_leg x
, maybe [] (schemaTypeToXML "commonPricing") $ commodSwap_commonPricing x
, maybe [] (schemaTypeToXML "marketDisruption") $ commodSwap_marketDisruption x
, maybe [] (schemaTypeToXML "settlementDisruption") $ commodSwap_settlementDisruption x
, maybe [] (schemaTypeToXML "rounding") $ commodSwap_rounding x
]
instance Extension CommoditySwap Product where
supertype v = Product_CommoditySwap v
data CommoditySwaption = CommoditySwaption
{ commodSwapt_ID :: Maybe Xsd.ID
, commodSwapt_primaryAssetClass :: Maybe AssetClass
, commodSwapt_secondaryAssetClass :: [AssetClass]
, commodSwapt_productType :: [ProductType]
, commodSwapt_productId :: [ProductId]
, commodSwapt_buyerPartyReference :: Maybe PartyReference
, commodSwapt_buyerAccountReference :: Maybe AccountReference
, commodSwapt_sellerPartyReference :: Maybe PartyReference
, commodSwapt_sellerAccountReference :: Maybe AccountReference
, commodSwapt_optionType :: Maybe PutCallEnum
, commodSwapt_commoditySwap :: Maybe CommoditySwaptionUnderlying
, commodSwapt_physicalExercise :: Maybe CommodityPhysicalExercise
, commodSwapt_premium :: Maybe CommodityPremium
, commodSwapt_commonPricing :: Maybe Xsd.Boolean
, commodSwapt_marketDisruption :: Maybe CommodityMarketDisruption
, commodSwapt_settlementDisruption :: Maybe CommodityBullionSettlementDisruptionEnum
, commodSwapt_rounding :: Maybe Rounding
}
deriving (Eq,Show)
instance SchemaType CommoditySwaption where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CommoditySwaption a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` optional (parseSchemaType "buyerPartyReference")
`apply` optional (parseSchemaType "buyerAccountReference")
`apply` optional (parseSchemaType "sellerPartyReference")
`apply` optional (parseSchemaType "sellerAccountReference")
`apply` optional (parseSchemaType "optionType")
`apply` optional (parseSchemaType "commoditySwap")
`apply` optional (parseSchemaType "physicalExercise")
`apply` optional (parseSchemaType "premium")
`apply` optional (parseSchemaType "commonPricing")
`apply` optional (parseSchemaType "marketDisruption")
`apply` optional (parseSchemaType "settlementDisruption")
`apply` optional (parseSchemaType "rounding")
schemaTypeToXML s x@CommoditySwaption{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodSwapt_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ commodSwapt_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ commodSwapt_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ commodSwapt_productType x
, concatMap (schemaTypeToXML "productId") $ commodSwapt_productId x
, maybe [] (schemaTypeToXML "buyerPartyReference") $ commodSwapt_buyerPartyReference x
, maybe [] (schemaTypeToXML "buyerAccountReference") $ commodSwapt_buyerAccountReference x
, maybe [] (schemaTypeToXML "sellerPartyReference") $ commodSwapt_sellerPartyReference x
, maybe [] (schemaTypeToXML "sellerAccountReference") $ commodSwapt_sellerAccountReference x
, maybe [] (schemaTypeToXML "optionType") $ commodSwapt_optionType x
, maybe [] (schemaTypeToXML "commoditySwap") $ commodSwapt_commoditySwap x
, maybe [] (schemaTypeToXML "physicalExercise") $ commodSwapt_physicalExercise x
, maybe [] (schemaTypeToXML "premium") $ commodSwapt_premium x
, maybe [] (schemaTypeToXML "commonPricing") $ commodSwapt_commonPricing x
, maybe [] (schemaTypeToXML "marketDisruption") $ commodSwapt_marketDisruption x
, maybe [] (schemaTypeToXML "settlementDisruption") $ commodSwapt_settlementDisruption x
, maybe [] (schemaTypeToXML "rounding") $ commodSwapt_rounding x
]
instance Extension CommoditySwaption Product where
supertype v = Product_CommoditySwaption v
data CommoditySwaptionUnderlying = CommoditySwaptionUnderlying
{ commodSwaptUnderly_effectiveDate :: AdjustableOrRelativeDate
, commodSwaptUnderly_terminationDate :: AdjustableOrRelativeDate
, commodSwaptUnderly_settlementCurrency :: Maybe IdentifiedCurrency
, commodSwaptUnderly_commoditySwapLeg :: [CommoditySwapLeg]
, commodSwaptUnderly_commonPricing :: Maybe Xsd.Boolean
, commodSwaptUnderly_marketDisruption :: Maybe CommodityMarketDisruption
, commodSwaptUnderly_settlementDisruption :: Maybe CommodityBullionSettlementDisruptionEnum
, commodSwaptUnderly_rounding :: Maybe Rounding
}
deriving (Eq,Show)
instance SchemaType CommoditySwaptionUnderlying where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CommoditySwaptionUnderlying
`apply` parseSchemaType "effectiveDate"
`apply` parseSchemaType "terminationDate"
`apply` optional (parseSchemaType "settlementCurrency")
`apply` many (elementCommoditySwapLeg)
`apply` optional (parseSchemaType "commonPricing")
`apply` optional (parseSchemaType "marketDisruption")
`apply` optional (parseSchemaType "settlementDisruption")
`apply` optional (parseSchemaType "rounding")
schemaTypeToXML s x@CommoditySwaptionUnderlying{} =
toXMLElement s []
[ schemaTypeToXML "effectiveDate" $ commodSwaptUnderly_effectiveDate x
, schemaTypeToXML "terminationDate" $ commodSwaptUnderly_terminationDate x
, maybe [] (schemaTypeToXML "settlementCurrency") $ commodSwaptUnderly_settlementCurrency x
, concatMap (elementToXMLCommoditySwapLeg) $ commodSwaptUnderly_commoditySwapLeg x
, maybe [] (schemaTypeToXML "commonPricing") $ commodSwaptUnderly_commonPricing x
, maybe [] (schemaTypeToXML "marketDisruption") $ commodSwaptUnderly_marketDisruption x
, maybe [] (schemaTypeToXML "settlementDisruption") $ commodSwaptUnderly_settlementDisruption x
, maybe [] (schemaTypeToXML "rounding") $ commodSwaptUnderly_rounding x
]
data CommoditySwapLeg
= CommoditySwapLeg_PhysicalSwapLeg PhysicalSwapLeg
| CommoditySwapLeg_NonPeriodicFixedPriceLeg NonPeriodicFixedPriceLeg
| CommoditySwapLeg_FinancialSwapLeg FinancialSwapLeg
deriving (Eq,Show)
instance SchemaType CommoditySwapLeg where
parseSchemaType s = do
(fmap CommoditySwapLeg_PhysicalSwapLeg $ parseSchemaType s)
`onFail`
(fmap CommoditySwapLeg_NonPeriodicFixedPriceLeg $ parseSchemaType s)
`onFail`
(fmap CommoditySwapLeg_FinancialSwapLeg $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of CommoditySwapLeg,\n\
\ namely one of:\n\
\PhysicalSwapLeg,NonPeriodicFixedPriceLeg,FinancialSwapLeg"
schemaTypeToXML _s (CommoditySwapLeg_PhysicalSwapLeg x) = schemaTypeToXML "physicalSwapLeg" x
schemaTypeToXML _s (CommoditySwapLeg_NonPeriodicFixedPriceLeg x) = schemaTypeToXML "nonPeriodicFixedPriceLeg" x
schemaTypeToXML _s (CommoditySwapLeg_FinancialSwapLeg x) = schemaTypeToXML "financialSwapLeg" x
instance Extension CommoditySwapLeg Leg where
supertype v = Leg_CommoditySwapLeg v
data DisruptionFallback = DisruptionFallback Scheme DisruptionFallbackAttributes deriving (Eq,Show)
data DisruptionFallbackAttributes = DisruptionFallbackAttributes
{ disrupFallbAttrib_commodityMarketDisruptionFallbackScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType DisruptionFallback where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "commodityMarketDisruptionFallbackScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ DisruptionFallback v (DisruptionFallbackAttributes a0)
schemaTypeToXML s (DisruptionFallback bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "commodityMarketDisruptionFallbackScheme") $ disrupFallbAttrib_commodityMarketDisruptionFallbackScheme at
]
$ schemaTypeToXML s bt
instance Extension DisruptionFallback Scheme where
supertype (DisruptionFallback s _) = s
data ElectricityDelivery = ElectricityDelivery
{ electrDeliv_choice0 :: OneOf2 (ElectricityDeliveryPoint,ElectricityDeliveryType,(Maybe (ElectricityTransmissionContingency))) ((Maybe (CommodityDeliveryPoint)),(Maybe (PartyReference)))
}
deriving (Eq,Show)
instance SchemaType ElectricityDelivery where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ElectricityDelivery
`apply` oneOf' [ ("ElectricityDeliveryPoint ElectricityDeliveryType Maybe ElectricityTransmissionContingency", fmap OneOf2 (return (,,) `apply` parseSchemaType "deliveryPoint"
`apply` parseSchemaType "deliveryType"
`apply` optional (parseSchemaType "transmissionContingency")))
, ("Maybe CommodityDeliveryPoint Maybe PartyReference", fmap TwoOf2 (return (,) `apply` optional (parseSchemaType "deliveryZone")
`apply` optional (parseSchemaType "electingPartyReference")))
]
schemaTypeToXML s x@ElectricityDelivery{} =
toXMLElement s []
[ foldOneOf2 (\ (a,b,c) -> concat [ schemaTypeToXML "deliveryPoint" a
, schemaTypeToXML "deliveryType" b
, maybe [] (schemaTypeToXML "transmissionContingency") c
])
(\ (a,b) -> concat [ maybe [] (schemaTypeToXML "deliveryZone") a
, maybe [] (schemaTypeToXML "electingPartyReference") b
])
$ electrDeliv_choice0 x
]
data ElectricityDeliveryFirm = ElectricityDeliveryFirm
{ electrDelivFirm_forceMajeure :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType ElectricityDeliveryFirm where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ElectricityDeliveryFirm
`apply` optional (parseSchemaType "forceMajeure")
schemaTypeToXML s x@ElectricityDeliveryFirm{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "forceMajeure") $ electrDelivFirm_forceMajeure x
]
data ElectricityDeliveryPeriods = ElectricityDeliveryPeriods
{ electrDelivPeriods_ID :: Maybe Xsd.ID
, electrDelivPeriods_choice0 :: OneOf3 AdjustableDates CommodityCalculationPeriodsSchedule ((Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference)))
, electrDelivPeriods_settlementPeriods :: [SettlementPeriods]
}
deriving (Eq,Show)
instance SchemaType ElectricityDeliveryPeriods where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ElectricityDeliveryPeriods a0)
`apply` oneOf' [ ("AdjustableDates", fmap OneOf3 (parseSchemaType "periods"))
, ("CommodityCalculationPeriodsSchedule", fmap TwoOf3 (parseSchemaType "periodsSchedule"))
, ("(Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))", fmap ThreeOf3 (optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))
, ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))
])))
]
`apply` many (parseSchemaType "settlementPeriods")
schemaTypeToXML s x@ElectricityDeliveryPeriods{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ electrDelivPeriods_ID x
]
[ foldOneOf3 (schemaTypeToXML "periods")
(schemaTypeToXML "periodsSchedule")
(maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")
(schemaTypeToXML "calculationPeriodsScheduleReference")
(schemaTypeToXML "calculationPeriodsDatesReference")
))
$ electrDelivPeriods_choice0 x
, concatMap (schemaTypeToXML "settlementPeriods") $ electrDelivPeriods_settlementPeriods x
]
instance Extension ElectricityDeliveryPeriods CommodityDeliveryPeriods where
supertype (ElectricityDeliveryPeriods a0 e0 e1) =
CommodityDeliveryPeriods a0 e0
data ElectricityDeliveryPoint = ElectricityDeliveryPoint Scheme ElectricityDeliveryPointAttributes deriving (Eq,Show)
data ElectricityDeliveryPointAttributes = ElectricityDeliveryPointAttributes
{ electrDelivPointAttrib_deliveryPointScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType ElectricityDeliveryPoint where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "deliveryPointScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ ElectricityDeliveryPoint v (ElectricityDeliveryPointAttributes a0)
schemaTypeToXML s (ElectricityDeliveryPoint bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "deliveryPointScheme") $ electrDelivPointAttrib_deliveryPointScheme at
]
$ schemaTypeToXML s bt
instance Extension ElectricityDeliveryPoint Scheme where
supertype (ElectricityDeliveryPoint s _) = s
data ElectricityDeliverySystemFirm = ElectricityDeliverySystemFirm
{ electrDelivSystemFirm_applicable :: Maybe Xsd.Boolean
, electrDelivSystemFirm_system :: Maybe CommodityDeliveryPoint
}
deriving (Eq,Show)
instance SchemaType ElectricityDeliverySystemFirm where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ElectricityDeliverySystemFirm
`apply` optional (parseSchemaType "applicable")
`apply` optional (parseSchemaType "system")
schemaTypeToXML s x@ElectricityDeliverySystemFirm{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "applicable") $ electrDelivSystemFirm_applicable x
, maybe [] (schemaTypeToXML "system") $ electrDelivSystemFirm_system x
]
data ElectricityDeliveryType = ElectricityDeliveryType
{ electrDelivType_choice0 :: (Maybe (OneOf4 ElectricityDeliveryFirm Xsd.Boolean ElectricityDeliverySystemFirm ElectricityDeliveryUnitFirm))
}
deriving (Eq,Show)
instance SchemaType ElectricityDeliveryType where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ElectricityDeliveryType
`apply` optional (oneOf' [ ("ElectricityDeliveryFirm", fmap OneOf4 (parseSchemaType "firm"))
, ("Xsd.Boolean", fmap TwoOf4 (parseSchemaType "nonFirm"))
, ("ElectricityDeliverySystemFirm", fmap ThreeOf4 (parseSchemaType "systemFirm"))
, ("ElectricityDeliveryUnitFirm", fmap FourOf4 (parseSchemaType "unitFirm"))
])
schemaTypeToXML s x@ElectricityDeliveryType{} =
toXMLElement s []
[ maybe [] (foldOneOf4 (schemaTypeToXML "firm")
(schemaTypeToXML "nonFirm")
(schemaTypeToXML "systemFirm")
(schemaTypeToXML "unitFirm")
) $ electrDelivType_choice0 x
]
data ElectricityDeliveryUnitFirm = ElectricityDeliveryUnitFirm
{ electrDelivUnitFirm_applicable :: Maybe Xsd.Boolean
, electrDelivUnitFirm_generationAsset :: Maybe CommodityDeliveryPoint
}
deriving (Eq,Show)
instance SchemaType ElectricityDeliveryUnitFirm where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ElectricityDeliveryUnitFirm
`apply` optional (parseSchemaType "applicable")
`apply` optional (parseSchemaType "generationAsset")
schemaTypeToXML s x@ElectricityDeliveryUnitFirm{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "applicable") $ electrDelivUnitFirm_applicable x
, maybe [] (schemaTypeToXML "generationAsset") $ electrDelivUnitFirm_generationAsset x
]
data ElectricityPhysicalDeliveryQuantity = ElectricityPhysicalDeliveryQuantity
{ epdq_ID :: Maybe Xsd.ID
, epdq_quantityUnit :: QuantityUnit
, epdq_quantityFrequency :: Maybe CommodityQuantityFrequency
, epdq_quantity :: Maybe Xsd.Decimal
, epdq_settlementPeriodsReference :: [SettlementPeriodsReference]
}
deriving (Eq,Show)
instance SchemaType ElectricityPhysicalDeliveryQuantity where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ElectricityPhysicalDeliveryQuantity a0)
`apply` parseSchemaType "quantityUnit"
`apply` optional (parseSchemaType "quantityFrequency")
`apply` optional (parseSchemaType "quantity")
`apply` many (parseSchemaType "settlementPeriodsReference")
schemaTypeToXML s x@ElectricityPhysicalDeliveryQuantity{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ epdq_ID x
]
[ schemaTypeToXML "quantityUnit" $ epdq_quantityUnit x
, maybe [] (schemaTypeToXML "quantityFrequency") $ epdq_quantityFrequency x
, maybe [] (schemaTypeToXML "quantity") $ epdq_quantity x
, concatMap (schemaTypeToXML "settlementPeriodsReference") $ epdq_settlementPeriodsReference x
]
instance Extension ElectricityPhysicalDeliveryQuantity CommodityNotionalQuantity where
supertype (ElectricityPhysicalDeliveryQuantity a0 e0 e1 e2 e3) =
CommodityNotionalQuantity a0 e0 e1 e2
data ElectricityPhysicalDeliveryQuantitySchedule = ElectricityPhysicalDeliveryQuantitySchedule
{ epdqs_ID :: Maybe Xsd.ID
, epdqs_quantityStep :: [CommodityNotionalQuantity]
, epdqs_choice1 :: (Maybe (OneOf2 CalculationPeriodsReference CalculationPeriodsScheduleReference))
, epdqs_settlementPeriodsReference :: [SettlementPeriodsReference]
}
deriving (Eq,Show)
instance SchemaType ElectricityPhysicalDeliveryQuantitySchedule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ElectricityPhysicalDeliveryQuantitySchedule a0)
`apply` many (parseSchemaType "quantityStep")
`apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf2 (parseSchemaType "deliveryPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf2 (parseSchemaType "deliveryPeriodsScheduleReference"))
])
`apply` many (parseSchemaType "settlementPeriodsReference")
schemaTypeToXML s x@ElectricityPhysicalDeliveryQuantitySchedule{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ epdqs_ID x
]
[ concatMap (schemaTypeToXML "quantityStep") $ epdqs_quantityStep x
, maybe [] (foldOneOf2 (schemaTypeToXML "deliveryPeriodsReference")
(schemaTypeToXML "deliveryPeriodsScheduleReference")
) $ epdqs_choice1 x
, concatMap (schemaTypeToXML "settlementPeriodsReference") $ epdqs_settlementPeriodsReference x
]
instance Extension ElectricityPhysicalDeliveryQuantitySchedule CommodityPhysicalQuantitySchedule where
supertype (ElectricityPhysicalDeliveryQuantitySchedule a0 e0 e1 e2) =
CommodityPhysicalQuantitySchedule a0 e0 e1
data ElectricityPhysicalLeg = ElectricityPhysicalLeg
{ electrPhysicLeg_ID :: Maybe Xsd.ID
, electrPhysicLeg_payerPartyReference :: Maybe PartyReference
, electrPhysicLeg_payerAccountReference :: Maybe AccountReference
, electrPhysicLeg_receiverPartyReference :: Maybe PartyReference
, electrPhysicLeg_receiverAccountReference :: Maybe AccountReference
, electrPhysicLeg_deliveryPeriods :: Maybe CommodityDeliveryPeriods
, electrPhysicLeg_settlementPeriods :: [SettlementPeriods]
, electrPhysicLeg_settlementPeriodsSchedule :: Maybe SettlementPeriodsSchedule
, electrPhysicLeg_electricity :: ElectricityProduct
, electrPhysicLeg_deliveryConditions :: ElectricityDelivery
, electrPhysicLeg_deliveryQuantity :: ElectricityPhysicalQuantity
}
deriving (Eq,Show)
instance SchemaType ElectricityPhysicalLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ElectricityPhysicalLeg a0)
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` optional (parseSchemaType "deliveryPeriods")
`apply` many1 (parseSchemaType "settlementPeriods")
`apply` optional (parseSchemaType "settlementPeriodsSchedule")
`apply` parseSchemaType "electricity"
`apply` parseSchemaType "deliveryConditions"
`apply` parseSchemaType "deliveryQuantity"
schemaTypeToXML s x@ElectricityPhysicalLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ electrPhysicLeg_ID x
]
[ maybe [] (schemaTypeToXML "payerPartyReference") $ electrPhysicLeg_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ electrPhysicLeg_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ electrPhysicLeg_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ electrPhysicLeg_receiverAccountReference x
, maybe [] (schemaTypeToXML "deliveryPeriods") $ electrPhysicLeg_deliveryPeriods x
, concatMap (schemaTypeToXML "settlementPeriods") $ electrPhysicLeg_settlementPeriods x
, maybe [] (schemaTypeToXML "settlementPeriodsSchedule") $ electrPhysicLeg_settlementPeriodsSchedule x
, schemaTypeToXML "electricity" $ electrPhysicLeg_electricity x
, schemaTypeToXML "deliveryConditions" $ electrPhysicLeg_deliveryConditions x
, schemaTypeToXML "deliveryQuantity" $ electrPhysicLeg_deliveryQuantity x
]
instance Extension ElectricityPhysicalLeg PhysicalSwapLeg where
supertype v = PhysicalSwapLeg_ElectricityPhysicalLeg v
instance Extension ElectricityPhysicalLeg CommoditySwapLeg where
supertype = (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)
. (supertype :: ElectricityPhysicalLeg -> PhysicalSwapLeg)
instance Extension ElectricityPhysicalLeg Leg where
supertype = (supertype :: CommoditySwapLeg -> Leg)
. (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)
. (supertype :: ElectricityPhysicalLeg -> PhysicalSwapLeg)
data ElectricityPhysicalQuantity = ElectricityPhysicalQuantity
{ electrPhysicQuant_ID :: Maybe Xsd.ID
, electrPhysicQuant_choice0 :: (Maybe (OneOf2 [ElectricityPhysicalDeliveryQuantity] [ElectricityPhysicalDeliveryQuantitySchedule]))
, electrPhysicQuant_totalPhysicalQuantity :: UnitQuantity
}
deriving (Eq,Show)
instance SchemaType ElectricityPhysicalQuantity where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ElectricityPhysicalQuantity a0)
`apply` optional (oneOf' [ ("[ElectricityPhysicalDeliveryQuantity]", fmap OneOf2 (many1 (parseSchemaType "physicalQuantity")))
, ("[ElectricityPhysicalDeliveryQuantitySchedule]", fmap TwoOf2 (many1 (parseSchemaType "physicalQuantitySchedule")))
])
`apply` parseSchemaType "totalPhysicalQuantity"
schemaTypeToXML s x@ElectricityPhysicalQuantity{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ electrPhysicQuant_ID x
]
[ maybe [] (foldOneOf2 (concatMap (schemaTypeToXML "physicalQuantity"))
(concatMap (schemaTypeToXML "physicalQuantitySchedule"))
) $ electrPhysicQuant_choice0 x
, schemaTypeToXML "totalPhysicalQuantity" $ electrPhysicQuant_totalPhysicalQuantity x
]
instance Extension ElectricityPhysicalQuantity CommodityPhysicalQuantityBase where
supertype v = CommodityPhysicalQuantityBase_ElectricityPhysicalQuantity v
data ElectricityProduct = ElectricityProduct
{ electrProduct_type :: Maybe ElectricityProductTypeEnum
, electrProduct_voltage :: Maybe PositiveDecimal
}
deriving (Eq,Show)
instance SchemaType ElectricityProduct where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ElectricityProduct
`apply` optional (parseSchemaType "type")
`apply` optional (parseSchemaType "voltage")
schemaTypeToXML s x@ElectricityProduct{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "type") $ electrProduct_type x
, maybe [] (schemaTypeToXML "voltage") $ electrProduct_voltage x
]
data ElectricityTransmissionContingency = ElectricityTransmissionContingency
{ electrTransmContin_contingency :: Maybe ElectricityTransmissionContingencyType
, electrTransmContin_contingentParty :: [PartyReference]
}
deriving (Eq,Show)
instance SchemaType ElectricityTransmissionContingency where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ElectricityTransmissionContingency
`apply` optional (parseSchemaType "contingency")
`apply` between (Occurs (Just 0) (Just 2))
(parseSchemaType "contingentParty")
schemaTypeToXML s x@ElectricityTransmissionContingency{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "contingency") $ electrTransmContin_contingency x
, concatMap (schemaTypeToXML "contingentParty") $ electrTransmContin_contingentParty x
]
data ElectricityTransmissionContingencyType = ElectricityTransmissionContingencyType Scheme ElectricityTransmissionContingencyTypeAttributes deriving (Eq,Show)
data ElectricityTransmissionContingencyTypeAttributes = ElectricityTransmissionContingencyTypeAttributes
{ etcta_electricityTransmissionContingencyScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType ElectricityTransmissionContingencyType where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "electricityTransmissionContingencyScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ ElectricityTransmissionContingencyType v (ElectricityTransmissionContingencyTypeAttributes a0)
schemaTypeToXML s (ElectricityTransmissionContingencyType bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "electricityTransmissionContingencyScheme") $ etcta_electricityTransmissionContingencyScheme at
]
$ schemaTypeToXML s bt
instance Extension ElectricityTransmissionContingencyType Scheme where
supertype (ElectricityTransmissionContingencyType s _) = s
data FinancialSwapLeg
= FinancialSwapLeg_FloatingPriceLeg FloatingPriceLeg
| FinancialSwapLeg_FixedPriceLeg FixedPriceLeg
deriving (Eq,Show)
instance SchemaType FinancialSwapLeg where
parseSchemaType s = do
(fmap FinancialSwapLeg_FloatingPriceLeg $ parseSchemaType s)
`onFail`
(fmap FinancialSwapLeg_FixedPriceLeg $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of FinancialSwapLeg,\n\
\ namely one of:\n\
\FloatingPriceLeg,FixedPriceLeg"
schemaTypeToXML _s (FinancialSwapLeg_FloatingPriceLeg x) = schemaTypeToXML "floatingPriceLeg" x
schemaTypeToXML _s (FinancialSwapLeg_FixedPriceLeg x) = schemaTypeToXML "fixedPriceLeg" x
instance Extension FinancialSwapLeg CommoditySwapLeg where
supertype v = CommoditySwapLeg_FinancialSwapLeg v
data FixedPrice = FixedPrice
{ fixedPrice_ID :: Maybe Xsd.ID
, fixedPrice_price :: Xsd.Decimal
, fixedPrice_priceCurrency :: Currency
, fixedPrice_priceUnit :: QuantityUnit
}
deriving (Eq,Show)
instance SchemaType FixedPrice where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FixedPrice a0)
`apply` parseSchemaType "price"
`apply` parseSchemaType "priceCurrency"
`apply` parseSchemaType "priceUnit"
schemaTypeToXML s x@FixedPrice{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fixedPrice_ID x
]
[ schemaTypeToXML "price" $ fixedPrice_price x
, schemaTypeToXML "priceCurrency" $ fixedPrice_priceCurrency x
, schemaTypeToXML "priceUnit" $ fixedPrice_priceUnit x
]
data FixedPriceLeg = FixedPriceLeg
{ fixedPriceLeg_ID :: Maybe Xsd.ID
, fixedPriceLeg_payerPartyReference :: Maybe PartyReference
, fixedPriceLeg_payerAccountReference :: Maybe AccountReference
, fixedPriceLeg_receiverPartyReference :: Maybe PartyReference
, fixedPriceLeg_receiverAccountReference :: Maybe AccountReference
, fixedPriceLeg_choice4 :: OneOf4 AdjustableDates AdjustableDates CommodityCalculationPeriodsSchedule ((Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference)))
, fixedPriceLeg_choice5 :: OneOf2 CommodityFixedPriceSchedule (OneOf4 FixedPrice Xsd.Decimal NonNegativeMoney [SettlementPeriodsFixedPrice])
, fixedPriceLeg_totalPrice :: Maybe NonNegativeMoney
, fixedPriceLeg_choice7 :: OneOf2 ((OneOf3 CommodityNotionalQuantitySchedule CommodityNotionalQuantity [CommoditySettlementPeriodsNotionalQuantity]),Xsd.Decimal) QuantityReference
, fixedPriceLeg_choice8 :: OneOf2 CommodityRelativePaymentDates ((Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean)))
, fixedPriceLeg_flatRate :: Maybe FlatRateEnum
, fixedPriceLeg_flatRateAmount :: Maybe NonNegativeMoney
}
deriving (Eq,Show)
instance SchemaType FixedPriceLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FixedPriceLeg a0)
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` oneOf' [ ("AdjustableDates", fmap OneOf4 (parseSchemaType "calculationDates"))
, ("AdjustableDates", fmap TwoOf4 (parseSchemaType "calculationPeriods"))
, ("CommodityCalculationPeriodsSchedule", fmap ThreeOf4 (parseSchemaType "calculationPeriodsSchedule"))
, ("(Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))", fmap FourOf4 (optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))
, ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))
])))
]
`apply` oneOf' [ ("CommodityFixedPriceSchedule", fmap OneOf2 (parseSchemaType "fixedPriceSchedule"))
, ("OneOf4 FixedPrice Xsd.Decimal NonNegativeMoney [SettlementPeriodsFixedPrice]", fmap TwoOf2 (oneOf' [ ("FixedPrice", fmap OneOf4 (parseSchemaType "fixedPrice"))
, ("Xsd.Decimal", fmap TwoOf4 (parseSchemaType "worldscaleRate"))
, ("NonNegativeMoney", fmap ThreeOf4 (parseSchemaType "contractRate"))
, ("[SettlementPeriodsFixedPrice]", fmap FourOf4 (many1 (parseSchemaType "settlementPeriodsPrice")))
]))
]
`apply` optional (parseSchemaType "totalPrice")
`apply` oneOf' [ ("OneOf3 CommodityNotionalQuantitySchedule CommodityNotionalQuantity [CommoditySettlementPeriodsNotionalQuantity] Xsd.Decimal", fmap OneOf2 (return (,) `apply` oneOf' [ ("CommodityNotionalQuantitySchedule", fmap OneOf3 (parseSchemaType "notionalQuantitySchedule"))
, ("CommodityNotionalQuantity", fmap TwoOf3 (parseSchemaType "notionalQuantity"))
, ("[CommoditySettlementPeriodsNotionalQuantity]", fmap ThreeOf3 (many1 (parseSchemaType "settlementPeriodsNotionalQuantity")))
]
`apply` parseSchemaType "totalNotionalQuantity"))
, ("QuantityReference", fmap TwoOf2 (parseSchemaType "quantityReference"))
]
`apply` oneOf' [ ("CommodityRelativePaymentDates", fmap OneOf2 (parseSchemaType "relativePaymentDates"))
, ("(Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean))", fmap TwoOf2 (optional (oneOf' [ ("AdjustableDatesOrRelativeDateOffset", fmap OneOf2 (parseSchemaType "paymentDates"))
, ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "masterAgreementPaymentDates"))
])))
]
`apply` optional (parseSchemaType "flatRate")
`apply` optional (parseSchemaType "flatRateAmount")
schemaTypeToXML s x@FixedPriceLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fixedPriceLeg_ID x
]
[ maybe [] (schemaTypeToXML "payerPartyReference") $ fixedPriceLeg_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ fixedPriceLeg_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ fixedPriceLeg_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ fixedPriceLeg_receiverAccountReference x
, foldOneOf4 (schemaTypeToXML "calculationDates")
(schemaTypeToXML "calculationPeriods")
(schemaTypeToXML "calculationPeriodsSchedule")
(maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")
(schemaTypeToXML "calculationPeriodsScheduleReference")
(schemaTypeToXML "calculationPeriodsDatesReference")
))
$ fixedPriceLeg_choice4 x
, foldOneOf2 (schemaTypeToXML "fixedPriceSchedule")
(foldOneOf4 (schemaTypeToXML "fixedPrice")
(schemaTypeToXML "worldscaleRate")
(schemaTypeToXML "contractRate")
(concatMap (schemaTypeToXML "settlementPeriodsPrice"))
)
$ fixedPriceLeg_choice5 x
, maybe [] (schemaTypeToXML "totalPrice") $ fixedPriceLeg_totalPrice x
, foldOneOf2 (\ (a,b) -> concat [ foldOneOf3 (schemaTypeToXML "notionalQuantitySchedule")
(schemaTypeToXML "notionalQuantity")
(concatMap (schemaTypeToXML "settlementPeriodsNotionalQuantity"))
a
, schemaTypeToXML "totalNotionalQuantity" b
])
(schemaTypeToXML "quantityReference")
$ fixedPriceLeg_choice7 x
, foldOneOf2 (schemaTypeToXML "relativePaymentDates")
(maybe [] (foldOneOf2 (schemaTypeToXML "paymentDates")
(schemaTypeToXML "masterAgreementPaymentDates")
))
$ fixedPriceLeg_choice8 x
, maybe [] (schemaTypeToXML "flatRate") $ fixedPriceLeg_flatRate x
, maybe [] (schemaTypeToXML "flatRateAmount") $ fixedPriceLeg_flatRateAmount x
]
instance Extension FixedPriceLeg FinancialSwapLeg where
supertype v = FinancialSwapLeg_FixedPriceLeg v
instance Extension FixedPriceLeg CommoditySwapLeg where
supertype = (supertype :: FinancialSwapLeg -> CommoditySwapLeg)
. (supertype :: FixedPriceLeg -> FinancialSwapLeg)
instance Extension FixedPriceLeg Leg where
supertype = (supertype :: CommoditySwapLeg -> Leg)
. (supertype :: FinancialSwapLeg -> CommoditySwapLeg)
. (supertype :: FixedPriceLeg -> FinancialSwapLeg)
data FloatingLegCalculation = FloatingLegCalculation
{ floatLegCalc_pricingDates :: CommodityPricingDates
, floatLegCalc_averagingMethod :: Maybe AveragingMethodEnum
, floatLegCalc_conversionFactor :: Maybe Xsd.Decimal
, floatLegCalc_rounding :: Maybe Rounding
, floatLegCalc_choice4 :: (Maybe (OneOf2 CommoditySpread [CommoditySpreadSchedule]))
, floatLegCalc_fx :: Maybe CommodityFx
}
deriving (Eq,Show)
instance SchemaType FloatingLegCalculation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FloatingLegCalculation
`apply` parseSchemaType "pricingDates"
`apply` optional (parseSchemaType "averagingMethod")
`apply` optional (parseSchemaType "conversionFactor")
`apply` optional (parseSchemaType "rounding")
`apply` optional (oneOf' [ ("CommoditySpread", fmap OneOf2 (parseSchemaType "spread"))
, ("[CommoditySpreadSchedule]", fmap TwoOf2 (many1 (parseSchemaType "spreadSchedule")))
])
`apply` optional (parseSchemaType "fx")
schemaTypeToXML s x@FloatingLegCalculation{} =
toXMLElement s []
[ schemaTypeToXML "pricingDates" $ floatLegCalc_pricingDates x
, maybe [] (schemaTypeToXML "averagingMethod") $ floatLegCalc_averagingMethod x
, maybe [] (schemaTypeToXML "conversionFactor") $ floatLegCalc_conversionFactor x
, maybe [] (schemaTypeToXML "rounding") $ floatLegCalc_rounding x
, maybe [] (foldOneOf2 (schemaTypeToXML "spread")
(concatMap (schemaTypeToXML "spreadSchedule"))
) $ floatLegCalc_choice4 x
, maybe [] (schemaTypeToXML "fx") $ floatLegCalc_fx x
]
data FloatingPriceLeg = FloatingPriceLeg
{ floatPriceLeg_ID :: Maybe Xsd.ID
, floatPriceLeg_payerPartyReference :: Maybe PartyReference
, floatPriceLeg_payerAccountReference :: Maybe AccountReference
, floatPriceLeg_receiverPartyReference :: Maybe PartyReference
, floatPriceLeg_receiverAccountReference :: Maybe AccountReference
, floatPriceLeg_choice4 :: OneOf4 AdjustableDates AdjustableDates CommodityCalculationPeriodsSchedule ((Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference)))
, floatPriceLeg_commodity :: Commodity
, floatPriceLeg_choice6 :: OneOf2 ((OneOf3 CommodityNotionalQuantitySchedule CommodityNotionalQuantity [CommoditySettlementPeriodsNotionalQuantity]),Xsd.Decimal) QuantityReference
, floatPriceLeg_calculation :: FloatingLegCalculation
, floatPriceLeg_choice8 :: OneOf2 CommodityRelativePaymentDates ((Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean)))
, floatPriceLeg_flatRate :: Maybe FlatRateEnum
, floatPriceLeg_flatRateAmount :: Maybe NonNegativeMoney
}
deriving (Eq,Show)
instance SchemaType FloatingPriceLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FloatingPriceLeg a0)
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` oneOf' [ ("AdjustableDates", fmap OneOf4 (parseSchemaType "calculationDates"))
, ("AdjustableDates", fmap TwoOf4 (parseSchemaType "calculationPeriods"))
, ("CommodityCalculationPeriodsSchedule", fmap ThreeOf4 (parseSchemaType "calculationPeriodsSchedule"))
, ("(Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))", fmap FourOf4 (optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))
, ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))
])))
]
`apply` parseSchemaType "commodity"
`apply` oneOf' [ ("OneOf3 CommodityNotionalQuantitySchedule CommodityNotionalQuantity [CommoditySettlementPeriodsNotionalQuantity] Xsd.Decimal", fmap OneOf2 (return (,) `apply` oneOf' [ ("CommodityNotionalQuantitySchedule", fmap OneOf3 (parseSchemaType "notionalQuantitySchedule"))
, ("CommodityNotionalQuantity", fmap TwoOf3 (parseSchemaType "notionalQuantity"))
, ("[CommoditySettlementPeriodsNotionalQuantity]", fmap ThreeOf3 (many1 (parseSchemaType "settlementPeriodsNotionalQuantity")))
]
`apply` parseSchemaType "totalNotionalQuantity"))
, ("QuantityReference", fmap TwoOf2 (parseSchemaType "quantityReference"))
]
`apply` parseSchemaType "calculation"
`apply` oneOf' [ ("CommodityRelativePaymentDates", fmap OneOf2 (parseSchemaType "relativePaymentDates"))
, ("(Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean))", fmap TwoOf2 (optional (oneOf' [ ("AdjustableDatesOrRelativeDateOffset", fmap OneOf2 (parseSchemaType "paymentDates"))
, ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "masterAgreementPaymentDates"))
])))
]
`apply` optional (parseSchemaType "flatRate")
`apply` optional (parseSchemaType "flatRateAmount")
schemaTypeToXML s x@FloatingPriceLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ floatPriceLeg_ID x
]
[ maybe [] (schemaTypeToXML "payerPartyReference") $ floatPriceLeg_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ floatPriceLeg_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ floatPriceLeg_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ floatPriceLeg_receiverAccountReference x
, foldOneOf4 (schemaTypeToXML "calculationDates")
(schemaTypeToXML "calculationPeriods")
(schemaTypeToXML "calculationPeriodsSchedule")
(maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")
(schemaTypeToXML "calculationPeriodsScheduleReference")
(schemaTypeToXML "calculationPeriodsDatesReference")
))
$ floatPriceLeg_choice4 x
, schemaTypeToXML "commodity" $ floatPriceLeg_commodity x
, foldOneOf2 (\ (a,b) -> concat [ foldOneOf3 (schemaTypeToXML "notionalQuantitySchedule")
(schemaTypeToXML "notionalQuantity")
(concatMap (schemaTypeToXML "settlementPeriodsNotionalQuantity"))
a
, schemaTypeToXML "totalNotionalQuantity" b
])
(schemaTypeToXML "quantityReference")
$ floatPriceLeg_choice6 x
, schemaTypeToXML "calculation" $ floatPriceLeg_calculation x
, foldOneOf2 (schemaTypeToXML "relativePaymentDates")
(maybe [] (foldOneOf2 (schemaTypeToXML "paymentDates")
(schemaTypeToXML "masterAgreementPaymentDates")
))
$ floatPriceLeg_choice8 x
, maybe [] (schemaTypeToXML "flatRate") $ floatPriceLeg_flatRate x
, maybe [] (schemaTypeToXML "flatRateAmount") $ floatPriceLeg_flatRateAmount x
]
instance Extension FloatingPriceLeg FinancialSwapLeg where
supertype v = FinancialSwapLeg_FloatingPriceLeg v
instance Extension FloatingPriceLeg CommoditySwapLeg where
supertype = (supertype :: FinancialSwapLeg -> CommoditySwapLeg)
. (supertype :: FloatingPriceLeg -> FinancialSwapLeg)
instance Extension FloatingPriceLeg Leg where
supertype = (supertype :: CommoditySwapLeg -> Leg)
. (supertype :: FinancialSwapLeg -> CommoditySwapLeg)
. (supertype :: FloatingPriceLeg -> FinancialSwapLeg)
data GasDelivery = GasDelivery
{ gasDelivery_choice0 :: (Maybe (OneOf2 GasDeliveryPoint ((Maybe (CommodityDeliveryPoint)),(Maybe (CommodityDeliveryPoint)))))
, gasDelivery_deliveryType :: Maybe DeliveryTypeEnum
, gasDelivery_buyerHub :: Maybe CommodityHub
, gasDelivery_sellerHub :: Maybe CommodityHub
}
deriving (Eq,Show)
instance SchemaType GasDelivery where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return GasDelivery
`apply` optional (oneOf' [ ("GasDeliveryPoint", fmap OneOf2 (parseSchemaType "deliveryPoint"))
, ("Maybe CommodityDeliveryPoint Maybe CommodityDeliveryPoint", fmap TwoOf2 (return (,) `apply` optional (parseSchemaType "entryPoint")
`apply` optional (parseSchemaType "withdrawalPoint")))
])
`apply` optional (parseSchemaType "deliveryType")
`apply` optional (parseSchemaType "buyerHub")
`apply` optional (parseSchemaType "sellerHub")
schemaTypeToXML s x@GasDelivery{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "deliveryPoint")
(\ (a,b) -> concat [ maybe [] (schemaTypeToXML "entryPoint") a
, maybe [] (schemaTypeToXML "withdrawalPoint") b
])
) $ gasDelivery_choice0 x
, maybe [] (schemaTypeToXML "deliveryType") $ gasDelivery_deliveryType x
, maybe [] (schemaTypeToXML "buyerHub") $ gasDelivery_buyerHub x
, maybe [] (schemaTypeToXML "sellerHub") $ gasDelivery_sellerHub x
]
data GasDeliveryPoint = GasDeliveryPoint Scheme GasDeliveryPointAttributes deriving (Eq,Show)
data GasDeliveryPointAttributes = GasDeliveryPointAttributes
{ gasDelivPointAttrib_deliveryPointScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType GasDeliveryPoint where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "deliveryPointScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ GasDeliveryPoint v (GasDeliveryPointAttributes a0)
schemaTypeToXML s (GasDeliveryPoint bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "deliveryPointScheme") $ gasDelivPointAttrib_deliveryPointScheme at
]
$ schemaTypeToXML s bt
instance Extension GasDeliveryPoint Scheme where
supertype (GasDeliveryPoint s _) = s
data GasDeliveryPeriods = GasDeliveryPeriods
{ gasDelivPeriods_ID :: Maybe Xsd.ID
, gasDelivPeriods_choice0 :: OneOf3 AdjustableDates CommodityCalculationPeriodsSchedule ((Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference)))
, gasDelivPeriods_supplyStartTime :: PrevailingTime
, gasDelivPeriods_supplyEndTime :: PrevailingTime
}
deriving (Eq,Show)
instance SchemaType GasDeliveryPeriods where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (GasDeliveryPeriods a0)
`apply` oneOf' [ ("AdjustableDates", fmap OneOf3 (parseSchemaType "periods"))
, ("CommodityCalculationPeriodsSchedule", fmap TwoOf3 (parseSchemaType "periodsSchedule"))
, ("(Maybe (OneOf3 CalculationPeriodsReference CalculationPeriodsScheduleReference CalculationPeriodsDatesReference))", fmap ThreeOf3 (optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf3 (parseSchemaType "calculationPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf3 (parseSchemaType "calculationPeriodsScheduleReference"))
, ("CalculationPeriodsDatesReference", fmap ThreeOf3 (parseSchemaType "calculationPeriodsDatesReference"))
])))
]
`apply` parseSchemaType "supplyStartTime"
`apply` parseSchemaType "supplyEndTime"
schemaTypeToXML s x@GasDeliveryPeriods{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ gasDelivPeriods_ID x
]
[ foldOneOf3 (schemaTypeToXML "periods")
(schemaTypeToXML "periodsSchedule")
(maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodsReference")
(schemaTypeToXML "calculationPeriodsScheduleReference")
(schemaTypeToXML "calculationPeriodsDatesReference")
))
$ gasDelivPeriods_choice0 x
, schemaTypeToXML "supplyStartTime" $ gasDelivPeriods_supplyStartTime x
, schemaTypeToXML "supplyEndTime" $ gasDelivPeriods_supplyEndTime x
]
instance Extension GasDeliveryPeriods CommodityDeliveryPeriods where
supertype (GasDeliveryPeriods a0 e0 e1 e2) =
CommodityDeliveryPeriods a0 e0
data GasPhysicalLeg = GasPhysicalLeg
{ gasPhysicLeg_ID :: Maybe Xsd.ID
, gasPhysicLeg_payerPartyReference :: Maybe PartyReference
, gasPhysicLeg_payerAccountReference :: Maybe AccountReference
, gasPhysicLeg_receiverPartyReference :: Maybe PartyReference
, gasPhysicLeg_receiverAccountReference :: Maybe AccountReference
, gasPhysicLeg_deliveryPeriods :: GasDeliveryPeriods
, gasPhysicLeg_gas :: GasProduct
, gasPhysicLeg_deliveryConditions :: Maybe GasDelivery
, gasPhysicLeg_deliveryQuantity :: GasPhysicalQuantity
}
deriving (Eq,Show)
instance SchemaType GasPhysicalLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (GasPhysicalLeg a0)
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` parseSchemaType "deliveryPeriods"
`apply` parseSchemaType "gas"
`apply` optional (parseSchemaType "deliveryConditions")
`apply` parseSchemaType "deliveryQuantity"
schemaTypeToXML s x@GasPhysicalLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ gasPhysicLeg_ID x
]
[ maybe [] (schemaTypeToXML "payerPartyReference") $ gasPhysicLeg_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ gasPhysicLeg_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ gasPhysicLeg_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ gasPhysicLeg_receiverAccountReference x
, schemaTypeToXML "deliveryPeriods" $ gasPhysicLeg_deliveryPeriods x
, schemaTypeToXML "gas" $ gasPhysicLeg_gas x
, maybe [] (schemaTypeToXML "deliveryConditions") $ gasPhysicLeg_deliveryConditions x
, schemaTypeToXML "deliveryQuantity" $ gasPhysicLeg_deliveryQuantity x
]
instance Extension GasPhysicalLeg PhysicalSwapLeg where
supertype v = PhysicalSwapLeg_GasPhysicalLeg v
instance Extension GasPhysicalLeg CommoditySwapLeg where
supertype = (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)
. (supertype :: GasPhysicalLeg -> PhysicalSwapLeg)
instance Extension GasPhysicalLeg Leg where
supertype = (supertype :: CommoditySwapLeg -> Leg)
. (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)
. (supertype :: GasPhysicalLeg -> PhysicalSwapLeg)
data GasPhysicalQuantity = GasPhysicalQuantity
{ gasPhysicQuant_ID :: Maybe Xsd.ID
, gasPhysicQuant_choice0 :: OneOf2 (((Maybe (OneOf2 CommodityNotionalQuantity CommodityPhysicalQuantitySchedule))),UnitQuantity) ([CommodityNotionalQuantity],[CommodityNotionalQuantity],(Maybe (PartyReference)))
}
deriving (Eq,Show)
instance SchemaType GasPhysicalQuantity where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (GasPhysicalQuantity a0)
`apply` oneOf' [ ("(Maybe (OneOf2 CommodityNotionalQuantity CommodityPhysicalQuantitySchedule)) UnitQuantity", fmap OneOf2 (return (,) `apply` optional (oneOf' [ ("CommodityNotionalQuantity", fmap OneOf2 (parseSchemaType "physicalQuantity"))
, ("CommodityPhysicalQuantitySchedule", fmap TwoOf2 (parseSchemaType "physicalQuantitySchedule"))
])
`apply` parseSchemaType "totalPhysicalQuantity"))
, ("[CommodityNotionalQuantity] [CommodityNotionalQuantity] Maybe PartyReference", fmap TwoOf2 (return (,,) `apply` many (parseSchemaType "minPhysicalQuantity")
`apply` many (parseSchemaType "maxPhysicalQuantity")
`apply` optional (parseSchemaType "electingParty")))
]
schemaTypeToXML s x@GasPhysicalQuantity{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ gasPhysicQuant_ID x
]
[ foldOneOf2 (\ (a,b) -> concat [ maybe [] (foldOneOf2 (schemaTypeToXML "physicalQuantity")
(schemaTypeToXML "physicalQuantitySchedule")
) a
, schemaTypeToXML "totalPhysicalQuantity" b
])
(\ (a,b,c) -> concat [ concatMap (schemaTypeToXML "minPhysicalQuantity") a
, concatMap (schemaTypeToXML "maxPhysicalQuantity") b
, maybe [] (schemaTypeToXML "electingParty") c
])
$ gasPhysicQuant_choice0 x
]
instance Extension GasPhysicalQuantity CommodityPhysicalQuantityBase where
supertype v = CommodityPhysicalQuantityBase_GasPhysicalQuantity v
data GasProduct = GasProduct
{ gasProduct_type :: GasProductTypeEnum
, gasProduct_choice1 :: (Maybe (OneOf2 NonNegativeDecimal GasQuality))
}
deriving (Eq,Show)
instance SchemaType GasProduct where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return GasProduct
`apply` parseSchemaType "type"
`apply` optional (oneOf' [ ("NonNegativeDecimal", fmap OneOf2 (parseSchemaType "calorificValue"))
, ("GasQuality", fmap TwoOf2 (parseSchemaType "quality"))
])
schemaTypeToXML s x@GasProduct{} =
toXMLElement s []
[ schemaTypeToXML "type" $ gasProduct_type x
, maybe [] (foldOneOf2 (schemaTypeToXML "calorificValue")
(schemaTypeToXML "quality")
) $ gasProduct_choice1 x
]
data GasQuality = GasQuality Scheme GasQualityAttributes deriving (Eq,Show)
data GasQualityAttributes = GasQualityAttributes
{ gasQualityAttrib_gasQualityScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType GasQuality where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "gasQualityScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ GasQuality v (GasQualityAttributes a0)
schemaTypeToXML s (GasQuality bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "gasQualityScheme") $ gasQualityAttrib_gasQualityScheme at
]
$ schemaTypeToXML s bt
instance Extension GasQuality Scheme where
supertype (GasQuality s _) = s
data Lag = Lag
{ lag_ID :: Maybe Xsd.ID
, lag_duration :: Maybe Period
, lag_firstObservationDateOffset :: Maybe Period
}
deriving (Eq,Show)
instance SchemaType Lag where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Lag a0)
`apply` optional (parseSchemaType "lagDuration")
`apply` optional (parseSchemaType "firstObservationDateOffset")
schemaTypeToXML s x@Lag{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ lag_ID x
]
[ maybe [] (schemaTypeToXML "lagDuration") $ lag_duration x
, maybe [] (schemaTypeToXML "firstObservationDateOffset") $ lag_firstObservationDateOffset x
]
data LagReference = LagReference
{ lagReference_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType LagReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (LagReference a0)
schemaTypeToXML s x@LagReference{} =
toXMLElement s [ toXMLAttribute "href" $ lagReference_href x
]
[]
instance Extension LagReference Reference where
supertype v = Reference_LagReference v
data MarketDisruptionEvent = MarketDisruptionEvent Scheme MarketDisruptionEventAttributes deriving (Eq,Show)
data MarketDisruptionEventAttributes = MarketDisruptionEventAttributes
{ marketDisrupEventAttrib_commodityMarketDisruptionScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType MarketDisruptionEvent where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "commodityMarketDisruptionScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ MarketDisruptionEvent v (MarketDisruptionEventAttributes a0)
schemaTypeToXML s (MarketDisruptionEvent bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "commodityMarketDisruptionScheme") $ marketDisrupEventAttrib_commodityMarketDisruptionScheme at
]
$ schemaTypeToXML s bt
instance Extension MarketDisruptionEvent Scheme where
supertype (MarketDisruptionEvent s _) = s
data NonPeriodicFixedPriceLeg = NonPeriodicFixedPriceLeg
{ nonPeriodFixedPriceLeg_ID :: Maybe Xsd.ID
, nonPeriodFixedPriceLeg_payerPartyReference :: Maybe PartyReference
, nonPeriodFixedPriceLeg_payerAccountReference :: Maybe AccountReference
, nonPeriodFixedPriceLeg_receiverPartyReference :: Maybe PartyReference
, nonPeriodFixedPriceLeg_receiverAccountReference :: Maybe AccountReference
, nonPeriodFixedPriceLeg_fixedPrice :: FixedPrice
, nonPeriodFixedPriceLeg_totalPrice :: Maybe NonNegativeMoney
, nonPeriodFixedPriceLeg_quantityReference :: Maybe QuantityReference
, nonPeriodFixedPriceLeg_choice7 :: OneOf2 CommodityRelativePaymentDates ((Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean)))
}
deriving (Eq,Show)
instance SchemaType NonPeriodicFixedPriceLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (NonPeriodicFixedPriceLeg a0)
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` parseSchemaType "fixedPrice"
`apply` optional (parseSchemaType "totalPrice")
`apply` optional (parseSchemaType "quantityReference")
`apply` oneOf' [ ("CommodityRelativePaymentDates", fmap OneOf2 (parseSchemaType "relativePaymentDates"))
, ("(Maybe (OneOf2 AdjustableDatesOrRelativeDateOffset Xsd.Boolean))", fmap TwoOf2 (optional (oneOf' [ ("AdjustableDatesOrRelativeDateOffset", fmap OneOf2 (parseSchemaType "paymentDates"))
, ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "masterAgreementPaymentDates"))
])))
]
schemaTypeToXML s x@NonPeriodicFixedPriceLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ nonPeriodFixedPriceLeg_ID x
]
[ maybe [] (schemaTypeToXML "payerPartyReference") $ nonPeriodFixedPriceLeg_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ nonPeriodFixedPriceLeg_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ nonPeriodFixedPriceLeg_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ nonPeriodFixedPriceLeg_receiverAccountReference x
, schemaTypeToXML "fixedPrice" $ nonPeriodFixedPriceLeg_fixedPrice x
, maybe [] (schemaTypeToXML "totalPrice") $ nonPeriodFixedPriceLeg_totalPrice x
, maybe [] (schemaTypeToXML "quantityReference") $ nonPeriodFixedPriceLeg_quantityReference x
, foldOneOf2 (schemaTypeToXML "relativePaymentDates")
(maybe [] (foldOneOf2 (schemaTypeToXML "paymentDates")
(schemaTypeToXML "masterAgreementPaymentDates")
))
$ nonPeriodFixedPriceLeg_choice7 x
]
instance Extension NonPeriodicFixedPriceLeg CommoditySwapLeg where
supertype v = CommoditySwapLeg_NonPeriodicFixedPriceLeg v
instance Extension NonPeriodicFixedPriceLeg Leg where
supertype = (supertype :: CommoditySwapLeg -> Leg)
. (supertype :: NonPeriodicFixedPriceLeg -> CommoditySwapLeg)
data OilDelivery = OilDelivery
{ oilDelivery_choice0 :: (Maybe (OneOf2 OilPipelineDelivery OilTransferDelivery))
, oilDelivery_importerOfRecord :: Maybe PartyReference
, oilDelivery_choice2 :: (Maybe (OneOf2 AbsoluteTolerance PercentageTolerance))
}
deriving (Eq,Show)
instance SchemaType OilDelivery where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return OilDelivery
`apply` optional (oneOf' [ ("OilPipelineDelivery", fmap OneOf2 (parseSchemaType "pipeline"))
, ("OilTransferDelivery", fmap TwoOf2 (parseSchemaType "transfer"))
])
`apply` optional (parseSchemaType "importerOfRecord")
`apply` optional (oneOf' [ ("AbsoluteTolerance", fmap OneOf2 (parseSchemaType "absoluteTolerance"))
, ("PercentageTolerance", fmap TwoOf2 (parseSchemaType "percentageTolerance"))
])
schemaTypeToXML s x@OilDelivery{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "pipeline")
(schemaTypeToXML "transfer")
) $ oilDelivery_choice0 x
, maybe [] (schemaTypeToXML "importerOfRecord") $ oilDelivery_importerOfRecord x
, maybe [] (foldOneOf2 (schemaTypeToXML "absoluteTolerance")
(schemaTypeToXML "percentageTolerance")
) $ oilDelivery_choice2 x
]
data OilPhysicalLeg = OilPhysicalLeg
{ oilPhysicLeg_ID :: Maybe Xsd.ID
, oilPhysicLeg_payerPartyReference :: Maybe PartyReference
, oilPhysicLeg_payerAccountReference :: Maybe AccountReference
, oilPhysicLeg_receiverPartyReference :: Maybe PartyReference
, oilPhysicLeg_receiverAccountReference :: Maybe AccountReference
, oilPhysicLeg_deliveryPeriods :: Maybe CommodityDeliveryPeriods
, oilPhysicLeg_oil :: OilProduct
, oilPhysicLeg_deliveryConditions :: Maybe OilDelivery
, oilPhysicLeg_deliveryQuantity :: CommodityPhysicalQuantity
}
deriving (Eq,Show)
instance SchemaType OilPhysicalLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (OilPhysicalLeg a0)
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` optional (parseSchemaType "deliveryPeriods")
`apply` parseSchemaType "oil"
`apply` optional (parseSchemaType "deliveryConditions")
`apply` parseSchemaType "deliveryQuantity"
schemaTypeToXML s x@OilPhysicalLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ oilPhysicLeg_ID x
]
[ maybe [] (schemaTypeToXML "payerPartyReference") $ oilPhysicLeg_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ oilPhysicLeg_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ oilPhysicLeg_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ oilPhysicLeg_receiverAccountReference x
, maybe [] (schemaTypeToXML "deliveryPeriods") $ oilPhysicLeg_deliveryPeriods x
, schemaTypeToXML "oil" $ oilPhysicLeg_oil x
, maybe [] (schemaTypeToXML "deliveryConditions") $ oilPhysicLeg_deliveryConditions x
, schemaTypeToXML "deliveryQuantity" $ oilPhysicLeg_deliveryQuantity x
]
instance Extension OilPhysicalLeg PhysicalSwapLeg where
supertype v = PhysicalSwapLeg_OilPhysicalLeg v
instance Extension OilPhysicalLeg CommoditySwapLeg where
supertype = (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)
. (supertype :: OilPhysicalLeg -> PhysicalSwapLeg)
instance Extension OilPhysicalLeg Leg where
supertype = (supertype :: CommoditySwapLeg -> Leg)
. (supertype :: PhysicalSwapLeg -> CommoditySwapLeg)
. (supertype :: OilPhysicalLeg -> PhysicalSwapLeg)
data OilPipelineDelivery = OilPipelineDelivery
{ oilPipelDeliv_pipelineName :: Maybe CommodityPipeline
, oilPipelDeliv_withdrawalPoint :: Maybe CommodityDeliveryPoint
, oilPipelDeliv_entryPoint :: Maybe CommodityDeliveryPoint
, oilPipelDeliv_deliverableByBarge :: Maybe Xsd.Boolean
, oilPipelDeliv_risk :: Maybe CommodityDeliveryRisk
, oilPipelDeliv_cycle :: [CommodityPipelineCycle]
}
deriving (Eq,Show)
instance SchemaType OilPipelineDelivery where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return OilPipelineDelivery
`apply` optional (parseSchemaType "pipelineName")
`apply` optional (parseSchemaType "withdrawalPoint")
`apply` optional (parseSchemaType "entryPoint")
`apply` optional (parseSchemaType "deliverableByBarge")
`apply` optional (parseSchemaType "risk")
`apply` many (parseSchemaType "cycle")
schemaTypeToXML s x@OilPipelineDelivery{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "pipelineName") $ oilPipelDeliv_pipelineName x
, maybe [] (schemaTypeToXML "withdrawalPoint") $ oilPipelDeliv_withdrawalPoint x
, maybe [] (schemaTypeToXML "entryPoint") $ oilPipelDeliv_entryPoint x
, maybe [] (schemaTypeToXML "deliverableByBarge") $ oilPipelDeliv_deliverableByBarge x
, maybe [] (schemaTypeToXML "risk") $ oilPipelDeliv_risk x
, concatMap (schemaTypeToXML "cycle") $ oilPipelDeliv_cycle x
]
data OilProduct = OilProduct
{ oilProduct_type :: OilProductType
, oilProduct_grade :: CommodityProductGrade
}
deriving (Eq,Show)
instance SchemaType OilProduct where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return OilProduct
`apply` parseSchemaType "type"
`apply` parseSchemaType "grade"
schemaTypeToXML s x@OilProduct{} =
toXMLElement s []
[ schemaTypeToXML "type" $ oilProduct_type x
, schemaTypeToXML "grade" $ oilProduct_grade x
]
data OilProductType = OilProductType Scheme OilProductTypeAttributes deriving (Eq,Show)
data OilProductTypeAttributes = OilProductTypeAttributes
{ oilProductTypeAttrib_commodityOilProductTypeScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType OilProductType where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "commodityOilProductTypeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ OilProductType v (OilProductTypeAttributes a0)
schemaTypeToXML s (OilProductType bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "commodityOilProductTypeScheme") $ oilProductTypeAttrib_commodityOilProductTypeScheme at
]
$ schemaTypeToXML s bt
instance Extension OilProductType Scheme where
supertype (OilProductType s _) = s
data OilTransferDelivery = OilTransferDelivery
{ oilTransfDeliv_applicable :: Maybe Xsd.Boolean
, oilTransfDeliv_deliveryLocation :: Maybe CommodityDeliveryPoint
}
deriving (Eq,Show)
instance SchemaType OilTransferDelivery where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return OilTransferDelivery
`apply` optional (parseSchemaType "applicable")
`apply` optional (parseSchemaType "deliveryLocation")
schemaTypeToXML s x@OilTransferDelivery{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "applicable") $ oilTransfDeliv_applicable x
, maybe [] (schemaTypeToXML "deliveryLocation") $ oilTransfDeliv_deliveryLocation x
]
data PercentageTolerance = PercentageTolerance
{ percenToler_postitive :: Maybe RestrictedPercentage
, percenToler_negative :: Maybe RestrictedPercentage
, percenToler_option :: Maybe PartyReference
}
deriving (Eq,Show)
instance SchemaType PercentageTolerance where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return PercentageTolerance
`apply` optional (parseSchemaType "postitive")
`apply` optional (parseSchemaType "negative")
`apply` optional (parseSchemaType "option")
schemaTypeToXML s x@PercentageTolerance{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "postitive") $ percenToler_postitive x
, maybe [] (schemaTypeToXML "negative") $ percenToler_negative x
, maybe [] (schemaTypeToXML "option") $ percenToler_option x
]
data PhysicalForwardLeg
= PhysicalForwardLeg_BullionPhysicalLeg BullionPhysicalLeg
deriving (Eq,Show)
instance SchemaType PhysicalForwardLeg where
parseSchemaType s = do
(fmap PhysicalForwardLeg_BullionPhysicalLeg $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of PhysicalForwardLeg,\n\
\ namely one of:\n\
\BullionPhysicalLeg"
schemaTypeToXML _s (PhysicalForwardLeg_BullionPhysicalLeg x) = schemaTypeToXML "bullionPhysicalLeg" x
instance Extension PhysicalForwardLeg CommodityForwardLeg where
supertype v = CommodityForwardLeg_PhysicalForwardLeg v
data PhysicalSwapLeg
= PhysicalSwapLeg_OilPhysicalLeg OilPhysicalLeg
| PhysicalSwapLeg_GasPhysicalLeg GasPhysicalLeg
| PhysicalSwapLeg_ElectricityPhysicalLeg ElectricityPhysicalLeg
| PhysicalSwapLeg_CoalPhysicalLeg CoalPhysicalLeg
deriving (Eq,Show)
instance SchemaType PhysicalSwapLeg where
parseSchemaType s = do
(fmap PhysicalSwapLeg_OilPhysicalLeg $ parseSchemaType s)
`onFail`
(fmap PhysicalSwapLeg_GasPhysicalLeg $ parseSchemaType s)
`onFail`
(fmap PhysicalSwapLeg_ElectricityPhysicalLeg $ parseSchemaType s)
`onFail`
(fmap PhysicalSwapLeg_CoalPhysicalLeg $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of PhysicalSwapLeg,\n\
\ namely one of:\n\
\OilPhysicalLeg,GasPhysicalLeg,ElectricityPhysicalLeg,CoalPhysicalLeg"
schemaTypeToXML _s (PhysicalSwapLeg_OilPhysicalLeg x) = schemaTypeToXML "oilPhysicalLeg" x
schemaTypeToXML _s (PhysicalSwapLeg_GasPhysicalLeg x) = schemaTypeToXML "gasPhysicalLeg" x
schemaTypeToXML _s (PhysicalSwapLeg_ElectricityPhysicalLeg x) = schemaTypeToXML "electricityPhysicalLeg" x
schemaTypeToXML _s (PhysicalSwapLeg_CoalPhysicalLeg x) = schemaTypeToXML "coalPhysicalLeg" x
instance Extension PhysicalSwapLeg CommoditySwapLeg where
supertype v = CommoditySwapLeg_PhysicalSwapLeg v
data QuantityScheduleReference = QuantityScheduleReference
{ quantSchedRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType QuantityScheduleReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (QuantityScheduleReference a0)
schemaTypeToXML s x@QuantityScheduleReference{} =
toXMLElement s [ toXMLAttribute "href" $ quantSchedRef_href x
]
[]
instance Extension QuantityScheduleReference Reference where
supertype v = Reference_QuantityScheduleReference v
data QuantityReference = QuantityReference
{ quantRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType QuantityReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (QuantityReference a0)
schemaTypeToXML s x@QuantityReference{} =
toXMLElement s [ toXMLAttribute "href" $ quantRef_href x
]
[]
instance Extension QuantityReference Reference where
supertype v = Reference_QuantityReference v
data SequencedDisruptionFallback = SequencedDisruptionFallback
{ sequenDisrupFallb_fallback :: Maybe DisruptionFallback
, sequenDisrupFallb_sequence :: Maybe Xsd.PositiveInteger
}
deriving (Eq,Show)
instance SchemaType SequencedDisruptionFallback where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return SequencedDisruptionFallback
`apply` optional (parseSchemaType "fallback")
`apply` optional (parseSchemaType "sequence")
schemaTypeToXML s x@SequencedDisruptionFallback{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "fallback") $ sequenDisrupFallb_fallback x
, maybe [] (schemaTypeToXML "sequence") $ sequenDisrupFallb_sequence x
]
data SettlementPeriods = SettlementPeriods
{ settlPeriods_ID :: Maybe Xsd.ID
, settlPeriods_duration :: Maybe SettlementPeriodDurationEnum
, settlPeriods_applicableDay :: [DayOfWeekEnum]
, settlPeriods_startTime :: Maybe OffsetPrevailingTime
, settlPeriods_endTime :: Maybe OffsetPrevailingTime
, settlPeriods_choice4 :: (Maybe (OneOf2 CommodityBusinessCalendar CommodityBusinessCalendar))
}
deriving (Eq,Show)
instance SchemaType SettlementPeriods where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (SettlementPeriods a0)
`apply` optional (parseSchemaType "duration")
`apply` between (Occurs (Just 0) (Just 7))
(parseSchemaType "applicableDay")
`apply` optional (parseSchemaType "startTime")
`apply` optional (parseSchemaType "endTime")
`apply` optional (oneOf' [ ("CommodityBusinessCalendar", fmap OneOf2 (parseSchemaType "excludeHolidays"))
, ("CommodityBusinessCalendar", fmap TwoOf2 (parseSchemaType "includeHolidays"))
])
schemaTypeToXML s x@SettlementPeriods{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ settlPeriods_ID x
]
[ maybe [] (schemaTypeToXML "duration") $ settlPeriods_duration x
, concatMap (schemaTypeToXML "applicableDay") $ settlPeriods_applicableDay x
, maybe [] (schemaTypeToXML "startTime") $ settlPeriods_startTime x
, maybe [] (schemaTypeToXML "endTime") $ settlPeriods_endTime x
, maybe [] (foldOneOf2 (schemaTypeToXML "excludeHolidays")
(schemaTypeToXML "includeHolidays")
) $ settlPeriods_choice4 x
]
data SettlementPeriodsFixedPrice = SettlementPeriodsFixedPrice
{ settlPeriodsFixedPrice_ID :: Maybe Xsd.ID
, settlPeriodsFixedPrice_price :: Xsd.Decimal
, settlPeriodsFixedPrice_priceCurrency :: Currency
, settlPeriodsFixedPrice_priceUnit :: QuantityUnit
, settlPeriodsFixedPrice_settlementPeriodsReference :: [SettlementPeriodsReference]
}
deriving (Eq,Show)
instance SchemaType SettlementPeriodsFixedPrice where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (SettlementPeriodsFixedPrice a0)
`apply` parseSchemaType "price"
`apply` parseSchemaType "priceCurrency"
`apply` parseSchemaType "priceUnit"
`apply` many (parseSchemaType "settlementPeriodsReference")
schemaTypeToXML s x@SettlementPeriodsFixedPrice{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ settlPeriodsFixedPrice_ID x
]
[ schemaTypeToXML "price" $ settlPeriodsFixedPrice_price x
, schemaTypeToXML "priceCurrency" $ settlPeriodsFixedPrice_priceCurrency x
, schemaTypeToXML "priceUnit" $ settlPeriodsFixedPrice_priceUnit x
, concatMap (schemaTypeToXML "settlementPeriodsReference") $ settlPeriodsFixedPrice_settlementPeriodsReference x
]
instance Extension SettlementPeriodsFixedPrice FixedPrice where
supertype (SettlementPeriodsFixedPrice a0 e0 e1 e2 e3) =
FixedPrice a0 e0 e1 e2
data SettlementPeriodsReference = SettlementPeriodsReference
{ settlPeriodsRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType SettlementPeriodsReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (SettlementPeriodsReference a0)
schemaTypeToXML s x@SettlementPeriodsReference{} =
toXMLElement s [ toXMLAttribute "href" $ settlPeriodsRef_href x
]
[]
instance Extension SettlementPeriodsReference Reference where
supertype v = Reference_SettlementPeriodsReference v
data SettlementPeriodsSchedule = SettlementPeriodsSchedule
{ settlPeriodsSched_settlementPeriodsStep :: [SettlementPeriodsStep]
, settlPeriodsSched_choice1 :: (Maybe (OneOf2 CalculationPeriodsReference CalculationPeriodsScheduleReference))
}
deriving (Eq,Show)
instance SchemaType SettlementPeriodsSchedule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return SettlementPeriodsSchedule
`apply` many (parseSchemaType "settlementPeriodsStep")
`apply` optional (oneOf' [ ("CalculationPeriodsReference", fmap OneOf2 (parseSchemaType "deliveryPeriodsReference"))
, ("CalculationPeriodsScheduleReference", fmap TwoOf2 (parseSchemaType "deliveryPeriodsScheduleReference"))
])
schemaTypeToXML s x@SettlementPeriodsSchedule{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "settlementPeriodsStep") $ settlPeriodsSched_settlementPeriodsStep x
, maybe [] (foldOneOf2 (schemaTypeToXML "deliveryPeriodsReference")
(schemaTypeToXML "deliveryPeriodsScheduleReference")
) $ settlPeriodsSched_choice1 x
]
data SettlementPeriodsStep = SettlementPeriodsStep
{ settlPeriodsStep_settlementPeriodsReference :: [SettlementPeriodsReference]
}
deriving (Eq,Show)
instance SchemaType SettlementPeriodsStep where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return SettlementPeriodsStep
`apply` many (parseSchemaType "settlementPeriodsReference")
schemaTypeToXML s x@SettlementPeriodsStep{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "settlementPeriodsReference") $ settlPeriodsStep_settlementPeriodsReference x
]
data UnitQuantity = UnitQuantity
{ unitQuantity_ID :: Maybe Xsd.ID
, unitQuantity_quantityUnit :: QuantityUnit
, unitQuantity_quantity :: NonNegativeDecimal
}
deriving (Eq,Show)
instance SchemaType UnitQuantity where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (UnitQuantity a0)
`apply` parseSchemaType "quantityUnit"
`apply` parseSchemaType "quantity"
schemaTypeToXML s x@UnitQuantity{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ unitQuantity_ID x
]
[ schemaTypeToXML "quantityUnit" $ unitQuantity_quantityUnit x
, schemaTypeToXML "quantity" $ unitQuantity_quantity x
]
elementBullionPhysicalLeg :: XMLParser BullionPhysicalLeg
elementBullionPhysicalLeg = parseSchemaType "bullionPhysicalLeg"
elementToXMLBullionPhysicalLeg :: BullionPhysicalLeg -> [Content ()]
elementToXMLBullionPhysicalLeg = schemaTypeToXML "bullionPhysicalLeg"
elementCoalPhysicalLeg :: XMLParser CoalPhysicalLeg
elementCoalPhysicalLeg = parseSchemaType "coalPhysicalLeg"
elementToXMLCoalPhysicalLeg :: CoalPhysicalLeg -> [Content ()]
elementToXMLCoalPhysicalLeg = schemaTypeToXML "coalPhysicalLeg"
elementCommodityForward :: XMLParser CommodityForward
elementCommodityForward = parseSchemaType "commodityForward"
elementToXMLCommodityForward :: CommodityForward -> [Content ()]
elementToXMLCommodityForward = schemaTypeToXML "commodityForward"
elementCommodityForwardLeg :: XMLParser CommodityForwardLeg
elementCommodityForwardLeg = fmap supertype elementBullionPhysicalLeg
`onFail` fail "Parse failed when expecting an element in the substitution group for\n\
\ <commodityForwardLeg>,\n\
\ namely one of:\n\
\<bullionPhysicalLeg>"
elementToXMLCommodityForwardLeg :: CommodityForwardLeg -> [Content ()]
elementToXMLCommodityForwardLeg = schemaTypeToXML "commodityForwardLeg"
elementCommodityOption :: XMLParser CommodityOption
elementCommodityOption = parseSchemaType "commodityOption"
elementToXMLCommodityOption :: CommodityOption -> [Content ()]
elementToXMLCommodityOption = schemaTypeToXML "commodityOption"
elementCommoditySwap :: XMLParser CommoditySwap
elementCommoditySwap = parseSchemaType "commoditySwap"
elementToXMLCommoditySwap :: CommoditySwap -> [Content ()]
elementToXMLCommoditySwap = schemaTypeToXML "commoditySwap"
elementCommoditySwaption :: XMLParser CommoditySwaption
elementCommoditySwaption = parseSchemaType "commoditySwaption"
elementToXMLCommoditySwaption :: CommoditySwaption -> [Content ()]
elementToXMLCommoditySwaption = schemaTypeToXML "commoditySwaption"
elementCommoditySwapLeg :: XMLParser CommoditySwapLeg
elementCommoditySwapLeg = fmap supertype elementOilPhysicalLeg
`onFail`
fmap supertype elementGasPhysicalLeg
`onFail`
fmap supertype elementFloatingLeg
`onFail`
fmap supertype elementFixedLeg
`onFail`
fmap supertype elementElectricityPhysicalLeg
`onFail`
fmap supertype elementCoalPhysicalLeg
`onFail` fail "Parse failed when expecting an element in the substitution group for\n\
\ <commoditySwapLeg>,\n\
\ namely one of:\n\
\<oilPhysicalLeg>, <gasPhysicalLeg>, <floatingLeg>, <fixedLeg>, <electricityPhysicalLeg>, <coalPhysicalLeg>"
elementToXMLCommoditySwapLeg :: CommoditySwapLeg -> [Content ()]
elementToXMLCommoditySwapLeg = schemaTypeToXML "commoditySwapLeg"
elementElectricityPhysicalLeg :: XMLParser ElectricityPhysicalLeg
elementElectricityPhysicalLeg = parseSchemaType "electricityPhysicalLeg"
elementToXMLElectricityPhysicalLeg :: ElectricityPhysicalLeg -> [Content ()]
elementToXMLElectricityPhysicalLeg = schemaTypeToXML "electricityPhysicalLeg"
elementFixedLeg :: XMLParser FixedPriceLeg
elementFixedLeg = parseSchemaType "fixedLeg"
elementToXMLFixedLeg :: FixedPriceLeg -> [Content ()]
elementToXMLFixedLeg = schemaTypeToXML "fixedLeg"
elementFloatingLeg :: XMLParser FloatingPriceLeg
elementFloatingLeg = parseSchemaType "floatingLeg"
elementToXMLFloatingLeg :: FloatingPriceLeg -> [Content ()]
elementToXMLFloatingLeg = schemaTypeToXML "floatingLeg"
elementGasPhysicalLeg :: XMLParser GasPhysicalLeg
elementGasPhysicalLeg = parseSchemaType "gasPhysicalLeg"
elementToXMLGasPhysicalLeg :: GasPhysicalLeg -> [Content ()]
elementToXMLGasPhysicalLeg = schemaTypeToXML "gasPhysicalLeg"
elementOilPhysicalLeg :: XMLParser OilPhysicalLeg
elementOilPhysicalLeg = parseSchemaType "oilPhysicalLeg"
elementToXMLOilPhysicalLeg :: OilPhysicalLeg -> [Content ()]
elementToXMLOilPhysicalLeg = schemaTypeToXML "oilPhysicalLeg"