{-# 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
showList :: [StatusState] -> ShowS
$cshowList :: [StatusState] -> ShowS
show :: StatusState -> String
$cshow :: StatusState -> String
showsPrec :: Int -> StatusState -> ShowS
$cshowsPrec :: Int -> StatusState -> ShowS
Show, Typeable StatusState
DataType
Constr
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 -> DataType
StatusState -> Constr
(forall b. Data b => b -> b) -> StatusState -> StatusState
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> StatusState -> c StatusState
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c 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)
$cStatusFailure :: Constr
$cStatusError :: Constr
$cStatusSuccess :: Constr
$cStatusPending :: Constr
$tStatusState :: DataType
gmapMo :: (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
gmapMp :: (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
gmapM :: (forall d. Data d => d -> m d) -> StatusState -> m StatusState
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> StatusState -> m StatusState
gmapQi :: Int -> (forall d. Data d => d -> u) -> StatusState -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> StatusState -> u
gmapQ :: (forall d. Data d => d -> u) -> StatusState -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> StatusState -> [u]
gmapQr :: (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
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> StatusState -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> StatusState -> r
gmapT :: (forall b. Data b => b -> b) -> StatusState -> StatusState
$cgmapT :: (forall b. Data b => b -> b) -> StatusState -> StatusState
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c StatusState)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c StatusState)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c StatusState)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c StatusState)
dataTypeOf :: StatusState -> DataType
$cdataTypeOf :: StatusState -> DataType
toConstr :: StatusState -> Constr
$ctoConstr :: StatusState -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c StatusState
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c StatusState
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> StatusState -> c StatusState
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> StatusState -> c StatusState
$cp1Data :: Typeable 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
enumFromThenTo :: StatusState -> StatusState -> StatusState -> [StatusState]
$cenumFromThenTo :: StatusState -> StatusState -> StatusState -> [StatusState]
enumFromTo :: StatusState -> StatusState -> [StatusState]
$cenumFromTo :: StatusState -> StatusState -> [StatusState]
enumFromThen :: StatusState -> StatusState -> [StatusState]
$cenumFromThen :: StatusState -> StatusState -> [StatusState]
enumFrom :: StatusState -> [StatusState]
$cenumFrom :: StatusState -> [StatusState]
fromEnum :: StatusState -> Int
$cfromEnum :: StatusState -> Int
toEnum :: Int -> StatusState
$ctoEnum :: Int -> StatusState
pred :: StatusState -> StatusState
$cpred :: StatusState -> StatusState
succ :: StatusState -> StatusState
$csucc :: StatusState -> StatusState
Enum, StatusState
StatusState -> StatusState -> Bounded StatusState
forall a. a -> a -> Bounded a
maxBound :: StatusState
$cmaxBound :: StatusState
minBound :: StatusState
$cminBound :: StatusState
Bounded, Typeable, StatusState -> StatusState -> Bool
(StatusState -> StatusState -> Bool)
-> (StatusState -> StatusState -> Bool) -> Eq StatusState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StatusState -> StatusState -> Bool
$c/= :: StatusState -> StatusState -> Bool
== :: StatusState -> StatusState -> Bool
$c== :: 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
min :: StatusState -> StatusState -> StatusState
$cmin :: StatusState -> StatusState -> StatusState
max :: StatusState -> StatusState -> StatusState
$cmax :: StatusState -> StatusState -> StatusState
>= :: StatusState -> StatusState -> Bool
$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
compare :: StatusState -> StatusState -> Ordering
$ccompare :: StatusState -> StatusState -> Ordering
$cp1Ord :: Eq 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
$cto :: forall x. Rep StatusState x -> StatusState
$cfrom :: forall x. StatusState -> Rep StatusState x
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 (f :: * -> *) a. Applicative f => a -> f a
pure StatusState
StatusPending
        Text
"success" -> StatusState -> Parser StatusState
forall (f :: * -> *) a. Applicative f => a -> f a
pure StatusState
StatusSuccess
        Text
"error"   -> StatusState -> Parser StatusState
forall (f :: * -> *) a. Applicative f => a -> f a
pure StatusState
StatusError
        Text
