{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric      #-}
{-# LANGUAGE NoImplicitPrelude  #-}
{-# LANGUAGE OverloadedStrings  #-}
module GitHub.Data.Statuses where

import GitHub.Data.Definitions
import GitHub.Data.Name        (Name)
import GitHub.Data.Id          (Id)
import GitHub.Data.URL         (URL)
import GitHub.Internal.Prelude
import Prelude ()

import GitHub.Data.GitData (Commit)
import GitHub.Data.Repos   (RepoRef)

import qualified Data.Text as T

data StatusState
    = StatusPending
    | StatusSuccess
    | StatusError
    | StatusFailure
  deriving (Int -> StatusState -> ShowS
[StatusState] -> ShowS
StatusState -> String
(Int -> StatusState -> ShowS)
-> (StatusState -> String)
-> ([StatusState] -> ShowS)
-> Show StatusState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StatusState -> ShowS
showsPrec :: Int -> StatusState -> ShowS
$cshow :: StatusState -> String
show :: StatusState -> String
$cshowList :: [StatusState] -> ShowS
showList :: [StatusState] -> ShowS
Show, Typeable StatusState
Typeable StatusState =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> StatusState -> c StatusState)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c StatusState)
-> (StatusState -> Constr)
-> (StatusState -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c StatusState))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c StatusState))
-> ((forall b. Data b => b -> b) -> StatusState -> StatusState)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> StatusState -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> StatusState -> r)
-> (forall u. (forall d. Data d => d -> u) -> StatusState -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> StatusState -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> StatusState -> m StatusState)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> StatusState -> m StatusState)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> StatusState -> m StatusState)
-> Data StatusState
StatusState -> Constr
StatusState -> DataType
(forall b. Data b => b -> b) -> StatusState -> StatusState
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> StatusState -> u
forall u. (forall d. Data d => d -> u) -> StatusState -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> StatusState -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> StatusState -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> StatusState -> m StatusState
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> StatusState -> m StatusState
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c StatusState
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> StatusState -> c StatusState
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c StatusState)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c StatusState)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> StatusState -> c StatusState
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> StatusState -> c StatusState
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c StatusState
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c StatusState
$ctoConstr :: StatusState -> Constr
toConstr :: StatusState -> Constr
$cdataTypeOf :: StatusState -> DataType
dataTypeOf :: StatusState -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c StatusState)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c StatusState)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c StatusState)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c StatusState)
$cgmapT :: (forall b. Data b => b -> b) -> StatusState -> StatusState
gmapT :: (forall b. Data b => b -> b) -> StatusState -> StatusState
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> StatusState -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> StatusState -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> StatusState -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> StatusState -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> StatusState -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> StatusState -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> StatusState -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> StatusState -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> StatusState -> m StatusState
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> StatusState -> m StatusState
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> StatusState -> m StatusState
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> StatusState -> m StatusState
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> StatusState -> m StatusState
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> StatusState -> m StatusState
Data, Int -> StatusState
StatusState -> Int
StatusState -> [StatusState]
StatusState -> StatusState
StatusState -> StatusState -> [StatusState]
StatusState -> StatusState -> StatusState -> [StatusState]
(StatusState -> StatusState)
-> (StatusState -> StatusState)
-> (Int -> StatusState)
-> (StatusState -> Int)
-> (StatusState -> [StatusState])
-> (StatusState -> StatusState -> [StatusState])
-> (StatusState -> StatusState -> [StatusState])
-> (StatusState -> StatusState -> StatusState -> [StatusState])
-> Enum StatusState
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: StatusState -> StatusState
succ :: StatusState -> StatusState
$cpred :: StatusState -> StatusState
pred :: StatusState -> StatusState
$ctoEnum :: Int -> StatusState
toEnum :: Int -> StatusState
$cfromEnum :: StatusState -> Int
fromEnum :: StatusState -> Int
$cenumFrom :: StatusState -> [StatusState]
enumFrom :: StatusState -> [StatusState]
$cenumFromThen :: StatusState -> StatusState -> [StatusState]
enumFromThen :: StatusState -> StatusState -> [StatusState]
$cenumFromTo :: StatusState -> StatusState -> [StatusState]
enumFromTo :: StatusState -> StatusState -> [StatusState]
$cenumFromThenTo :: StatusState -> StatusState -> StatusState -> [StatusState]
enumFromThenTo :: StatusState -> StatusState -> StatusState -> [StatusState]
Enum, StatusState
StatusState -> StatusState -> Bounded StatusState
forall a. a -> a -> Bounded a
$cminBound :: StatusState
minBound :: StatusState
$cmaxBound :: StatusState
maxBound :: StatusState
Bounded, Typeable, StatusState -> StatusState -> Bool
(StatusState -> StatusState -> Bool)
-> (StatusState -> StatusState -> Bool) -> Eq StatusState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StatusState -> StatusState -> Bool
== :: StatusState -> StatusState -> Bool
$c/= :: StatusState -> StatusState -> Bool
/= :: StatusState -> StatusState -> Bool
Eq, Eq StatusState
Eq StatusState =>
(StatusState -> StatusState -> Ordering)
-> (StatusState -> StatusState -> Bool)
-> (StatusState -> StatusState -> Bool)
-> (StatusState -> StatusState -> Bool)
-> (StatusState -> StatusState -> Bool)
-> (StatusState -> StatusState -> StatusState)
-> (StatusState -> StatusState -> StatusState)
-> Ord StatusState
StatusState -> StatusState -> Bool
StatusState -> StatusState -> Ordering
StatusState -> StatusState -> StatusState
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: StatusState -> StatusState -> Ordering
compare :: StatusState -> StatusState -> Ordering
$c< :: StatusState -> StatusState -> Bool
< :: StatusState -> StatusState -> Bool
$c<= :: StatusState -> StatusState -> Bool
<= :: StatusState -> StatusState -> Bool
$c> :: StatusState -> StatusState -> Bool
> :: StatusState -> StatusState -> Bool
$c>= :: StatusState -> StatusState -> Bool
>= :: StatusState -> StatusState -> Bool
$cmax :: StatusState -> StatusState -> StatusState
max :: StatusState -> StatusState -> StatusState
$cmin :: StatusState -> StatusState -> StatusState
min :: StatusState -> StatusState -> StatusState
Ord, (forall x. StatusState -> Rep StatusState x)
-> (forall x. Rep StatusState x -> StatusState)
-> Generic StatusState
forall x. Rep StatusState x -> StatusState
forall x. StatusState -> Rep StatusState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. StatusState -> Rep StatusState x
from :: forall x. StatusState -> Rep StatusState x
$cto :: forall x. Rep StatusState x -> StatusState
to :: forall x. Rep StatusState x -> StatusState
Generic)

