forked from haskell-github/github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvents.hs
More file actions
33 lines (29 loc) · 865 Bytes
/
Events.hs
File metadata and controls
33 lines (29 loc) · 865 Bytes
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
-----------------------------------------------------------------------------
-- |
-- License : BSD-3-Clause
-- Maintainer : Oleg Grenrus <oleg.grenrus@iki.fi>
--
module GitHub.Data.Events where
import GitHub.Data.Definitions
import GitHub.Internal.Prelude
import Prelude ()
-- | Events.
--
-- /TODO:/
--
-- * missing repo, org, payload, id
data Event = Event
-- { eventId :: !(Id Event) -- id can be encoded as string.
{ eventActor :: !SimpleUser
, eventCreatedAt :: !UTCTime
, eventPublic :: !Bool
}
deriving (Show, Data, Typeable, Eq, Ord, Generic)
instance NFData Event where rnf = genericRnf
instance Binary Event
instance FromJSON Event where
parseJSON = withObject "Event" $ \obj -> Event
-- <$> obj .: "id"
<$> obj .: "actor"
<*> obj .: "created_at"
<*> obj .: "public"