@@ -12,6 +12,8 @@ import GitHub.Internal.Prelude
1212
1313import Prelude ()
1414
15+ import qualified Data.Text as T
16+
1517data RepoStarred = RepoStarred
1618 { repoStarredStarredAt :: ! UTCTime
1719 , repoStarredRepo :: ! Repo
@@ -65,18 +67,18 @@ instance NFData NotificationReason where rnf = genericRnf
6567instance Binary NotificationReason
6668
6769instance FromJSON NotificationReason where
68- parseJSON = withText " NotificationReason" $ \ t -> case t of
69- " assign" -> pure AssignReason
70- " author" -> pure AuthorReason
71- " comment" -> pure CommentReason
72- " invitation" -> pure InvitationReason
73- " manual" -> pure ManualReason
74- " mention" -> pure MentionReason
70+ parseJSON = withText " NotificationReason" $ \ t -> case T. toLower t of
71+ " assign" -> pure AssignReason
72+ " author" -> pure AuthorReason
73+ " comment" -> pure CommentReason
74+ " invitation" -> pure InvitationReason
75+ " manual" -> pure ManualReason
76+ " mention" -> pure MentionReason
7577 " review_requested" -> pure ReviewRequestedReason
76- " state_change" -> pure StateChangeReason
77- " subscribed" -> pure SubscribedReason
78- " team_mention" -> pure TeamMentionReason
79- _ -> fail $ " Unknown NotificationReason " ++ show t
78+ " state_change" -> pure StateChangeReason
79+ " subscribed" -> pure SubscribedReason
80+ " team_mention" -> pure TeamMentionReason
81+ _ -> fail $ " Unknown NotificationReason " ++ show t
8082
8183data Notification = Notification
8284 -- XXX: The notification id field type IS in fact string. Not sure why gh
0 commit comments