instance NFData StatusState where rnf :: StatusState -> ()
rnf = StatusState -> ()
forall a. (Generic a, GNFData (Rep a)) => a -> ()
genericRnf
instance Binary StatusState

instance FromJSON StatusState where
    parseJSON :: Value -> Parser StatusState
parseJSON = String
-> (Text -> Parser StatusState) -> Value -> Parser StatusState
forall a. String -> (Text -> Parser a) -> Value -> Parser a
withText String
"StatusState" ((Text -> Parser StatusState) -> Value -> Parser StatusState)
-> (Text -> Parser StatusState) -> Value -> Parser StatusState
forall a b. (a -> b) -> a -> b
$ \Text
t -> case Text -> Text
T.toLower Text
t of
        Text
"pending" -> StatusState -> Parser StatusState
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure StatusState
StatusPending
        Text
"success" -> StatusState -> Parser StatusState
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure StatusState
StatusSuccess
        Text
"error"   -> StatusState -> Parser StatusState
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure StatusState
StatusError
        Text
"failure" -> StatusState -> Parser StatusState
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure StatusState
StatusFailure
        Text
_         -> String -> Parser StatusState
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail (String -> Parser StatusState) -> String -> Parser StatusState
forall a b. (a -> b) -> a -> b
$ String
"Unknown StatusState: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Text -> String
T.unpack Text
t

instance ToJSON StatusState where
  toJSON :: StatusState -> Value
toJSON StatusState
StatusPending = Text -> Value
String Text
"pending"
  toJSON StatusState
StatusSuccess = Text -> Value
String Text
"success"
  toJSON StatusState
StatusError   = Text -> Value
String Text
"error"
  toJSON StatusState
StatusFailure = Text -> Value
String Text
"failure"


