By | fr33domlover |
At | 2015-09-18 |
Title | write initial source with types from funbot |
Description |
Edit file src/FunBot/ExtEvents.hs 33188 → 33188
+ 1 {- This file is part of funbot-ext-events.
+ 2 -
+ 3 - Written in 2015 by fr33domlover <fr33domlover@rel4tion.org>.
+ 4 -
+ 5 - ♡ Copying is an act of love. Please copy, reuse and share.
+ 6 -
+ 7 - The author(s) have dedicated all copyright and related and neighboring
+ 8 - rights to this software to the public domain worldwide. This software is
+ 9 - distributed without any warranty.
+ 10 -
+ 11 - You should have received a copy of the CC0 Public Domain Dedication along
+ 12 - with this software. If not, see
+ 13 - <http://creativecommons.org/publicdomain/zero/1.0/>.
+ 14 -}
+ 15 + 16 module FunBot.ExtEvents
+ 17 ( Branch (..)
+ 18 , Commit (..)
+ 19 , Push (..)
+ 20 , Tag (..)
+ 21 , MergeRequest (..)
+ 22 , NewsItem (..)
+ 23 , Paste (..)
+ 24 , ExtEvent (..)
+ 25 )
+ 26 where
+ 27 + 28 data Branch = Branch
+ 29 { branchName :: String
+ 30 , branchRepo :: String
+ 31 , branchRepoOwner :: String
+ 32 }
+ 33 deriving Show
+ 34 + 35 data Commit = Commit
+ 36 { commitAuthor :: String
+ 37 , commitTitle :: String
+ 38 , commitUrl :: String
+ 39 }
+ 40 deriving Show
+ 41 + 42 data Push = Push
+ 43 { pushBranch :: Branch
+ 44 , pushCommits :: [Commit]
+ 45 }
+ 46 deriving Show
+ 47 + 48 data Tag = Tag
+ 49 { tagAuthor :: String
+ 50 , tagRef :: String
+ 51 , tagRepo :: String
+ 52 , tagRepoOwner :: String
+ 53 }
+ 54 deriving Show
+ 55 + 56 data MergeRequest = MergeRequest
+ 57 { mrAuthor :: String
+ 58 , mrId :: Int
+ 59 , mrRepo :: String
+ 60 , mrRepoOwner :: String
+ 61 , mrTitle :: String
+ 62 , mrUrl :: String
+ 63 , mrAction :: String
+ 64 }
+ 65 deriving Show
+ 66 + 67 data NewsItem = NewsItem
+ 68 { itemFeedLabel :: String
+ 69 , itemFeedTitle :: Maybe String
+ 70 , itemTitle :: String
+ 71 , itemAuthor :: Maybe String
+ 72 , itemUrl :: Maybe String
+ 73 }
+ 74 deriving Show
+ 75 + 76 data Paste = Paste
+ 77 { pasteAuthor :: String
+ 78 , pasteVerb :: String
+ 79 , pasteTitle :: String
+ 80 , pasteUrl :: String
+ 81 , pasteChannel :: String
+ 82 }
+ 83 deriving Show
+ 84 + 85 -- | An event coming from one of the external event sources.
+ 86 data ExtEvent
+ 87 = GitPushEvent Push
+ 88 | GitTagEvent Tag
+ 89 | MergeRequestEvent MergeRequest
+ 90 | NewsEvent NewsItem
+ 91 | PasteEvent Paste
+ 92 deriving Show
… … … …