1module GitHub.Data.Checks
7 CheckAnnotationLevel (..),
14import Data.Aeson.Types
15import Data.Text (Text)
16import Data.Vector (Vector)
17import GHC.Generics (Generic)
19import GitHub.Internal.Prelude (UTCTime)
22 { checkName :: !(Name Check)
23 , checkSha :: !(Name Commit)
24 , checkDetailsURL :: !(Maybe URL)
25 , checkExternalId :: !(Maybe (Id Check))
26 , checkStatus :: !(Maybe CheckStatus)
27 , checkStartedAt :: !(Maybe UTCTime)
28 , checkConclusion :: !(Maybe CheckConclusion)
29 , checkCompletedAt :: !(Maybe UTCTime)
30 , checkOutput :: !(Maybe CheckOutput)
31 , checkActions :: !(Maybe (Vector CheckAction))
33 deriving stock (Show, Eq, Ord, Generic)
35instance ToJSON Check where
36 toJSON (Check n sha durl eid s sa c ca o a) =
40 , "details_url" .= durl
41 , "external_id" .= eid
45 , "completed_at" .= ca
54 deriving stock (Show, Enum, Bounded, Eq, Ord, Generic)
56instance ToJSON CheckStatus where
57 toJSON CheckQueued = String "queued"
58 toJSON CheckInProgress = String "in_progress"
59 toJSON CheckCompleted = String "completed"
70 deriving stock (Show, Enum, Bounded, Eq, Ord, Generic)
72instance ToJSON CheckConclusion where
73 toJSON CheckActionRequired = String "action_required"
74 toJSON CheckCancelled = String "cancelled"
75 toJSON CheckFailure = String "failure"
76 toJSON CheckNeutral = String "neutral"
77 toJSON CheckSuccess = String "success"
78 toJSON CheckSkipped = String "skipped"
79 toJSON CheckStale = String "stale"
80 toJSON CheckTimedOut = String "timed_out"
82data CheckOutput = CheckOutput
84 , checkSummary :: !Text
85 , checkText :: !(Maybe Text)
86 , checkAnnotations :: !(Maybe (Vector CheckAnnotation))
87 , checkImages :: !(Maybe (Vector CheckImage))
89 deriving stock (Show, Eq, Ord, Generic)
91instance ToJSON CheckOutput where
92 toJSON (CheckOutput t s txt a i) =
101data CheckAnnotation = CheckAnnotation
103 , checkStartLine :: !Int
104 , checkEndLine :: !Int
105 , checkStartColumn :: !(Maybe Int)
106 , checkEndColumn :: !(Maybe Int)
107 , checkAnnotationLevel :: !CheckAnnotationLevel
108 , checkMessage :: !Text
109 , checkTitle :: !(Maybe Text)
110 , checkRawDetails :: !(Maybe Text)
112 deriving stock (Show, Eq, Ord, Generic)
114instance ToJSON CheckAnnotation where
115 toJSON (CheckAnnotation p sl el sc ec al m t rd) =
120 , "start_column" .= sc
122 , "annotation_level" .= al
125 , "raw_details" .= rd
128data CheckAnnotationLevel
132 deriving stock (Show, Enum, Bounded, Eq, Ord, Generic)
134instance ToJSON CheckAnnotationLevel where
135 toJSON NoticeAnnotation = String "notice"
136 toJSON WarningAnnotation = String "warning"
137 toJSON FailureAnnotation = String "failure"
139data CheckImage = CheckImage
140 { checkImageAlt :: !Text
141 , checkImageURL :: !URL
142 , checkImageCaption :: !(Maybe Text)
144 deriving stock (Show, Eq, Ord, Generic)
146instance ToJSON CheckImage where
147 toJSON (CheckImage a url c) =
154data CheckAction = CheckAction
155 { checkActionLabel :: !Text
156 , checkActionDescription :: !Text
157 , checkActionIdentifier :: !Text
159 deriving stock (Show, Eq, Ord, Generic)
161instance ToJSON CheckAction where
162 toJSON (CheckAction l d i) =
169object' :: [Pair] -> Value
170object' = object . filter notNull
172 notNull (_, Null) = False
173 notNull (_, _) = True
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list