data Status = Status
    { Status -> UTCTime
statusCreatedAt   :: !UTCTime
    , Status -> UTCTime
statusUpdatedAt   :: !UTCTime
    , Status -> StatusState
statusState       :: !StatusState
    , Status -> Maybe URL
statusTargetUrl   :: !(Maybe URL)
    , Status -> Maybe Text
statusDescription :: !(Maybe Text)
    , Status -> Id Status
statusId          :: !(Id Status)
    , Status -> URL
statusUrl         :: !URL
    , Status -> Maybe Text
statusContext     :: !(Maybe Text)
    , Status -> Maybe SimpleUser
statusCreator     :: !(Maybe SimpleUser)
    }
  deriving (Int -> Status -> ShowS
[Status] -> ShowS
Status -> String
(Int -> Status -> ShowS)
-> (Status -> String) -> ([Status] -> ShowS) -> Show Status
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Status -> ShowS
showsPrec :: Int -> Status -> ShowS
$cshow :: Status -> String
show :: Status -> String
$cshowList :: [Status] -> ShowS
showList :: [Status] -> ShowS
Show, Typeable Status
Typeable Status =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Status -> c Status)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Status)
-> (Status -> Constr)
-> (Status -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Status))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Status))
-> ((forall b. Data b => b -> b) -> Status -> Status)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Status -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Status -> r)
-> (forall u. (forall d. Data d => d -> u) -> Status -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Status -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Status -> m Status)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Status -> m Status)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Status -> m Status)
-> Data Status
Status -> Constr
Status -> DataType
(forall b. Data b => b -> b) -> Status -> Status
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Status -> u
forall u. (forall d. Data d => d -> u) -> Status -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Status -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Status -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Status -> m Status
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Status -> m Status
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Status
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Status -> c Status
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Status)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Status)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Status -> c Status
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Status -> c Status
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Status
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Status
$ctoConstr :: Status -> Constr
toConstr :: Status -> Constr
$cdataTypeOf :: Status -> DataType
dataTypeOf :: Status -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Status)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Status)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Status)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Status)
$cgmapT :: (forall b. Data b => b -> b) -> Status -> Status
gmapT :: (forall b. Data b => b -> b) -> Status -> Status
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Status -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Status -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Status -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Status -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Status -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Status -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Status -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Status -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Status -> m Status
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Status -> m Status
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Status -> m Status
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Status -> m Status
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Status -> m Status
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Status -> m Status
Data, Typeable, Status -> Status -> Bool
(Status -> Status -> Bool)
-> (Status -> Status -> Bool) -> Eq Status
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Status -> Status -> Bool
== :: Status -> Status -> Bool
$c/= :: Status -> Status -> Bool
/= :: Status -> Status -> Bool
Eq, Eq Status
Eq Status =>
(Status -> Status -> Ordering)
-> (Status -> Status -> Bool)
-> (Status -> Status -> Bool)
-> (Status -> Status -> Bool)
-> (Status -> Status -> Bool)
-> (Status -> Status -> Status)
-> (Status -> Status -> Status)
-> Ord Status
Status -> Status -> Bool
Status -> Status -> Ordering
Status -> Status -> Status
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Status -> Status -> Ordering
compare :: Status -> Status -> Ordering
$c< :: Status -> Status -> Bool
< :: Status -> Status -> Bool
$c<= :: Status -> Status -> Bool
<= :: Status -> Status -> Bool
$c> :: Status -> Status -> Bool
> :: Status -> Status -> Bool
$c>= :: Status -> Status -> Bool
>= :: Status -> Status -> Bool
$cmax :: Status -> Status -> Status
max :: Status -> Status -> Status
$cmin :: Status -> Status -> Status
min :: Status -> Status -> Status
Ord, (forall x. Status -> Rep Status x)
-> (forall x. Rep Status x -> Status) -> Generic Status
forall x. Rep Status x -> Status
forall x. Status -> Rep Status x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Status -> Rep Status x
from :: forall x. Status -> Rep Status x
$cto :: forall x. Rep Status x -> Status
to :: forall x. Rep Status x -> Status
Generic)

instance FromJSON Status where
  parseJSON :: Value -> Parser Status
parseJSON = String -> (Object -> Parser Status) -> Value -> Parser Status
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"Status" ((Object -> Parser Status) -> Value -> Parser Status)
-> (Object -> Parser Status) -> Value -> Parser Status
forall a b. (a -> b) -> a -> b
$ \Object
o -> UTCTime
-> UTCTime
-> StatusState
-> Maybe URL
-> Maybe Text
-> Id Status
-> URL
-> Maybe Text
-> Maybe SimpleUser
-> Status
Status
      (UTCTime
 -> UTCTime
 -> StatusState
 -> Maybe URL
 -> Maybe Text
 -> Id Status
 -> URL
 -> Maybe Text
 -> Maybe SimpleUser
 -> Status)
