Skip to content

Commit

Permalink
Add draft option to mergeable state
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-abrar committed Feb 14, 2020
1 parent ce8ece7 commit b9d2d1b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/GitHub/Data/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ data MergeableState
| StateUnstable
| StateBlocked
| StateBehind
| StateDraft
deriving
(Eq, Ord, Show, Enum, Bounded, Generic, Typeable, Data)

Expand All @@ -108,6 +109,7 @@ instance ToJSON MergeableState where
toJSON StateUnstable = String "unstable"
toJSON StateBlocked = String "blocked"
toJSON StateBehind = String "behind"
toJSON StateDraft = String "draft"

instance FromJSON MergeableState where
parseJSON = withText "MergeableState" $ \t -> case T.toLower t of
Expand All @@ -117,6 +119,7 @@ instance FromJSON MergeableState where
"unstable" -> pure StateUnstable
"blocked" -> pure StateBlocked
"behind" -> pure StateBehind
"draft" -> pure StateDraft
_ -> fail $ "Unknown MergeableState: " <> T.unpack t

instance NFData MergeableState where rnf = genericRnf
Expand Down

0 comments on commit b9d2d1b

Please sign in to comment.