"failure" -> StatusState -> Parser StatusState
forall (f :: * -> *) a. Applicative f => a -> f a
pure StatusState
StatusFailure
        Text
_         -> String -> Parser StatusState
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
showList :: [Status] -> ShowS
$cshowList :: [Status] -> ShowS
show :: Status -> String
$cshow :: Status -> String
showsPrec :: Int -> Status -> ShowS
$cshowsPrec :: Int -> Status -> ShowS
Show, Typeable Status
DataType
Constr
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 -> DataType
Status -> Constr
(forall b. Data b => b -> b) -> Status -> Status
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Status -> c Status
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c 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)
$cStatus :: Constr
$tStatus :: DataType
gmapMo :: (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
gmapMp :: (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
gmapM :: (forall d. Data d => d -> m d) -> Status -> m Status
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Status -> m Status
gmapQi :: Int -> (forall d. Data d => d -> u) -> Status -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Status -> u
gmapQ :: (forall d. Data d => d -> u) -> Status -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Status -> [u]
gmapQr :: (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
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Status -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Status -> r
gmapT :: (forall b. Data b => b -> b) -> Status -> Status
$cgmapT :: (forall b. Data b => b -> b) -> Status -> Status
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Status)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Status)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Status)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Status)
dataTypeOf :: Status -> DataType
$cdataTypeOf :: Status -> DataType
toConstr :: Status -> Constr
$ctoConstr :: Status -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Status
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Status
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Status -> c Status
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Status -> c Status
$cp1Data :: Typeable Status
Data, Typeable, Status -> Status -> Bool
(Status -> Status -> Bool)
-> (Status -> Status -> Bool) -> Eq Status
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Status -> Status -> Bool
$c/= :: Status -> Status -> Bool
== :: Status -> Status -> Bool
$c== :: 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
min :: Status -> Status -> Status
$cmin :: Status -> Status -> Status
max :: Status -> Status -> Status
$cmax :: Status -> Status -> Status
>= :: Status -> Status -> Bool
$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
compare :: Status -> Status -> Ordering
$ccompare :: Status -> Status -> Ordering
$cp1Ord :: Eq 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
$cto :: forall x. Rep Status x -> Status
$cfrom :: forall x. Status -> Rep Status x
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 (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 (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 (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 (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 (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 (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 (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 (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
showList :: [NewStatus] -> ShowS
$cshowList :: [NewStatus] -> ShowS
show :: NewStatus -> String
$cshow :: NewStatus -> String
showsPrec :: Int -> NewStatus -> ShowS
$cshowsPrec :: Int -> NewStatus -> ShowS
Show, Typeable NewStatus
DataType
Constr
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 -> DataType
NewStatus -> Constr
(forall b. Data b => b -> b) -> NewStatus -> NewStatus
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NewStatus -> c NewStatus
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c 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)
$cNewStatus :: Constr
$tNewStatus :: DataType
gmapMo :: (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
gmapMp :: (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
gmapM :: (forall d. Data d => d -> m d) -> NewStatus -> m NewStatus
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NewStatus -> m NewStatus
gmapQi :: Int -> (forall d. Data d => d -> u) -> NewStatus -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> NewStatus -> u
gmapQ :: (forall d. Data d => d -> u) -> NewStatus -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> NewStatus -> [u]
gmapQr :: (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
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NewStatus -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NewStatus -> r
gmapT :: (forall b. Data b => b -> b) -> NewStatus -> NewStatus
$cgmapT :: (forall b. Data b => b -> b) -> NewStatus -> NewStatus
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NewStatus)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NewStatus)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c NewStatus)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NewStatus)
dataTypeOf :: NewStatus -> DataType
$cdataTypeOf :: NewStatus -> DataType
toConstr :: NewStatus -> Constr
$ctoConstr :: NewStatus -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NewStatus
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NewStatus
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NewStatus -> c NewStatus
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NewStatus -> c NewStatus
$cp1Data :: Typeable NewStatus
Data, Typeable, NewStatus -> NewStatus -> Bool
(NewStatus -> NewStatus -> Bool)
-> (NewStatus -> NewStatus -> Bool) -> Eq NewStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NewStatus -> NewStatus -> Bool
$c/= :: NewStatus -> NewStatus -> Bool
== :: NewStatus -> NewStatus -> Bool
$c== :: 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
min :: NewStatus -> NewStatus -> NewStatus
$cmin :: NewStatus -> NewStatus -> NewStatus
max :: NewStatus -> NewStatus -> NewStatus
$cmax :: NewStatus -> NewStatus -> NewStatus
>= :: NewStatus -> NewStatus -> Bool
$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
compare :: NewStatus -> NewStatus -> Ordering
$ccompare :: NewStatus -> NewStatus -> Ordering
$cp1Ord :: Eq 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
$cto :: forall x. Rep NewStatus x -> NewStatus
$cfrom :: forall x. NewStatus -> Rep NewStatus x
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
.= StatusState
s
        , Key
"target_url"  Key -> Maybe URL -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe URL
t
        , Key
"description" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
d
        , Key
"context"     Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= 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
showList :: [CombinedStatus] -> ShowS
$cshowList :: [CombinedStatus] -> ShowS
show :: CombinedStatus -> String
$cshow :: CombinedStatus -> String
showsPrec :: Int -> CombinedStatus -> ShowS
$cshowsPrec :: Int -> CombinedStatus -> ShowS
Show, Typeable CombinedStatus
DataType
Constr
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 -> DataType
CombinedStatus -> Constr
(forall b. Data b => b -> b) -> CombinedStatus -> CombinedStatus
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CombinedStatus -> c CombinedStatus
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c 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)
$cCombinedStatus :: Constr
$tCombinedStatus :: DataType
gmapMo :: (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
gmapMp :: (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
gmapM :: (forall d. Data d => d -> m d)
-> CombinedStatus -> m CombinedStatus
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CombinedStatus -> m CombinedStatus
gmapQi :: Int -> (forall d. Data d => d -> u) -> CombinedStatus -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CombinedStatus -> u
gmapQ :: (forall d. Data d => d -> u) -> CombinedStatus -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> CombinedStatus -> [u]
gmapQr :: (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
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CombinedStatus -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CombinedStatus -> r
gmapT :: (forall b. Data b => b -> b) -> CombinedStatus -> CombinedStatus
$cgmapT :: (forall b. Data b => b -> b) -> CombinedStatus -> CombinedStatus
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CombinedStatus)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CombinedStatus)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c CombinedStatus)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CombinedStatus)
dataTypeOf :: CombinedStatus -> DataType
$cdataTypeOf :: CombinedStatus -> DataType
toConstr :: CombinedStatus -> Constr
$ctoConstr :: CombinedStatus -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CombinedStatus
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CombinedStatus
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CombinedStatus -> c CombinedStatus
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CombinedStatus -> c CombinedStatus
$cp1Data :: Typeable CombinedStatus
Data, Typeable, CombinedStatus -> CombinedStatus -> Bool
(CombinedStatus -> CombinedStatus -> Bool)
-> (CombinedStatus -> CombinedStatus -> Bool) -> Eq CombinedStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CombinedStatus -> CombinedStatus -> Bool
$c/= :: CombinedStatus -> CombinedStatus -> Bool
== :: CombinedStatus -> CombinedStatus -> Bool
$c== :: 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
min :: CombinedStatus -> CombinedStatus -> CombinedStatus
$cmin :: CombinedStatus -> CombinedStatus -> CombinedStatus
max :: CombinedStatus -> CombinedStatus -> CombinedStatus
$cmax :: CombinedStatus -> CombinedStatus -> CombinedStatus
>= :: CombinedStatus -> CombinedStatus -> Bool
$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
compare :: CombinedStatus -> CombinedStatus -> Ordering
$ccompare :: CombinedStatus -> CombinedStatus -> Ordering
$cp1Ord :: Eq 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
$cto :: forall x. Rep CombinedStatus x -> CombinedStatus
$cfrom :: forall x. CombinedStatus -> Rep CombinedStatus x
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 (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 (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 (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 (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 (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 (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"