-> Parser UTCTime
-> Parser
     (UTCTime
      -> StatusState
      -> Maybe URL
      -> Maybe Text
      -> Id Status
      -> URL
      -> Maybe Text
      -> Maybe SimpleUser
      -> Status)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser UTCTime
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"created_at"
      Parser
  (UTCTime
   -> StatusState
   -> Maybe URL
   -> Maybe Text
   -> Id Status
   -> URL
   -> Maybe Text
   -> Maybe SimpleUser
   -> Status)
-> Parser UTCTime
-> Parser
     (StatusState
      -> Maybe URL
      -> Maybe Text
      -> Id Status
      -> URL
      -> Maybe Text
      -> Maybe SimpleUser
      -> Status)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser UTCTime
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"updated_at"
      Parser
  (StatusState
   -> Maybe URL
   -> Maybe Text
   -> Id Status
   -> URL
   -> Maybe Text
   -> Maybe SimpleUser
   -> Status)
-> Parser StatusState
-> Parser
     (Maybe URL
      -> Maybe Text
      -> Id Status
      -> URL
      -> Maybe Text
      -> Maybe SimpleUser
      -> Status)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser StatusState
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"state"
      Parser
  (Maybe URL
   -> Maybe Text
   -> Id Status
   -> URL
   -> Maybe Text
   -> Maybe SimpleUser
   -> Status)
-> Parser (Maybe URL)
-> Parser
     (Maybe Text
      -> Id Status -> URL -> Maybe Text -> Maybe SimpleUser -> Status)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser (Maybe URL)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"target_url"
      Parser
  (Maybe Text
   -> Id Status -> URL -> Maybe Text -> Maybe SimpleUser -> Status)
-> Parser (Maybe Text)
-> Parser
     (Id Status -> URL -> Maybe Text -> Maybe SimpleUser -> Status)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"description"
      Parser
  (Id Status -> URL -> Maybe Text -> Maybe SimpleUser -> Status)
-> Parser (Id Status)
-> Parser (URL -> Maybe Text -> Maybe SimpleUser -> Status)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser (Id Status)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"id"
      Parser (URL -> Maybe Text -> Maybe SimpleUser -> Status)
-> Parser URL -> Parser (Maybe Text -> Maybe SimpleUser -> Status)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser URL
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"url"
      Parser (Maybe Text -> Maybe SimpleUser -> Status)
-> Parser (Maybe Text) -> Parser (Maybe SimpleUser -> Status)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"context"
      Parser (Maybe SimpleUser -> Status)
-> Parser (Maybe SimpleUser) -> Parser Status
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser (Maybe SimpleUser)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"creator"


