diff options
Diffstat (limited to 'gtfs/GTFS/Realtime/Alert')
-rw-r--r-- | gtfs/GTFS/Realtime/Alert/Cause.hs | 118 | ||||
-rw-r--r-- | gtfs/GTFS/Realtime/Alert/Effect.hs | 114 | ||||
-rw-r--r-- | gtfs/GTFS/Realtime/Alert/SeverityLevel.hs | 76 |
3 files changed, 308 insertions, 0 deletions
diff --git a/gtfs/GTFS/Realtime/Alert/Cause.hs b/gtfs/GTFS/Realtime/Alert/Cause.hs new file mode 100644 index 0000000..9f71db7 --- /dev/null +++ b/gtfs/GTFS/Realtime/Alert/Cause.hs @@ -0,0 +1,118 @@ +{-# LANGUAGE BangPatterns, DataKinds, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings + #-} +{-# OPTIONS_GHC -w #-} +module GTFS.Realtime.Alert.Cause (Cause(..)) where +import Prelude ((+), (/), (.)) +import qualified Prelude as Prelude' +import qualified Data.List as Prelude' +import qualified Data.Typeable as Prelude' +import qualified GHC.Generics as Prelude' +import qualified Data.Data as Prelude' +import qualified Text.ProtocolBuffers.Header as P' + +data Cause = UNKNOWN_CAUSE + | OTHER_CAUSE + | TECHNICAL_PROBLEM + | STRIKE + | DEMONSTRATION + | ACCIDENT + | HOLIDAY + | WEATHER + | MAINTENANCE + | CONSTRUCTION + | POLICE_ACTIVITY + | MEDICAL_EMERGENCY + deriving (Prelude'.Read, Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic) + +instance P'.Mergeable Cause + +instance Prelude'.Bounded Cause where + minBound = UNKNOWN_CAUSE + maxBound = MEDICAL_EMERGENCY + +instance P'.Default Cause where + defaultValue = UNKNOWN_CAUSE + +toMaybe'Enum :: Prelude'.Int -> P'.Maybe Cause +toMaybe'Enum 1 = Prelude'.Just UNKNOWN_CAUSE +toMaybe'Enum 2 = Prelude'.Just OTHER_CAUSE +toMaybe'Enum 3 = Prelude'.Just TECHNICAL_PROBLEM +toMaybe'Enum 4 = Prelude'.Just STRIKE +toMaybe'Enum 5 = Prelude'.Just DEMONSTRATION +toMaybe'Enum 6 = Prelude'.Just ACCIDENT +toMaybe'Enum 7 = Prelude'.Just HOLIDAY +toMaybe'Enum 8 = Prelude'.Just WEATHER +toMaybe'Enum 9 = Prelude'.Just MAINTENANCE +toMaybe'Enum 10 = Prelude'.Just CONSTRUCTION +toMaybe'Enum 11 = Prelude'.Just POLICE_ACTIVITY +toMaybe'Enum 12 = Prelude'.Just MEDICAL_EMERGENCY +toMaybe'Enum _ = Prelude'.Nothing + +instance Prelude'.Enum Cause where + fromEnum UNKNOWN_CAUSE = 1 + fromEnum OTHER_CAUSE = 2 + fromEnum TECHNICAL_PROBLEM = 3 + fromEnum STRIKE = 4 + fromEnum DEMONSTRATION = 5 + fromEnum ACCIDENT = 6 + fromEnum HOLIDAY = 7 + fromEnum WEATHER = 8 + fromEnum MAINTENANCE = 9 + fromEnum CONSTRUCTION = 10 + fromEnum POLICE_ACTIVITY = 11 + fromEnum MEDICAL_EMERGENCY = 12 + toEnum = P'.fromMaybe (Prelude'.error "hprotoc generated code: toEnum failure for type GTFS.Realtime.Alert.Cause") . toMaybe'Enum + succ UNKNOWN_CAUSE = OTHER_CAUSE + succ OTHER_CAUSE = TECHNICAL_PROBLEM + succ TECHNICAL_PROBLEM = STRIKE + succ STRIKE = DEMONSTRATION + succ DEMONSTRATION = ACCIDENT + succ ACCIDENT = HOLIDAY + succ HOLIDAY = WEATHER + succ WEATHER = MAINTENANCE + succ MAINTENANCE = CONSTRUCTION + succ CONSTRUCTION = POLICE_ACTIVITY + succ POLICE_ACTIVITY = MEDICAL_EMERGENCY + succ _ = Prelude'.error "hprotoc generated code: succ failure for type GTFS.Realtime.Alert.Cause" + pred OTHER_CAUSE = UNKNOWN_CAUSE + pred TECHNICAL_PROBLEM = OTHER_CAUSE + pred STRIKE = TECHNICAL_PROBLEM + pred DEMONSTRATION = STRIKE + pred ACCIDENT = DEMONSTRATION + pred HOLIDAY = ACCIDENT + pred WEATHER = HOLIDAY + pred MAINTENANCE = WEATHER + pred CONSTRUCTION = MAINTENANCE + pred POLICE_ACTIVITY = CONSTRUCTION + pred MEDICAL_EMERGENCY = POLICE_ACTIVITY + pred _ = Prelude'.error "hprotoc generated code: pred failure for type GTFS.Realtime.Alert.Cause" + +instance P'.Wire Cause where + wireSize ft' enum = P'.wireSize ft' (Prelude'.fromEnum enum) + wirePut ft' enum = P'.wirePut ft' (Prelude'.fromEnum enum) + wireGet 14 = P'.wireGetEnum toMaybe'Enum + wireGet ft' = P'.wireGetErr ft' + wireGetPacked 14 = P'.wireGetPackedEnum toMaybe'Enum + wireGetPacked ft' = P'.wireGetErr ft' + +instance P'.GPB Cause + +instance P'.MessageAPI msg' (msg' -> Cause) Cause where + getVal m' f' = f' m' + +instance P'.ReflectEnum Cause where + reflectEnum + = [(1, "UNKNOWN_CAUSE", UNKNOWN_CAUSE), (2, "OTHER_CAUSE", OTHER_CAUSE), (3, "TECHNICAL_PROBLEM", TECHNICAL_PROBLEM), + (4, "STRIKE", STRIKE), (5, "DEMONSTRATION", DEMONSTRATION), (6, "ACCIDENT", ACCIDENT), (7, "HOLIDAY", HOLIDAY), + (8, "WEATHER", WEATHER), (9, "MAINTENANCE", MAINTENANCE), (10, "CONSTRUCTION", CONSTRUCTION), + (11, "POLICE_ACTIVITY", POLICE_ACTIVITY), (12, "MEDICAL_EMERGENCY", MEDICAL_EMERGENCY)] + reflectEnumInfo _ + = P'.EnumInfo (P'.makePNF (P'.pack ".transit_realtime.Alert.Cause") [] ["GTFS", "Realtime", "Alert"] "Cause") + ["GTFS", "Realtime", "Alert", "Cause.hs"] + [(1, "UNKNOWN_CAUSE"), (2, "OTHER_CAUSE"), (3, "TECHNICAL_PROBLEM"), (4, "STRIKE"), (5, "DEMONSTRATION"), (6, "ACCIDENT"), + (7, "HOLIDAY"), (8, "WEATHER"), (9, "MAINTENANCE"), (10, "CONSTRUCTION"), (11, "POLICE_ACTIVITY"), (12, "MEDICAL_EMERGENCY")] + Prelude'.False + +instance P'.TextType Cause where + tellT = P'.tellShow + getT = P'.getRead
\ No newline at end of file diff --git a/gtfs/GTFS/Realtime/Alert/Effect.hs b/gtfs/GTFS/Realtime/Alert/Effect.hs new file mode 100644 index 0000000..dcaa77d --- /dev/null +++ b/gtfs/GTFS/Realtime/Alert/Effect.hs @@ -0,0 +1,114 @@ +{-# LANGUAGE BangPatterns, DataKinds, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings + #-} +{-# OPTIONS_GHC -w #-} +module GTFS.Realtime.Alert.Effect (Effect(..)) where +import Prelude ((+), (/), (.)) +import qualified Prelude as Prelude' +import qualified Data.List as Prelude' +import qualified Data.Typeable as Prelude' +import qualified GHC.Generics as Prelude' +import qualified Data.Data as Prelude' +import qualified Text.ProtocolBuffers.Header as P' + +data Effect = NO_SERVICE + | REDUCED_SERVICE + | SIGNIFICANT_DELAYS + | DETOUR + | ADDITIONAL_SERVICE + | MODIFIED_SERVICE + | OTHER_EFFECT + | UNKNOWN_EFFECT + | STOP_MOVED + | NO_EFFECT + | ACCESSIBILITY_ISSUE + deriving (Prelude'.Read, Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic) + +instance P'.Mergeable Effect + +instance Prelude'.Bounded Effect where + minBound = NO_SERVICE + maxBound = ACCESSIBILITY_ISSUE + +instance P'.Default Effect where + defaultValue = NO_SERVICE + +toMaybe'Enum :: Prelude'.Int -> P'.Maybe Effect +toMaybe'Enum 1 = Prelude'.Just NO_SERVICE +toMaybe'Enum 2 = Prelude'.Just REDUCED_SERVICE +toMaybe'Enum 3 = Prelude'.Just SIGNIFICANT_DELAYS +toMaybe'Enum 4 = Prelude'.Just DETOUR +toMaybe'Enum 5 = Prelude'.Just ADDITIONAL_SERVICE +toMaybe'Enum 6 = Prelude'.Just MODIFIED_SERVICE +toMaybe'Enum 7 = Prelude'.Just OTHER_EFFECT +toMaybe'Enum 8 = Prelude'.Just UNKNOWN_EFFECT +toMaybe'Enum 9 = Prelude'.Just STOP_MOVED +toMaybe'Enum 10 = Prelude'.Just NO_EFFECT +toMaybe'Enum 11 = Prelude'.Just ACCESSIBILITY_ISSUE +toMaybe'Enum _ = Prelude'.Nothing + +instance Prelude'.Enum Effect where + fromEnum NO_SERVICE = 1 + fromEnum REDUCED_SERVICE = 2 + fromEnum SIGNIFICANT_DELAYS = 3 + fromEnum DETOUR = 4 + fromEnum ADDITIONAL_SERVICE = 5 + fromEnum MODIFIED_SERVICE = 6 + fromEnum OTHER_EFFECT = 7 + fromEnum UNKNOWN_EFFECT = 8 + fromEnum STOP_MOVED = 9 + fromEnum NO_EFFECT = 10 + fromEnum ACCESSIBILITY_ISSUE = 11 + toEnum = P'.fromMaybe (Prelude'.error "hprotoc generated code: toEnum failure for type GTFS.Realtime.Alert.Effect") . toMaybe'Enum + succ NO_SERVICE = REDUCED_SERVICE + succ REDUCED_SERVICE = SIGNIFICANT_DELAYS + succ SIGNIFICANT_DELAYS = DETOUR + succ DETOUR = ADDITIONAL_SERVICE + succ ADDITIONAL_SERVICE = MODIFIED_SERVICE + succ MODIFIED_SERVICE = OTHER_EFFECT + succ OTHER_EFFECT = UNKNOWN_EFFECT + succ UNKNOWN_EFFECT = STOP_MOVED + succ STOP_MOVED = NO_EFFECT + succ NO_EFFECT = ACCESSIBILITY_ISSUE + succ _ = Prelude'.error "hprotoc generated code: succ failure for type GTFS.Realtime.Alert.Effect" + pred REDUCED_SERVICE = NO_SERVICE + pred SIGNIFICANT_DELAYS = REDUCED_SERVICE + pred DETOUR = SIGNIFICANT_DELAYS + pred ADDITIONAL_SERVICE = DETOUR + pred MODIFIED_SERVICE = ADDITIONAL_SERVICE + pred OTHER_EFFECT = MODIFIED_SERVICE + pred UNKNOWN_EFFECT = OTHER_EFFECT + pred STOP_MOVED = UNKNOWN_EFFECT + pred NO_EFFECT = STOP_MOVED + pred ACCESSIBILITY_ISSUE = NO_EFFECT + pred _ = Prelude'.error "hprotoc generated code: pred failure for type GTFS.Realtime.Alert.Effect" + +instance P'.Wire Effect where + wireSize ft' enum = P'.wireSize ft' (Prelude'.fromEnum enum) + wirePut ft' enum = P'.wirePut ft' (Prelude'.fromEnum enum) + wireGet 14 = P'.wireGetEnum toMaybe'Enum + wireGet ft' = P'.wireGetErr ft' + wireGetPacked 14 = P'.wireGetPackedEnum toMaybe'Enum + wireGetPacked ft' = P'.wireGetErr ft' + +instance P'.GPB Effect + +instance P'.MessageAPI msg' (msg' -> Effect) Effect where + getVal m' f' = f' m' + +instance P'.ReflectEnum Effect where + reflectEnum + = [(1, "NO_SERVICE", NO_SERVICE), (2, "REDUCED_SERVICE", REDUCED_SERVICE), (3, "SIGNIFICANT_DELAYS", SIGNIFICANT_DELAYS), + (4, "DETOUR", DETOUR), (5, "ADDITIONAL_SERVICE", ADDITIONAL_SERVICE), (6, "MODIFIED_SERVICE", MODIFIED_SERVICE), + (7, "OTHER_EFFECT", OTHER_EFFECT), (8, "UNKNOWN_EFFECT", UNKNOWN_EFFECT), (9, "STOP_MOVED", STOP_MOVED), + (10, "NO_EFFECT", NO_EFFECT), (11, "ACCESSIBILITY_ISSUE", ACCESSIBILITY_ISSUE)] + reflectEnumInfo _ + = P'.EnumInfo (P'.makePNF (P'.pack ".transit_realtime.Alert.Effect") [] ["GTFS", "Realtime", "Alert"] "Effect") + ["GTFS", "Realtime", "Alert", "Effect.hs"] + [(1, "NO_SERVICE"), (2, "REDUCED_SERVICE"), (3, "SIGNIFICANT_DELAYS"), (4, "DETOUR"), (5, "ADDITIONAL_SERVICE"), + (6, "MODIFIED_SERVICE"), (7, "OTHER_EFFECT"), (8, "UNKNOWN_EFFECT"), (9, "STOP_MOVED"), (10, "NO_EFFECT"), + (11, "ACCESSIBILITY_ISSUE")] + Prelude'.False + +instance P'.TextType Effect where + tellT = P'.tellShow + getT = P'.getRead
\ No newline at end of file diff --git a/gtfs/GTFS/Realtime/Alert/SeverityLevel.hs b/gtfs/GTFS/Realtime/Alert/SeverityLevel.hs new file mode 100644 index 0000000..bb50ff3 --- /dev/null +++ b/gtfs/GTFS/Realtime/Alert/SeverityLevel.hs @@ -0,0 +1,76 @@ +{-# LANGUAGE BangPatterns, DataKinds, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings + #-} +{-# OPTIONS_GHC -w #-} +module GTFS.Realtime.Alert.SeverityLevel (SeverityLevel(..)) where +import Prelude ((+), (/), (.)) +import qualified Prelude as Prelude' +import qualified Data.List as Prelude' +import qualified Data.Typeable as Prelude' +import qualified GHC.Generics as Prelude' +import qualified Data.Data as Prelude' +import qualified Text.ProtocolBuffers.Header as P' + +data SeverityLevel = UNKNOWN_SEVERITY + | INFO + | WARNING + | SEVERE + deriving (Prelude'.Read, Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, + Prelude'.Generic) + +instance P'.Mergeable SeverityLevel + +instance Prelude'.Bounded SeverityLevel where + minBound = UNKNOWN_SEVERITY + maxBound = SEVERE + +instance P'.Default SeverityLevel where + defaultValue = UNKNOWN_SEVERITY + +toMaybe'Enum :: Prelude'.Int -> P'.Maybe SeverityLevel +toMaybe'Enum 1 = Prelude'.Just UNKNOWN_SEVERITY +toMaybe'Enum 2 = Prelude'.Just INFO +toMaybe'Enum 3 = Prelude'.Just WARNING +toMaybe'Enum 4 = Prelude'.Just SEVERE +toMaybe'Enum _ = Prelude'.Nothing + +instance Prelude'.Enum SeverityLevel where + fromEnum UNKNOWN_SEVERITY = 1 + fromEnum INFO = 2 + fromEnum WARNING = 3 + fromEnum SEVERE = 4 + toEnum + = P'.fromMaybe (Prelude'.error "hprotoc generated code: toEnum failure for type GTFS.Realtime.Alert.SeverityLevel") . + toMaybe'Enum + succ UNKNOWN_SEVERITY = INFO + succ INFO = WARNING + succ WARNING = SEVERE + succ _ = Prelude'.error "hprotoc generated code: succ failure for type GTFS.Realtime.Alert.SeverityLevel" + pred INFO = UNKNOWN_SEVERITY + pred WARNING = INFO + pred SEVERE = WARNING + pred _ = Prelude'.error "hprotoc generated code: pred failure for type GTFS.Realtime.Alert.SeverityLevel" + +instance P'.Wire SeverityLevel where + wireSize ft' enum = P'.wireSize ft' (Prelude'.fromEnum enum) + wirePut ft' enum = P'.wirePut ft' (Prelude'.fromEnum enum) + wireGet 14 = P'.wireGetEnum toMaybe'Enum + wireGet ft' = P'.wireGetErr ft' + wireGetPacked 14 = P'.wireGetPackedEnum toMaybe'Enum + wireGetPacked ft' = P'.wireGetErr ft' + +instance P'.GPB SeverityLevel + +instance P'.MessageAPI msg' (msg' -> SeverityLevel) SeverityLevel where + getVal m' f' = f' m' + +instance P'.ReflectEnum SeverityLevel where + reflectEnum = [(1, "UNKNOWN_SEVERITY", UNKNOWN_SEVERITY), (2, "INFO", INFO), (3, "WARNING", WARNING), (4, "SEVERE", SEVERE)] + reflectEnumInfo _ + = P'.EnumInfo (P'.makePNF (P'.pack ".transit_realtime.Alert.SeverityLevel") [] ["GTFS", "Realtime", "Alert"] "SeverityLevel") + ["GTFS", "Realtime", "Alert", "SeverityLevel.hs"] + [(1, "UNKNOWN_SEVERITY"), (2, "INFO"), (3, "WARNING"), (4, "SEVERE")] + Prelude'.False + +instance P'.TextType SeverityLevel where + tellT = P'.tellShow + getT = P'.getRead
\ No newline at end of file |