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
|
module TeaCleaner.Types
( Activity(..)
, User(..)
) where
import TeaCleaner.Options (jsonOptions)
import Data.Int (Int64)
import Data.Text (Text)
import qualified Data.Aeson.TH as Aeson
import Data.Time (ZonedTime(..))
data User = User
{ id :: Int64
, login :: Text
, loginName :: Text
, fullName :: Text
, email :: Text
, avatarUrl :: Text
, language :: Text
, isAdmin :: Bool
, lastLogin :: ZonedTime
, created :: ZonedTime
, restricted :: Bool
, active :: Bool
, prohibitLogin :: Bool
, location :: Text
, website :: Text
, description :: Text
, visibility :: Text
, followersCount :: Int
, followingCount :: Int
, starredReposCount :: Int
, username :: Text
} deriving (Show)
$(Aeson.deriveJSON jsonOptions ''User)
data Activity = Activity
{ actUserId :: Int64
-- , comment Comment
, commentId :: Int64
, content :: Text
, created :: ZonedTime
, id :: Int64
, isPrivate :: Bool
, opType :: Text
, refName :: Text
-- repo Repository{...}
, repoId :: Int64
, userId :: Int64
} deriving (Show)
$(Aeson.deriveJSON jsonOptions ''Activity)
|