data NewStatus = NewStatus
    { NewStatus -> StatusState
newStatusState       :: !StatusState
    , NewStatus -> Maybe URL
newStatusTargetUrl   :: !(Maybe URL)
    , NewStatus -> Maybe Text
newStatusDescription :: !(Maybe Text)
    , NewStatus -> Maybe Text
newStatusContext     :: !(Maybe Text)
    }
  deriving (Int -> NewStatus -> ShowS
[NewStatus] -> ShowS
NewStatus -> String
(Int -> NewStatus -> ShowS)
-> (NewStatus -> String)
-> ([NewStatus] -> ShowS)
-> Show NewStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NewStatus -> ShowS
showsPrec :: Int -> NewStatus -> ShowS
$cshow :: NewStatus -> String
show :: NewStatus -> String
$cshowList :: [NewStatus] -> ShowS
showList :: [NewStatus] -> ShowS
Show, Typeable NewStatus
Typeable NewStatus =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> NewStatus -> c NewStatus)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c NewStatus)
-> (NewStatus -> Constr)
-> (NewStatus -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c NewStatus))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NewStatus))
-> ((forall b. Data b => b -> b) -> NewStatus -> NewStatus)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> NewStatus -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> NewStatus -> r)
-> (forall u. (forall d. Data d => d -> u) -> NewStatus -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> NewStatus -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> NewStatus -> m NewStatus)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> NewStatus -> m NewStatus)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> NewStatus -> m NewStatus)
-> Data NewStatus
NewStatus -> Constr
NewStatus -> DataType
(forall b. Data b => b -> b) -> NewStatus -> NewStatus
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> NewStatus -> u
forall u. (forall d. Data d => d -> u) -> NewStatus -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NewStatus -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NewStatus -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NewStatus -> m NewStatus
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NewStatus -> m NewStatus
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NewStatus
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NewStatus -> c NewStatus
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NewStatus)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NewStatus)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NewStatus -> c NewStatus
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NewStatus -> c NewStatus
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NewStatus
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NewStatus
$ctoConstr :: NewStatus -> Constr
toConstr :: NewStatus -> Constr
$cdataTypeOf :: NewStatus -> DataType
dataTypeOf :: NewStatus -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NewStatus)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NewStatus)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NewStatus)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NewStatus)
$cgmapT :: (forall b. Data b => b -> b) -> NewStatus -> NewStatus
gmapT :: (forall b. Data b => b -> b) -> NewStatus -> NewStatus
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NewStatus -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NewStatus -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NewStatus -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NewStatus -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> NewStatus -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> NewStatus -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> NewStatus -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> NewStatus -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NewStatus -> m NewStatus
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NewStatus -> m NewStatus
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NewStatus -> m NewStatus
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NewStatus -> m NewStatus
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NewStatus -> m NewStatus
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NewStatus -> m NewStatus
Data, Typeable, NewStatus -> NewStatus -> Bool
(NewStatus -> NewStatus -> Bool)
-> (NewStatus -> NewStatus -> Bool) -> Eq NewStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NewStatus -> NewStatus -> Bool
== :: NewStatus -> NewStatus -> Bool
$c/= :: NewStatus -> NewStatus -> Bool
/= :: NewStatus -> NewStatus -> Bool
Eq, Eq NewStatus
Eq NewStatus =>
(NewStatus -> NewStatus -> Ordering)
-> (NewStatus -> NewStatus -> Bool)
-> (NewStatus -> NewStatus -> Bool)
-> (NewStatus -> NewStatus -> Bool)
-> (NewStatus -> NewStatus -> Bool)
-> (NewStatus -> NewStatus -> NewStatus)
-> (NewStatus -> NewStatus -> NewStatus)
-> Ord NewStatus
NewStatus -> NewStatus -> Bool
NewStatus -> NewStatus -> Ordering
NewStatus -> NewStatus -> NewStatus
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: NewStatus -> NewStatus -> Ordering
compare :: NewStatus -> NewStatus -> Ordering
$c< :: NewStatus -> NewStatus -> Bool
< :: NewStatus -> NewStatus -> Bool
$c<= :: NewStatus -> NewStatus -> Bool
<= :: NewStatus -> NewStatus -> Bool
$c> :: NewStatus -> NewStatus -> Bool
> :: NewStatus -> NewStatus -> Bool
$c>= :: NewStatus -> NewStatus -> Bool
>= :: NewStatus -> NewStatus -> Bool
$cmax :: NewStatus -> NewStatus -> NewStatus
max :: NewStatus -> NewStatus -> NewStatus
$cmin :: NewStatus -> NewStatus -> NewStatus
min :: NewStatus -> NewStatus -> NewStatus
Ord, (forall x. NewStatus -> Rep NewStatus x)
-> (forall x. Rep NewStatus x -> NewStatus) -> Generic NewStatus
forall x. Rep NewStatus x -> NewStatus
forall x. NewStatus -> Rep NewStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NewStatus -> Rep NewStatus x
from :: forall x. NewStatus -> Rep NewStatus x
$cto :: forall x. Rep NewStatus x -> NewStatus
to :: forall x. Rep NewStatus x -> NewStatus
Generic)

instance NFData NewStatus where rnf :: NewStatus -> ()
rnf = NewStatus -> ()
forall a. (Generic a, GNFData (Rep a)) => a -> ()
genericRnf
instance Binary NewStatus

instance ToJSON NewStatus where
    toJSON :: NewStatus -> Value
toJSON (NewStatus StatusState
s Maybe URL
t Maybe Text
d Maybe Text
c) = [Pair] -> Value
object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$ (Pair -> Bool) -> [Pair] -> [Pair]
forall a. (a -> Bool) -> [a] -> [a]
filter Pair -> Bool
forall {a}. (a, Value) -> Bool
notNull ([Pair] -> [Pair]) -> [Pair] -> [Pair]
forall a b. (a -> b) -> a -> b
$
        [ Key
"state"       Key -> StatusState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= StatusState
s
        , Key
"target_url"  Key -> Maybe URL -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe URL
t
        , Key
"description" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe Text
d
        , Key
"context"     Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe Text
c
        ]
      where
        notNull :: (a, Value) -> Bool
