aboutsummaryrefslogtreecommitdiff
path: root/gtfs/GTFS/Realtime/Alert/Effect.hs
blob: dcaa77d3af085be5ee0189ef9bf8953d03fd7ce0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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