notNull (a
_, Value
Null) = Bool
False
        notNull (a
_, Value
_)    = Bool
True


data CombinedStatus = CombinedStatus
    { CombinedStatus -> StatusState
combinedStatusState      :: !StatusState
    , CombinedStatus -> Name Commit
combinedStatusSha        :: !(Name Commit)
    , CombinedStatus -> Int
combinedStatusTotalCount :: !Int
    , CombinedStatus -> Vector Status
combinedStatusStatuses   :: !(Vector Status)
    , CombinedStatus -> RepoRef
combinedStatusRepository :: !RepoRef
    , CombinedStatus -> URL
combinedStatusCommitUrl  :: !URL
    , CombinedStatus -> URL
combinedStatusUrl        :: !URL
    }
  deriving (Int -> CombinedStatus -> ShowS
[CombinedStatus] -> ShowS
CombinedStatus -> String
(Int -> CombinedStatus -> ShowS)
-> (CombinedStatus -> String)
-> ([CombinedStatus] -> ShowS)
-> Show CombinedStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CombinedStatus -> ShowS
showsPrec :: Int -> CombinedStatus -> ShowS
$cshow :: CombinedStatus -> String
show :: CombinedStatus -> String
$cshowList :: [CombinedStatus] -> ShowS
showList :: [CombinedStatus] -> ShowS
Show, Typeable CombinedStatus
Typeable CombinedStatus =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> CombinedStatus -> c CombinedStatus)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CombinedStatus)
-> (CombinedStatus -> Constr)
-> (CombinedStatus -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CombinedStatus))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c CombinedStatus))
-> ((forall b. Data b => b -> b)
    -> CombinedStatus -> CombinedStatus)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CombinedStatus -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CombinedStatus -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> CombinedStatus -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> CombinedStatus -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> CombinedStatus -> m CombinedStatus)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> CombinedStatus -> m CombinedStatus)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> CombinedStatus -> m CombinedStatus)
-> Data CombinedStatus
CombinedStatus -> Constr
CombinedStatus -> DataType
(forall b. Data b => b -> b) -> CombinedStatus -> CombinedStatus
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> CombinedStatus -> u
forall u. (forall d. Data d => d -> u) -> CombinedStatus -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CombinedStatus -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CombinedStatus -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CombinedStatus -> m CombinedStatus
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CombinedStatus -> m CombinedStatus
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CombinedStatus
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CombinedStatus -> c CombinedStatus
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CombinedStatus)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CombinedStatus)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CombinedStatus -> c CombinedStatus
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CombinedStatus -> c CombinedStatus
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CombinedStatus
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CombinedStatus
$ctoConstr :: CombinedStatus -> Constr
toConstr :: CombinedStatus -> Constr
$cdataTypeOf :: CombinedStatus -> DataType
dataTypeOf :: CombinedStatus -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CombinedStatus)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CombinedStatus)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CombinedStatus)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CombinedStatus)
$cgmapT :: (forall b. Data b => b -> b) -> CombinedStatus -> CombinedStatus
gmapT :: (forall b. Data b => b -> b) -> CombinedStatus -> CombinedStatus
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CombinedStatus -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CombinedStatus -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CombinedStatus -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CombinedStatus -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> CombinedStatus -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> CombinedStatus -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CombinedStatus -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CombinedStatus -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CombinedStatus -> m CombinedStatus
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CombinedStatus -> m CombinedStatus
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CombinedStatus -> m CombinedStatus
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CombinedStatus -> m CombinedStatus
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CombinedStatus -> m CombinedStatus
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CombinedStatus -> m CombinedStatus
Data, Typeable, CombinedStatus -> CombinedStatus -> Bool
(CombinedStatus -> CombinedStatus -> Bool)
-> (CombinedStatus -> CombinedStatus -> Bool) -> Eq CombinedStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CombinedStatus -> CombinedStatus -> Bool
== :: CombinedStatus -> CombinedStatus -> Bool
$c/= :: CombinedStatus -> CombinedStatus -> Bool
/= :: CombinedStatus -> CombinedStatus -> Bool
Eq, Eq CombinedStatus
Eq CombinedStatus =>
(CombinedStatus -> CombinedStatus -> Ordering)
-> (CombinedStatus -> CombinedStatus -> Bool)
-> (CombinedStatus -> CombinedStatus -> Bool)
-> (CombinedStatus -> CombinedStatus -> Bool)
-> (CombinedStatus -> CombinedStatus -> Bool)
-> (CombinedStatus -> CombinedStatus -> CombinedStatus)
-> (CombinedStatus -> CombinedStatus -> CombinedStatus)
-> Ord CombinedStatus
CombinedStatus -> CombinedStatus -> Bool
CombinedStatus -> CombinedStatus -> Ordering
CombinedStatus -> CombinedStatus -> CombinedStatus
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: CombinedStatus -> CombinedStatus -> Ordering
compare :: CombinedStatus -> CombinedStatus -> Ordering
$c< :: CombinedStatus -> CombinedStatus -> Bool
< :: CombinedStatus -> CombinedStatus -> Bool
$c<= :: CombinedStatus -> CombinedStatus -> Bool
<= :: CombinedStatus -> CombinedStatus -> Bool
$c> :: CombinedStatus -> CombinedStatus -> Bool
> :: CombinedStatus -> CombinedStatus -> Bool
$c>= :: CombinedStatus -> CombinedStatus -> Bool
>= :: CombinedStatus -> CombinedStatus -> Bool
$cmax :: CombinedStatus -> CombinedStatus -> CombinedStatus
max :: CombinedStatus -> CombinedStatus -> CombinedStatus
$cmin :: CombinedStatus -> CombinedStatus -> CombinedStatus
min :: CombinedStatus -> CombinedStatus -> CombinedStatus
Ord, (forall x. CombinedStatus -> Rep CombinedStatus x)
-> (forall x. Rep CombinedStatus x -> CombinedStatus)
-> Generic CombinedStatus
forall x. Rep CombinedStatus x -> CombinedStatus
forall x. CombinedStatus -> Rep CombinedStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CombinedStatus -> Rep CombinedStatus x
from :: forall x. CombinedStatus -> Rep CombinedStatus x
$cto :: forall x. Rep CombinedStatus x -> CombinedStatus
to :: forall x. Rep CombinedStatus x -> CombinedStatus
Generic)

instance FromJSON CombinedStatus where
    parseJSON :: Value -> Parser CombinedStatus
parseJSON = String
-> (Object -> Parser CombinedStatus)
-> Value
-> Parser CombinedStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"CombinedStatus" ((Object -> Parser CombinedStatus)
 -> Value -> Parser CombinedStatus)
-> (Object -> Parser CombinedStatus)
-> Value
-> Parser CombinedStatus
forall a b. (a -> b) -> a -> b
$ \Object
o -> StatusState
-> Name Commit
-> Int
-> Vector Status
-> RepoRef
-> URL
-> URL
-> CombinedStatus
CombinedStatus
        (StatusState
 -> Name Commit
 -> Int
 -> Vector Status
 -> RepoRef
 -> URL
 -> URL
 -> CombinedStatus)
-> Parser StatusState
-> Parser
     (Name Commit
      -> Int -> Vector Status -> RepoRef -> URL -> URL -> CombinedStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser StatusState
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"state"
        Parser
  (Name Commit
   -> Int -> Vector Status -> RepoRef -> URL -> URL -> CombinedStatus)
-> Parser (Name Commit)
-> Parser
     (Int -> Vector Status -> RepoRef -> URL -> URL -> CombinedStatus)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser (Name Commit)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"sha"
        Parser
  (Int -> Vector Status -> RepoRef -> URL -> URL -> CombinedStatus)
-> Parser Int
-> Parser
     (Vector Status -> RepoRef -> URL -> URL -> CombinedStatus)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser Int
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"total_count"
        Parser (Vector Status -> RepoRef -> URL -> URL -> CombinedStatus)
-> Parser (Vector Status)
-> Parser (RepoRef -> URL -> URL -> CombinedStatus)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser (Vector Status)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"statuses"
        Parser (RepoRef -> URL -> URL -> CombinedStatus)
-> Parser RepoRef -> Parser (URL -> URL -> CombinedStatus)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser RepoRef
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"repository"
        Parser (URL -> URL -> CombinedStatus)
-> Parser URL -> Parser (URL -> CombinedStatus)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser URL
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"commit_url"
        Parser (URL -> CombinedStatus)
-> Parser URL -> Parser CombinedStatus
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser URL
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"url"