{-# LANGUAGE RecordWildCards #-}
-----------------------------------------------------------------------------
-- |
-- License     :  BSD-3-Clause
-- Maintainer  :  Oleg Grenrus <oleg.grenrus@iki.fi>
--
-- Module with modifiers for pull requests' and issues' listings.
module GitHub.Data.Options (
    -- * Common modifiers
    stateOpen,
    stateClosed,
    stateAll,
    sortAscending,
    sortDescending,
    sortByCreated,
    sortByUpdated,
    -- * Pull Requests
    PullRequestMod,
    prModToQueryString,
    optionsBase,
    optionsNoBase,
    optionsHead,
    optionsNoHead,
    sortByPopularity,
    sortByLongRunning,
    -- * Issues
    IssueMod,
    issueModToQueryString,
    sortByComments,
    optionsLabels,
    optionsSince,
    optionsSinceAll,
    optionsAssignedIssues,
    optionsCreatedIssues,
    optionsMentionedIssues,
    optionsSubscribedIssues,
    optionsAllIssues,
    -- * Repo issues
    IssueRepoMod,
    issueRepoModToQueryString,
    optionsCreator,
    optionsMentioned,
    optionsIrrelevantMilestone,
    optionsAnyMilestone,
    optionsNoMilestone,
    optionsMilestone,
    optionsIrrelevantAssignee,
    optionsAnyAssignee,
    optionsNoAssignee,
    optionsAssignee,
    -- * Data
    IssueState (..),
    MergeableState (..),
    -- * Internal
    HasState,
    HasDirection,
    HasCreatedUpdated,
    HasComments,
    HasLabels,
    HasSince,
    ) where

import GitHub.Data.Definitions
import GitHub.Data.Id          (Id, untagId)
import GitHub.Data.Milestone   (Milestone)
import GitHub.Data.Name        (Name, untagName)
import GitHub.Internal.Prelude
import Prelude ()

import qualified Data.Text          as T
import qualified Data.Text.Encoding as TE

-------------------------------------------------------------------------------
-- Data
-------------------------------------------------------------------------------

-- | 'GitHub.Data.Issues.Issue' or 'GitHub.Data.PullRequests.PullRequest' state
data IssueState
    = StateOpen
    | StateClosed
  deriving
    (IssueState -> IssueState -> Bool
(IssueState -> IssueState -> Bool)
-> (IssueState -> IssueState -> Bool) -> Eq IssueState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IssueState -> IssueState -> Bool
$c/= :: IssueState -> IssueState -> Bool
== :: IssueState -> IssueState -> Bool
$c== :: IssueState -> IssueState -> Bool
Eq, Eq IssueState
Eq IssueState
-> (IssueState -> IssueState -> Ordering)
-> (IssueState -> IssueState -> Bool)
-> (IssueState -> IssueState -> Bool)
-> (IssueState -> IssueState -> Bool)
-> (IssueState -> IssueState -> Bool)
-> (IssueState -> IssueState -> IssueState)
-> (IssueState -> IssueState -> IssueState)
-> Ord IssueState
IssueState -> IssueState -> Bool
IssueState -> IssueState -> Ordering
IssueState -> IssueState -> IssueState
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 :: IssueState -> IssueState -> IssueState
$cmin :: IssueState -> IssueState -> IssueState
max :: IssueState -> IssueState -> IssueState
$cmax :: IssueState -> IssueState -> IssueState
>= :: IssueState -> IssueState -> Bool
$c>= :: IssueState -> IssueState -> Bool
> :: IssueState -> IssueState -> Bool
$c> :: IssueState -> IssueState -> Bool
<= :: IssueState -> IssueState -> Bool
$c<= :: IssueState -> IssueState -> Bool
< :: IssueState -> IssueState -> Bool
$c< :: IssueState -> IssueState -> Bool
compare :: IssueState -> IssueState -> Ordering
$ccompare :: IssueState -> IssueState -> Ordering
$cp1Ord :: Eq IssueState
Ord, Int -> IssueState -> ShowS
[IssueState] -> ShowS
IssueState -> String
(Int -> IssueState -> ShowS)
-> (IssueState -> String)
-> ([IssueState] -> ShowS)
-> Show IssueState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IssueState] -> ShowS
$cshowList :: [IssueState] -> ShowS
show :: IssueState -> String
$cshow :: IssueState -> String
showsPrec :: Int -> IssueState -> ShowS
$cshowsPrec :: Int -> IssueState -> ShowS
Show, Int -> IssueState
IssueState -> Int
IssueState -> [IssueState]
IssueState -> IssueState
IssueState -> IssueState -> [IssueState]
IssueState -> IssueState -> IssueState -> [IssueState]
(IssueState -> IssueState)
-> (IssueState -> IssueState)
-> (Int -> IssueState)
-> (IssueState -> Int)
-> (IssueState -> [IssueState])
-> (IssueState -> IssueState -> [IssueState])
-> (IssueState -> IssueState -> [IssueState])
-> (IssueState -> IssueState -> IssueState -> [IssueState])
-> Enum IssueState
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 :: IssueState -> IssueState -> IssueState -> [IssueState]
$cenumFromThenTo :: IssueState -> IssueState -> IssueState -> [IssueState]
enumFromTo :: IssueState -> IssueState -> [IssueState]
$cenumFromTo :: IssueState -> IssueState -> [IssueState]
enumFromThen :: IssueState -> IssueState -> [IssueState]
$cenumFromThen :: IssueState -> IssueState -> [IssueState]
enumFrom :: IssueState -> [IssueState]
$cenumFrom :: IssueState -> [IssueState]
fromEnum :: IssueState -> Int
$cfromEnum :: IssueState -> Int
toEnum :: Int -> IssueState
$ctoEnum :: Int -> IssueState
pred :: IssueState -> IssueState
$cpred :: IssueState -> IssueState
succ :: IssueState -> IssueState
$csucc :: IssueState -> IssueState
Enum, IssueState
IssueState -> IssueState -> Bounded IssueState
forall a. a -> a -> Bounded a
maxBound :: IssueState
$cmaxBound :: IssueState
minBound :: IssueState
$cminBound :: IssueState
Bounded, (forall x. IssueState -> Rep IssueState x)
-> (forall x. Rep IssueState x -> IssueState) -> Generic IssueState
forall x. Rep IssueState x -> IssueState
forall x. IssueState -> Rep IssueState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IssueState x -> IssueState
$cfrom :: forall x. IssueState -> Rep IssueState x
Generic, Typeable, Typeable IssueState
DataType
Constr
Typeable IssueState
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> IssueState -> c IssueState)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c IssueState)
-> (IssueState -> Constr)
-> (IssueState -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c IssueState))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c IssueState))
-> ((forall b. Data b => b -> b) -> IssueState -> IssueState)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> IssueState -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> IssueState -> r)
-> (forall u. (forall d. Data d => d -> u) -> IssueState -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> IssueState -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> IssueState -> m IssueState)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> IssueState -> m IssueState)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> IssueState -> m IssueState)
-> Data IssueState
IssueState -> DataType
IssueState -> Constr
(forall b. Data b => b -> b) -> IssueState -> IssueState
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueState -> c IssueState
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueState
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) -> IssueState -> u
forall u. (forall d. Data d => d -> u) -> IssueState -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IssueState -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IssueState -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> IssueState -> m IssueState
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> IssueState -> m IssueState
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueState
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueState -> c IssueState
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c IssueState)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IssueState)
$cStateClosed :: Constr
$cStateOpen :: Constr
$tIssueState :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> IssueState -> m IssueState
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> IssueState -> m IssueState
gmapMp :: (forall d. Data d => d -> m d) -> IssueState -> m IssueState
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> IssueState -> m IssueState
gmapM :: (forall d. Data d => d -> m d) -> IssueState -> m IssueState
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> IssueState -> m IssueState
gmapQi :: Int -> (forall d. Data d => d -> u) -> IssueState -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> IssueState -> u
gmapQ :: (forall d. Data d => d -> u) -> IssueState -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> IssueState -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IssueState -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IssueState -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IssueState -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IssueState -> r
gmapT :: (forall b. Data b => b -> b) -> IssueState -> IssueState
$cgmapT :: (forall b. Data b => b -> b) -> IssueState -> IssueState
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IssueState)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IssueState)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c IssueState)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c IssueState)
dataTypeOf :: IssueState -> DataType
$cdataTypeOf :: IssueState -> DataType
toConstr :: IssueState -> Constr
$ctoConstr :: IssueState -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueState
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueState
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueState -> c IssueState
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueState -> c IssueState
$cp1Data :: Typeable IssueState
Data)

instance ToJSON IssueState where
    toJSON :: IssueState -> Value
toJSON IssueState
StateOpen    = Text -> Value
String Text
"open"
    toJSON IssueState
StateClosed  = Text -> Value
String Text
"closed"

instance FromJSON IssueState where
    parseJSON :: Value -> Parser IssueState
parseJSON = String -> (Text -> Parser IssueState) -> Value -> Parser IssueState
forall a. String -> (Text -> Parser a) -> Value -> Parser a
withText String
"IssueState" ((Text -> Parser IssueState) -> Value -> Parser IssueState)
-> (Text -> Parser IssueState) -> Value -> Parser IssueState
forall a b. (a -> b) -> a -> b
$ \Text
t -> case Text -> Text
T.toLower Text
t of
        Text
"open"   -> IssueState -> Parser IssueState
forall (f :: * -> *) a. Applicative f => a -> f a
pure IssueState
StateOpen
        Text
"closed" -> IssueState -> Parser IssueState
forall (f :: * -> *) a. Applicative f => a -> f a
pure IssueState
StateClosed
        Text
_        -> String -> Parser IssueState
forall (m :: * -> *) a. MonadFail m => String -> m a
fail (String -> Parser IssueState) -> String -> Parser IssueState
forall a b. (a -> b) -> a -> b
$ String
"Unknown IssueState: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Text -> String
T.unpack Text
t

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

-- | 'GitHub.Data.PullRequests.PullRequest' mergeable_state
data MergeableState
    = StateUnknown
    | StateClean
    | StateDirty
    | StateUnstable
    | StateBlocked
    | StateBehind
    | StateDraft
  deriving
    (MergeableState -> MergeableState -> Bool
(MergeableState -> MergeableState -> Bool)
-> (MergeableState -> MergeableState -> Bool) -> Eq MergeableState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MergeableState -> MergeableState -> Bool
$c/= :: MergeableState -> MergeableState -> Bool
== :: MergeableState -> MergeableState -> Bool
$c== :: MergeableState -> MergeableState -> Bool
Eq, Eq MergeableState
Eq MergeableState
-> (MergeableState -> MergeableState -> Ordering)
-> (MergeableState -> MergeableState -> Bool)
-> (MergeableState -> MergeableState -> Bool)
-> (MergeableState -> MergeableState -> Bool)
-> (MergeableState -> MergeableState -> Bool)
-> (MergeableState -> MergeableState -> MergeableState)
-> (MergeableState -> MergeableState -> MergeableState)
-> Ord MergeableState
MergeableState -> MergeableState -> Bool
MergeableState -> MergeableState -> Ordering
MergeableState -> MergeableState -> MergeableState
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 :: MergeableState -> MergeableState -> MergeableState
$cmin :: MergeableState -> MergeableState -> MergeableState
max :: MergeableState -> MergeableState -> MergeableState
$cmax :: MergeableState -> MergeableState -> MergeableState
>= :: MergeableState -> MergeableState -> Bool
$c>= :: MergeableState -> MergeableState -> Bool
> :: MergeableState -> MergeableState -> Bool
$c> :: MergeableState -> MergeableState -> Bool
<= :: MergeableState -> MergeableState -> Bool
$c<= :: MergeableState -> MergeableState -> Bool
< :: MergeableState -> MergeableState -> Bool
$c< :: MergeableState -> MergeableState -> Bool
compare :: MergeableState -> MergeableState -> Ordering
$ccompare :: MergeableState -> MergeableState -> Ordering
$cp1Ord :: Eq MergeableState
Ord, Int -> MergeableState -> ShowS
[MergeableState] -> ShowS
MergeableState -> String
(Int -> MergeableState -> ShowS)
-> (MergeableState -> String)
-> ([MergeableState] -> ShowS)
-> Show MergeableState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MergeableState] -> ShowS
$cshowList :: [MergeableState] -> ShowS
show :: MergeableState -> String
$cshow :: MergeableState -> String
showsPrec :: Int -> MergeableState -> ShowS
$cshowsPrec :: Int -> MergeableState -> ShowS
Show, Int -> MergeableState
MergeableState -> Int
MergeableState -> [MergeableState]
MergeableState -> MergeableState
MergeableState -> MergeableState -> [MergeableState]
MergeableState
-> MergeableState -> MergeableState -> [MergeableState]
(MergeableState -> MergeableState)
-> (MergeableState -> MergeableState)
-> (Int -> MergeableState)
-> (MergeableState -> Int)
-> (MergeableState -> [MergeableState])
-> (MergeableState -> MergeableState -> [MergeableState])
-> (MergeableState -> MergeableState -> [MergeableState])
-> (MergeableState
    -> MergeableState -> MergeableState -> [MergeableState])
-> Enum MergeableState
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 :: MergeableState
-> MergeableState -> MergeableState -> [MergeableState]
$cenumFromThenTo :: MergeableState
-> MergeableState -> MergeableState -> [MergeableState]
enumFromTo :: MergeableState -> MergeableState -> [MergeableState]
$cenumFromTo :: MergeableState -> MergeableState -> [MergeableState]
enumFromThen :: MergeableState -> MergeableState -> [MergeableState]
$cenumFromThen :: MergeableState -> MergeableState -> [MergeableState]
enumFrom :: MergeableState -> [MergeableState]
$cenumFrom :: MergeableState -> [MergeableState]
fromEnum :: MergeableState -> Int
$cfromEnum :: MergeableState -> Int
toEnum :: Int -> MergeableState
$ctoEnum :: Int -> MergeableState
pred :: MergeableState -> MergeableState
$cpred :: MergeableState -> MergeableState
succ :: MergeableState -> MergeableState
$csucc :: MergeableState -> MergeableState
Enum, MergeableState
MergeableState -> MergeableState -> Bounded MergeableState
forall a. a -> a -> Bounded a
maxBound :: MergeableState
$cmaxBound :: MergeableState
minBound :: MergeableState
$cminBound :: MergeableState
Bounded, (forall x. MergeableState -> Rep MergeableState x)
-> (forall x. Rep MergeableState x -> MergeableState)
-> Generic MergeableState
forall x. Rep MergeableState x -> MergeableState
forall x. MergeableState -> Rep MergeableState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MergeableState x -> MergeableState
$cfrom :: forall x. MergeableState -> Rep MergeableState x
Generic, Typeable, Typeable MergeableState
DataType
Constr
Typeable MergeableState
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> MergeableState -> c MergeableState)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MergeableState)
-> (MergeableState -> Constr)
-> (MergeableState -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c MergeableState))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c MergeableState))
-> ((forall b. Data b => b -> b)
    -> MergeableState -> MergeableState)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> MergeableState -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> MergeableState -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> MergeableState -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> MergeableState -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> MergeableState -> m MergeableState)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> MergeableState -> m MergeableState)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> MergeableState -> m MergeableState)
-> Data MergeableState
MergeableState -> DataType
MergeableState -> Constr
(forall b. Data b => b -> b) -> MergeableState -> MergeableState
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MergeableState -> c MergeableState
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MergeableState
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) -> MergeableState -> u
forall u. (forall d. Data d => d -> u) -> MergeableState -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MergeableState -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MergeableState -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> MergeableState -> m MergeableState
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MergeableState -> m MergeableState
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MergeableState
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MergeableState -> c MergeableState
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MergeableState)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c MergeableState)
$cStateDraft :: Constr
$cStateBehind :: Constr
$cStateBlocked :: Constr
$cStateUnstable :: Constr
$cStateDirty :: Constr
$cStateClean :: Constr
$cStateUnknown :: Constr
$tMergeableState :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> MergeableState -> m MergeableState
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MergeableState -> m MergeableState
gmapMp :: (forall d. Data d => d -> m d)
-> MergeableState -> m MergeableState
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MergeableState -> m MergeableState
gmapM :: (forall d. Data d => d -> m d)
-> MergeableState -> m MergeableState
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> MergeableState -> m MergeableState
gmapQi :: Int -> (forall d. Data d => d -> u) -> MergeableState -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> MergeableState -> u
gmapQ :: (forall d. Data d => d -> u) -> MergeableState -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> MergeableState -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MergeableState -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MergeableState -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MergeableState -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MergeableState -> r
gmapT :: (forall b. Data b => b -> b) -> MergeableState -> MergeableState
$cgmapT :: (forall b. Data b => b -> b) -> MergeableState -> MergeableState
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c MergeableState)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c MergeableState)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c MergeableState)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MergeableState)
dataTypeOf :: MergeableState -> DataType
$cdataTypeOf :: MergeableState -> DataType
toConstr :: MergeableState -> Constr
$ctoConstr :: MergeableState -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MergeableState
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MergeableState
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MergeableState -> c MergeableState
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MergeableState -> c MergeableState
$cp1Data :: Typeable MergeableState
Data)

instance ToJSON MergeableState where
    toJSON :: MergeableState -> Value
toJSON MergeableState
StateUnknown  = Text -> Value
String Text
"unknown"
    toJSON MergeableState
StateClean    = Text -> Value
String Text
"clean"
    toJSON MergeableState
StateDirty    = Text -> Value
String Text
"dirty"
    toJSON MergeableState
StateUnstable = Text -> Value
String Text
"unstable"
    toJSON MergeableState
StateBlocked  = Text -> Value
String Text
"blocked"
    toJSON MergeableState
StateBehind   = Text -> Value
String Text
"behind"
    toJSON MergeableState
StateDraft    = Text -> Value
String Text
"draft"

instance FromJSON MergeableState where
    parseJSON :: Value -> Parser MergeableState
parseJSON = String
-> (Text -> Parser MergeableState)
-> Value
-> Parser MergeableState
forall a. String -> (Text -> Parser a) -> Value -> Parser a
withText String
"MergeableState" ((Text -> Parser MergeableState) -> Value -> Parser MergeableState)
-> (Text -> Parser MergeableState)
-> Value
-> Parser MergeableState
forall a b. (a -> b) -> a -> b
$ \Text
t -> case Text -> Text
T.toLower Text
t of
        Text
"unknown"  -> MergeableState -> Parser MergeableState
forall (f :: * -> *) a. Applicative f => a -> f a
pure MergeableState
StateUnknown
        Text
"clean"    -> MergeableState -> Parser MergeableState
forall (f :: * -> *) a. Applicative f => a -> f a
pure MergeableState
StateClean
        Text
"dirty"    -> MergeableState -> Parser MergeableState
forall (f :: * -> *) a. Applicative f => a -> f a
pure MergeableState
StateDirty
        Text
"unstable" -> MergeableState -> Parser MergeableState
forall (f :: * -> *) a. Applicative f => a -> f a
pure MergeableState
StateUnstable
        Text
"blocked"  -> MergeableState -> Parser MergeableState
forall (f :: * -> *) a. Applicative f => a -> f a
pure MergeableState
StateBlocked
        Text
"behind"   -> MergeableState -> Parser MergeableState
forall (f :: * -> *) a. Applicative f => a -> f a
pure MergeableState
StateBehind
        Text
"draft"    -> MergeableState -> Parser MergeableState
forall (f :: * -> *) a. Applicative f => a -> f a
pure MergeableState
StateDraft
        Text
_          -> String -> Parser MergeableState
forall (m :: * -> *) a. MonadFail m => String -> m a
fail (String -> Parser MergeableState)
-> String -> Parser MergeableState
forall a b. (a -> b) -> a -> b
$ String
"Unknown MergeableState: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Text -> String
T.unpack Text
t

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

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

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

-- PR

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

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

-- Issue
data IssueFilter
    = IssueFilterAssigned
    | IssueFilterCreated
    | IssueFilterMentioned
    | IssueFilterSubscribed
    | IssueFilterAll
  deriving
    (IssueFilter -> IssueFilter -> Bool
(IssueFilter -> IssueFilter -> Bool)
-> (IssueFilter -> IssueFilter -> Bool) -> Eq IssueFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IssueFilter -> IssueFilter -> Bool
$c/= :: IssueFilter -> IssueFilter -> Bool
== :: IssueFilter -> IssueFilter -> Bool
$c== :: IssueFilter -> IssueFilter -> Bool
Eq, Eq IssueFilter
Eq IssueFilter
-> (IssueFilter -> IssueFilter -> Ordering)
-> (IssueFilter -> IssueFilter -> Bool)
-> (IssueFilter -> IssueFilter -> Bool)
-> (IssueFilter -> IssueFilter -> Bool)
-> (IssueFilter -> IssueFilter -> Bool)
-> (IssueFilter -> IssueFilter -> IssueFilter)
-> (IssueFilter -> IssueFilter -> IssueFilter)
-> Ord IssueFilter
IssueFilter -> IssueFilter -> Bool
IssueFilter -> IssueFilter -> Ordering
IssueFilter -> IssueFilter -> IssueFilter
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 :: IssueFilter -> IssueFilter -> IssueFilter
$cmin :: IssueFilter -> IssueFilter -> IssueFilter
max :: IssueFilter -> IssueFilter -> IssueFilter
$cmax :: IssueFilter -> IssueFilter -> IssueFilter
>= :: IssueFilter -> IssueFilter -> Bool
$c>= :: IssueFilter -> IssueFilter -> Bool
> :: IssueFilter -> IssueFilter -> Bool
$c> :: IssueFilter -> IssueFilter -> Bool
<= :: IssueFilter -> IssueFilter -> Bool
$c<= :: IssueFilter -> IssueFilter -> Bool
< :: IssueFilter -> IssueFilter -> Bool
$c< :: IssueFilter -> IssueFilter -> Bool
compare :: IssueFilter -> IssueFilter -> Ordering
$ccompare :: IssueFilter -> IssueFilter -> Ordering
$cp1Ord :: Eq IssueFilter
Ord, Int -> IssueFilter -> ShowS
[IssueFilter] -> ShowS
IssueFilter -> String
(Int -> IssueFilter -> ShowS)
-> (IssueFilter -> String)
-> ([IssueFilter] -> ShowS)
-> Show IssueFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IssueFilter] -> ShowS
$cshowList :: [IssueFilter] -> ShowS
show :: IssueFilter -> String
$cshow :: IssueFilter -> String
showsPrec :: Int -> IssueFilter -> ShowS
$cshowsPrec :: Int -> IssueFilter -> ShowS
Show, Int -> IssueFilter
IssueFilter -> Int
IssueFilter -> [IssueFilter]
IssueFilter -> IssueFilter
IssueFilter -> IssueFilter -> [IssueFilter]
IssueFilter -> IssueFilter -> IssueFilter -> [IssueFilter]
(IssueFilter -> IssueFilter)
-> (IssueFilter -> IssueFilter)
-> (Int -> IssueFilter)
-> (IssueFilter -> Int)
-> (IssueFilter -> [IssueFilter])
-> (IssueFilter -> IssueFilter -> [IssueFilter])
-> (IssueFilter -> IssueFilter -> [IssueFilter])
-> (IssueFilter -> IssueFilter -> IssueFilter -> [IssueFilter])
-> Enum IssueFilter
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 :: IssueFilter -> IssueFilter -> IssueFilter -> [IssueFilter]
$cenumFromThenTo :: IssueFilter -> IssueFilter -> IssueFilter -> [IssueFilter]
enumFromTo :: IssueFilter -> IssueFilter -> [IssueFilter]
$cenumFromTo :: IssueFilter -> IssueFilter -> [IssueFilter]
enumFromThen :: IssueFilter -> IssueFilter -> [IssueFilter]
$cenumFromThen :: IssueFilter -> IssueFilter -> [IssueFilter]
enumFrom :: IssueFilter -> [IssueFilter]
$cenumFrom :: IssueFilter -> [IssueFilter]
fromEnum :: IssueFilter -> Int
$cfromEnum :: IssueFilter -> Int
toEnum :: Int -> IssueFilter
$ctoEnum :: Int -> IssueFilter
pred :: IssueFilter -> IssueFilter
$cpred :: IssueFilter -> IssueFilter
succ :: IssueFilter -> IssueFilter
$csucc :: IssueFilter -> IssueFilter
Enum, IssueFilter
IssueFilter -> IssueFilter -> Bounded IssueFilter
forall a. a -> a -> Bounded a
maxBound :: IssueFilter
$cmaxBound :: IssueFilter
minBound :: IssueFilter
$cminBound :: IssueFilter
Bounded, (forall x. IssueFilter -> Rep IssueFilter x)
-> (forall x. Rep IssueFilter x -> IssueFilter)
-> Generic IssueFilter
forall x. Rep IssueFilter x -> IssueFilter
forall x. IssueFilter -> Rep IssueFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IssueFilter x -> IssueFilter
$cfrom :: forall x. IssueFilter -> Rep IssueFilter x
Generic, Typeable, Typeable IssueFilter
DataType
Constr
Typeable IssueFilter
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> IssueFilter -> c IssueFilter)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c IssueFilter)
-> (IssueFilter -> Constr)
-> (IssueFilter -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c IssueFilter))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c IssueFilter))
-> ((forall b. Data b => b -> b) -> IssueFilter -> IssueFilter)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> IssueFilter -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> IssueFilter -> r)
-> (forall u. (forall d. Data d => d -> u) -> IssueFilter -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> IssueFilter -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> IssueFilter -> m IssueFilter)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> IssueFilter -> m IssueFilter)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> IssueFilter -> m IssueFilter)
-> Data IssueFilter
IssueFilter -> DataType
IssueFilter -> Constr
(forall b. Data b => b -> b) -> IssueFilter -> IssueFilter
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueFilter -> c IssueFilter
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueFilter
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) -> IssueFilter -> u
forall u. (forall d. Data d => d -> u) -> IssueFilter -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IssueFilter -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IssueFilter -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> IssueFilter -> m IssueFilter
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> IssueFilter -> m IssueFilter
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueFilter
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueFilter -> c IssueFilter
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c IssueFilter)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c IssueFilter)
$cIssueFilterAll :: Constr
$cIssueFilterSubscribed :: Constr
$cIssueFilterMentioned :: Constr
$cIssueFilterCreated :: Constr
$cIssueFilterAssigned :: Constr
$tIssueFilter :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> IssueFilter -> m IssueFilter
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> IssueFilter -> m IssueFilter
gmapMp :: (forall d. Data d => d -> m d) -> IssueFilter -> m IssueFilter
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> IssueFilter -> m IssueFilter
gmapM :: (forall d. Data d => d -> m d) -> IssueFilter -> m IssueFilter
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> IssueFilter -> m IssueFilter
gmapQi :: Int -> (forall d. Data d => d -> u) -> IssueFilter -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> IssueFilter -> u
gmapQ :: (forall d. Data d => d -> u) -> IssueFilter -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> IssueFilter -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IssueFilter -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IssueFilter -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IssueFilter -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IssueFilter -> r
gmapT :: (forall b. Data b => b -> b) -> IssueFilter -> IssueFilter
$cgmapT :: (forall b. Data b => b -> b) -> IssueFilter -> IssueFilter
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c IssueFilter)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c IssueFilter)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c IssueFilter)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c IssueFilter)
dataTypeOf :: IssueFilter -> DataType
$cdataTypeOf :: IssueFilter -> DataType
toConstr :: IssueFilter -> Constr
$ctoConstr :: IssueFilter -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueFilter
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueFilter
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueFilter -> c IssueFilter
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueFilter -> c IssueFilter
$cp1Data :: Typeable IssueFilter
Data)

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

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

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

data FilterBy a
    = FilterAny
    | FilterNone
    | FilterBy a
    | FilterNotSpecified
      -- ^ e.g. for milestones "any" means "any milestone".
      -- I.e. won't show issues without mileston specified
  deriving
    (FilterBy a -> FilterBy a -> Bool
(FilterBy a -> FilterBy a -> Bool)
-> (FilterBy a -> FilterBy a -> Bool) -> Eq (FilterBy a)
forall a. Eq a => FilterBy a -> FilterBy a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FilterBy a -> FilterBy a -> Bool
$c/= :: forall a. Eq a => FilterBy a -> FilterBy a -> Bool
== :: FilterBy a -> FilterBy a -> Bool
$c== :: forall a. Eq a => FilterBy a -> FilterBy a -> Bool
Eq, Eq (FilterBy a)
Eq (FilterBy a)
-> (FilterBy a -> FilterBy a -> Ordering)
-> (FilterBy a -> FilterBy a -> Bool)
-> (FilterBy a -> FilterBy a -> Bool)
-> (FilterBy a -> FilterBy a -> Bool)
-> (FilterBy a -> FilterBy a -> Bool)
-> (FilterBy a -> FilterBy a -> FilterBy a)
-> (FilterBy a -> FilterBy a -> FilterBy a)
-> Ord (FilterBy a)
FilterBy a -> FilterBy a -> Bool
FilterBy a -> FilterBy a -> Ordering
FilterBy a -> FilterBy a -> FilterBy a
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
forall a. Ord a => Eq (FilterBy a)
forall a. Ord a => FilterBy a -> FilterBy a -> Bool
forall a. Ord a => FilterBy a -> FilterBy a -> Ordering
forall a. Ord a => FilterBy a -> FilterBy a -> FilterBy a
min :: FilterBy a -> FilterBy a -> FilterBy a
$cmin :: forall a. Ord a => FilterBy a -> FilterBy a -> FilterBy a
max :: FilterBy a -> FilterBy a -> FilterBy a
$cmax :: forall a. Ord a => FilterBy a -> FilterBy a -> FilterBy a
>= :: FilterBy a -> FilterBy a -> Bool
$c>= :: forall a. Ord a => FilterBy a -> FilterBy a -> Bool
> :: FilterBy a -> FilterBy a -> Bool
$c> :: forall a. Ord a => FilterBy a -> FilterBy a -> Bool
<= :: FilterBy a -> FilterBy a -> Bool
$c<= :: forall a. Ord a => FilterBy a -> FilterBy a -> Bool
< :: FilterBy a -> FilterBy a -> Bool
$c< :: forall a. Ord a => FilterBy a -> FilterBy a -> Bool
compare :: FilterBy a -> FilterBy a -> Ordering
$ccompare :: forall a. Ord a => FilterBy a -> FilterBy a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (FilterBy a)
Ord, Int -> FilterBy a -> ShowS
[FilterBy a] -> ShowS
FilterBy a -> String
(Int -> FilterBy a -> ShowS)
-> (FilterBy a -> String)
-> ([FilterBy a] -> ShowS)
-> Show (FilterBy a)
forall a. Show a => Int -> FilterBy a -> ShowS
forall a. Show a => [FilterBy a] -> ShowS
forall a. Show a => FilterBy a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FilterBy a] -> ShowS
$cshowList :: forall a. Show a => [FilterBy a] -> ShowS
show :: FilterBy a -> String
$cshow :: forall a. Show a => FilterBy a -> String
showsPrec :: Int -> FilterBy a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> FilterBy a -> ShowS
Show, (forall x. FilterBy a -> Rep (FilterBy a) x)
-> (forall x. Rep (FilterBy a) x -> FilterBy a)
-> Generic (FilterBy a)
forall x. Rep (FilterBy a) x -> FilterBy a
forall x. FilterBy a -> Rep (FilterBy a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (FilterBy a) x -> FilterBy a
forall a x. FilterBy a -> Rep (FilterBy a) x
$cto :: forall a x. Rep (FilterBy a) x -> FilterBy a
$cfrom :: forall a x. FilterBy a -> Rep (FilterBy a) x
Generic, Typeable, Typeable (FilterBy a)
DataType
Constr
Typeable (FilterBy a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> FilterBy a -> c (FilterBy a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (FilterBy a))
-> (FilterBy a -> Constr)
-> (FilterBy a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (FilterBy a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (FilterBy a)))
-> ((forall b. Data b => b -> b) -> FilterBy a -> FilterBy a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> FilterBy a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> FilterBy a -> r)
-> (forall u. (forall d. Data d => d -> u) -> FilterBy a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> FilterBy a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> FilterBy a -> m (FilterBy a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> FilterBy a -> m (FilterBy a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> FilterBy a -> m (FilterBy a))
-> Data (FilterBy a)
FilterBy a -> DataType
FilterBy a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (FilterBy a))
(forall b. Data b => b -> b) -> FilterBy a -> FilterBy a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FilterBy a -> c (FilterBy a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (FilterBy a)
forall a. Data a => Typeable (FilterBy a)
forall a. Data a => FilterBy a -> DataType
forall a. Data a => FilterBy a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> FilterBy a -> FilterBy a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> FilterBy a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> FilterBy a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FilterBy a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FilterBy a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> FilterBy a -> m (FilterBy a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> FilterBy a -> m (FilterBy a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (FilterBy a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FilterBy a -> c (FilterBy a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (FilterBy a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (FilterBy a))
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) -> FilterBy a -> u
forall u. (forall d. Data d => d -> u) -> FilterBy a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FilterBy a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FilterBy a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> FilterBy a -> m (FilterBy a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> FilterBy a -> m (FilterBy a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (FilterBy a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FilterBy a -> c (FilterBy a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (FilterBy a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (FilterBy a))
$cFilterNotSpecified :: Constr
$cFilterBy :: Constr
$cFilterNone :: Constr
$cFilterAny :: Constr
$tFilterBy :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> FilterBy a -> m (FilterBy a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> FilterBy a -> m (FilterBy a)
gmapMp :: (forall d. Data d => d -> m d) -> FilterBy a -> m (FilterBy a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> FilterBy a -> m (FilterBy a)
gmapM :: (forall d. Data d => d -> m d) -> FilterBy a -> m (FilterBy a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> FilterBy a -> m (FilterBy a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> FilterBy a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> FilterBy a -> u
gmapQ :: (forall d. Data d => d -> u) -> FilterBy a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> FilterBy a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FilterBy a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FilterBy a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FilterBy a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FilterBy a -> r
gmapT :: (forall b. Data b => b -> b) -> FilterBy a -> FilterBy a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> FilterBy a -> FilterBy a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (FilterBy a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (FilterBy a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (FilterBy a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (FilterBy a))
dataTypeOf :: FilterBy a -> DataType
$cdataTypeOf :: forall a. Data a => FilterBy a -> DataType
toConstr :: FilterBy a -> Constr
$ctoConstr :: forall a. Data a => FilterBy a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (FilterBy a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (FilterBy a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FilterBy a -> c (FilterBy a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FilterBy a -> c (FilterBy a)
$cp1Data :: forall a. Data a => Typeable (FilterBy a)
Data)

-------------------------------------------------------------------------------
-- Classes
-------------------------------------------------------------------------------

class HasState mod where
    state :: Maybe IssueState -> mod

stateOpen :: HasState mod => mod
stateOpen :: mod
stateOpen = Maybe IssueState -> mod
forall mod. HasState mod => Maybe IssueState -> mod
state (IssueState -> Maybe IssueState
forall a. a -> Maybe a
Just IssueState
StateOpen)

stateClosed :: HasState mod => mod
stateClosed :: mod
stateClosed = Maybe IssueState -> mod
forall mod. HasState mod => Maybe IssueState -> mod
state (IssueState -> Maybe IssueState
forall a. a -> Maybe a
Just IssueState
StateClosed)

stateAll :: HasState mod => mod
stateAll :: mod
stateAll = Maybe IssueState -> mod
forall mod. HasState mod => Maybe IssueState -> mod
state Maybe IssueState
forall a. Maybe a
Nothing

instance HasState PullRequestMod where
    state :: Maybe IssueState -> PullRequestMod
state Maybe IssueState
s = (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
PRMod ((PullRequestOptions -> PullRequestOptions) -> PullRequestMod)
-> (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
forall a b. (a -> b) -> a -> b
$ \PullRequestOptions
opts ->
        PullRequestOptions
opts { pullRequestOptionsState :: Maybe IssueState
pullRequestOptionsState = Maybe IssueState
s }

instance HasState IssueMod where
    state :: Maybe IssueState -> IssueMod
state Maybe IssueState
s = (IssueOptions -> IssueOptions) -> IssueMod
IssueMod ((IssueOptions -> IssueOptions) -> IssueMod)
-> (IssueOptions -> IssueOptions) -> IssueMod
forall a b. (a -> b) -> a -> b
$ \IssueOptions
opts ->
        IssueOptions
opts { issueOptionsState :: Maybe IssueState
issueOptionsState = Maybe IssueState
s }

instance HasState IssueRepoMod where
    state :: Maybe IssueState -> IssueRepoMod
state Maybe IssueState
s = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
        IssueRepoOptions
opts { issueRepoOptionsState :: Maybe IssueState
issueRepoOptionsState = Maybe IssueState
s }


class HasDirection mod where
    sortDir :: SortDirection -> mod

sortAscending :: HasDirection mod => mod
sortAscending :: mod
sortAscending = SortDirection -> mod
forall mod. HasDirection mod => SortDirection -> mod
sortDir SortDirection
SortAscending

sortDescending :: HasDirection mod => mod
sortDescending :: mod
sortDescending = SortDirection -> mod
forall mod. HasDirection mod => SortDirection -> mod
sortDir SortDirection
SortDescending

instance HasDirection PullRequestMod where
    sortDir :: SortDirection -> PullRequestMod
sortDir SortDirection
x = (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
PRMod ((PullRequestOptions -> PullRequestOptions) -> PullRequestMod)
-> (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
forall a b. (a -> b) -> a -> b
$ \PullRequestOptions
opts ->
        PullRequestOptions
opts { pullRequestOptionsDirection :: SortDirection
pullRequestOptionsDirection = SortDirection
x }

instance HasDirection IssueMod where
    sortDir :: SortDirection -> IssueMod
sortDir SortDirection
x = (IssueOptions -> IssueOptions) -> IssueMod
IssueMod ((IssueOptions -> IssueOptions) -> IssueMod)
-> (IssueOptions -> IssueOptions) -> IssueMod
forall a b. (a -> b) -> a -> b
$ \IssueOptions
opts ->
        IssueOptions
opts { issueOptionsDirection :: SortDirection
issueOptionsDirection = SortDirection
x }

instance HasDirection IssueRepoMod where
    sortDir :: SortDirection -> IssueRepoMod
sortDir SortDirection
x = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
        IssueRepoOptions
opts { issueRepoOptionsDirection :: SortDirection
issueRepoOptionsDirection = SortDirection
x }


class HasCreatedUpdated mod where
    sortByCreated :: mod
    sortByUpdated :: mod

instance HasCreatedUpdated PullRequestMod where
    sortByCreated :: PullRequestMod
sortByCreated = (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
PRMod ((PullRequestOptions -> PullRequestOptions) -> PullRequestMod)
-> (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
forall a b. (a -> b) -> a -> b
$ \PullRequestOptions
opts ->
        PullRequestOptions
opts { pullRequestOptionsSort :: SortPR
pullRequestOptionsSort = SortPR
SortPRCreated }
    sortByUpdated :: PullRequestMod
sortByUpdated = (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
PRMod ((PullRequestOptions -> PullRequestOptions) -> PullRequestMod)
-> (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
forall a b. (a -> b) -> a -> b
$ \PullRequestOptions
opts ->
        PullRequestOptions
opts { pullRequestOptionsSort :: SortPR
pullRequestOptionsSort = SortPR
SortPRUpdated }

instance HasCreatedUpdated IssueMod where
    sortByCreated :: IssueMod
sortByCreated = (IssueOptions -> IssueOptions) -> IssueMod
IssueMod ((IssueOptions -> IssueOptions) -> IssueMod)
-> (IssueOptions -> IssueOptions) -> IssueMod
forall a b. (a -> b) -> a -> b
$ \IssueOptions
opts ->
        IssueOptions
opts { issueOptionsSort :: SortIssue
issueOptionsSort = SortIssue
SortIssueCreated }
    sortByUpdated :: IssueMod
sortByUpdated = (IssueOptions -> IssueOptions) -> IssueMod
IssueMod ((IssueOptions -> IssueOptions) -> IssueMod)
-> (IssueOptions -> IssueOptions) -> IssueMod
forall a b. (a -> b) -> a -> b
$ \IssueOptions
opts ->
        IssueOptions
opts { issueOptionsSort :: SortIssue
issueOptionsSort = SortIssue
SortIssueUpdated }

instance HasCreatedUpdated IssueRepoMod where
    sortByCreated :: IssueRepoMod
sortByCreated = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
        IssueRepoOptions
opts { issueRepoOptionsSort :: SortIssue
issueRepoOptionsSort = SortIssue
SortIssueCreated }
    sortByUpdated :: IssueRepoMod
sortByUpdated = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
        IssueRepoOptions
opts { issueRepoOptionsSort :: SortIssue
issueRepoOptionsSort = SortIssue
SortIssueUpdated }

-------------------------------------------------------------------------------
-- Pull Request
-------------------------------------------------------------------------------

-- | See <https://developer.github.com/v3/pulls/#parameters>.
data PullRequestOptions = PullRequestOptions
    { PullRequestOptions -> Maybe IssueState
pullRequestOptionsState     :: !(Maybe IssueState)
    , PullRequestOptions -> Maybe Text
pullRequestOptionsHead      :: !(Maybe Text)
    , PullRequestOptions -> Maybe Text
pullRequestOptionsBase      :: !(Maybe Text)
    , PullRequestOptions -> SortPR
pullRequestOptionsSort      :: !SortPR
    , PullRequestOptions -> SortDirection
pullRequestOptionsDirection :: !SortDirection
    }
  deriving
    (PullRequestOptions -> PullRequestOptions -> Bool
(PullRequestOptions -> PullRequestOptions -> Bool)
-> (PullRequestOptions -> PullRequestOptions -> Bool)
-> Eq PullRequestOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PullRequestOptions -> PullRequestOptions -> Bool
$c/= :: PullRequestOptions -> PullRequestOptions -> Bool
== :: PullRequestOptions -> PullRequestOptions -> Bool
$c== :: PullRequestOptions -> PullRequestOptions -> Bool
Eq, Eq PullRequestOptions
Eq PullRequestOptions
-> (PullRequestOptions -> PullRequestOptions -> Ordering)
-> (PullRequestOptions -> PullRequestOptions -> Bool)
-> (PullRequestOptions -> PullRequestOptions -> Bool)
-> (PullRequestOptions -> PullRequestOptions -> Bool)
-> (PullRequestOptions -> PullRequestOptions -> Bool)
-> (PullRequestOptions -> PullRequestOptions -> PullRequestOptions)
-> (PullRequestOptions -> PullRequestOptions -> PullRequestOptions)
-> Ord PullRequestOptions
PullRequestOptions -> PullRequestOptions -> Bool
PullRequestOptions -> PullRequestOptions -> Ordering
PullRequestOptions -> PullRequestOptions -> PullRequestOptions
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 :: PullRequestOptions -> PullRequestOptions -> PullRequestOptions
$cmin :: PullRequestOptions -> PullRequestOptions -> PullRequestOptions
max :: PullRequestOptions -> PullRequestOptions -> PullRequestOptions
$cmax :: PullRequestOptions -> PullRequestOptions -> PullRequestOptions
>= :: PullRequestOptions -> PullRequestOptions -> Bool
$c>= :: PullRequestOptions -> PullRequestOptions -> Bool
> :: PullRequestOptions -> PullRequestOptions -> Bool
$c> :: PullRequestOptions -> PullRequestOptions -> Bool
<= :: PullRequestOptions -> PullRequestOptions -> Bool
$c<= :: PullRequestOptions -> PullRequestOptions -> Bool
< :: PullRequestOptions -> PullRequestOptions -> Bool
$c< :: PullRequestOptions -> PullRequestOptions -> Bool
compare :: PullRequestOptions -> PullRequestOptions -> Ordering
$ccompare :: PullRequestOptions -> PullRequestOptions -> Ordering
$cp1Ord :: Eq PullRequestOptions
Ord, Int -> PullRequestOptions -> ShowS
[PullRequestOptions] -> ShowS
PullRequestOptions -> String
(Int -> PullRequestOptions -> ShowS)
-> (PullRequestOptions -> String)
-> ([PullRequestOptions] -> ShowS)
-> Show PullRequestOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PullRequestOptions] -> ShowS
$cshowList :: [PullRequestOptions] -> ShowS
show :: PullRequestOptions -> String
$cshow :: PullRequestOptions -> String
showsPrec :: Int -> PullRequestOptions -> ShowS
$cshowsPrec :: Int -> PullRequestOptions -> ShowS
Show, (forall x. PullRequestOptions -> Rep PullRequestOptions x)
-> (forall x. Rep PullRequestOptions x -> PullRequestOptions)
-> Generic PullRequestOptions
forall x. Rep PullRequestOptions x -> PullRequestOptions
forall x. PullRequestOptions -> Rep PullRequestOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PullRequestOptions x -> PullRequestOptions
$cfrom :: forall x. PullRequestOptions -> Rep PullRequestOptions x
Generic, Typeable, Typeable PullRequestOptions
DataType
Constr
Typeable PullRequestOptions
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> PullRequestOptions
    -> c PullRequestOptions)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c PullRequestOptions)
-> (PullRequestOptions -> Constr)
-> (PullRequestOptions -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c PullRequestOptions))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c PullRequestOptions))
-> ((forall b. Data b => b -> b)
    -> PullRequestOptions -> PullRequestOptions)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> PullRequestOptions -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> PullRequestOptions -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> PullRequestOptions -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> PullRequestOptions -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> PullRequestOptions -> m PullRequestOptions)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> PullRequestOptions -> m PullRequestOptions)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> PullRequestOptions -> m PullRequestOptions)
-> Data PullRequestOptions
PullRequestOptions -> DataType
PullRequestOptions -> Constr
(forall b. Data b => b -> b)
-> PullRequestOptions -> PullRequestOptions
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PullRequestOptions
-> c PullRequestOptions
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PullRequestOptions
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) -> PullRequestOptions -> u
forall u. (forall d. Data d => d -> u) -> PullRequestOptions -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PullRequestOptions -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PullRequestOptions -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> PullRequestOptions -> m PullRequestOptions
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PullRequestOptions -> m PullRequestOptions
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PullRequestOptions
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PullRequestOptions
-> c PullRequestOptions
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PullRequestOptions)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PullRequestOptions)
$cPullRequestOptions :: Constr
$tPullRequestOptions :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> PullRequestOptions -> m PullRequestOptions
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PullRequestOptions -> m PullRequestOptions
gmapMp :: (forall d. Data d => d -> m d)
-> PullRequestOptions -> m PullRequestOptions
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PullRequestOptions -> m PullRequestOptions
gmapM :: (forall d. Data d => d -> m d)
-> PullRequestOptions -> m PullRequestOptions
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> PullRequestOptions -> m PullRequestOptions
gmapQi :: Int -> (forall d. Data d => d -> u) -> PullRequestOptions -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> PullRequestOptions -> u
gmapQ :: (forall d. Data d => d -> u) -> PullRequestOptions -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> PullRequestOptions -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PullRequestOptions -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PullRequestOptions -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PullRequestOptions -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PullRequestOptions -> r
gmapT :: (forall b. Data b => b -> b)
-> PullRequestOptions -> PullRequestOptions
$cgmapT :: (forall b. Data b => b -> b)
-> PullRequestOptions -> PullRequestOptions
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PullRequestOptions)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PullRequestOptions)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c PullRequestOptions)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PullRequestOptions)
dataTypeOf :: PullRequestOptions -> DataType
$cdataTypeOf :: PullRequestOptions -> DataType
toConstr :: PullRequestOptions -> Constr
$ctoConstr :: PullRequestOptions -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PullRequestOptions
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PullRequestOptions
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PullRequestOptions
-> c PullRequestOptions
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PullRequestOptions
-> c PullRequestOptions
$cp1Data :: Typeable PullRequestOptions
Data)

defaultPullRequestOptions :: PullRequestOptions
defaultPullRequestOptions :: PullRequestOptions
defaultPullRequestOptions = PullRequestOptions :: Maybe IssueState
-> Maybe Text
-> Maybe Text
-> SortPR
-> SortDirection
-> PullRequestOptions
PullRequestOptions
    { pullRequestOptionsState :: Maybe IssueState
pullRequestOptionsState     = IssueState -> Maybe IssueState
forall a. a -> Maybe a
Just IssueState
StateOpen
    , pullRequestOptionsHead :: Maybe Text
pullRequestOptionsHead      = Maybe Text
forall a. Maybe a
Nothing
    , pullRequestOptionsBase :: Maybe Text
pullRequestOptionsBase      = Maybe Text
forall a. Maybe a
Nothing
    , pullRequestOptionsSort :: SortPR
pullRequestOptionsSort      = SortPR
SortPRCreated
    , pullRequestOptionsDirection :: SortDirection
pullRequestOptionsDirection = SortDirection
SortDescending
    }

-- | See <https://developer.github.com/v3/pulls/#parameters>.
newtype PullRequestMod = PRMod (PullRequestOptions -> PullRequestOptions)

instance Semigroup PullRequestMod where
    PRMod PullRequestOptions -> PullRequestOptions
f <> :: PullRequestMod -> PullRequestMod -> PullRequestMod
<> PRMod PullRequestOptions -> PullRequestOptions
g = (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
PRMod (PullRequestOptions -> PullRequestOptions
g (PullRequestOptions -> PullRequestOptions)
-> (PullRequestOptions -> PullRequestOptions)
-> PullRequestOptions
-> PullRequestOptions
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PullRequestOptions -> PullRequestOptions
f)

instance Monoid PullRequestMod where
    mempty :: PullRequestMod
mempty  = (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
PRMod PullRequestOptions -> PullRequestOptions
forall a. a -> a
id
    mappend :: PullRequestMod -> PullRequestMod -> PullRequestMod
mappend = PullRequestMod -> PullRequestMod -> PullRequestMod
forall a. Semigroup a => a -> a -> a
(<>)

toPullRequestOptions :: PullRequestMod -> PullRequestOptions
toPullRequestOptions :: PullRequestMod -> PullRequestOptions
toPullRequestOptions (PRMod PullRequestOptions -> PullRequestOptions
f) = PullRequestOptions -> PullRequestOptions
f PullRequestOptions
defaultPullRequestOptions

prModToQueryString :: PullRequestMod -> QueryString
prModToQueryString :: PullRequestMod -> QueryString
prModToQueryString = PullRequestOptions -> QueryString
pullRequestOptionsToQueryString (PullRequestOptions -> QueryString)
-> (PullRequestMod -> PullRequestOptions)
-> PullRequestMod
-> QueryString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PullRequestMod -> PullRequestOptions
toPullRequestOptions

pullRequestOptionsToQueryString :: PullRequestOptions -> QueryString
pullRequestOptionsToQueryString :: PullRequestOptions -> QueryString
pullRequestOptionsToQueryString (PullRequestOptions Maybe IssueState
st Maybe Text
head_ Maybe Text
base SortPR
sort SortDirection
dir) =
    [ ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"state"     ByteString
state'
    , ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"sort"      ByteString
sort'
    , ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"direction" ByteString
direction'
    ] QueryString -> QueryString -> QueryString
forall a. [a] -> [a] -> [a]
++ [Maybe (ByteString, Maybe ByteString)] -> QueryString
forall a. [Maybe a] -> [a]
catMaybes
    [ ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"head" (ByteString -> (ByteString, Maybe ByteString))
-> Maybe ByteString -> Maybe (ByteString, Maybe ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe ByteString
head'
    , ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"base" (ByteString -> (ByteString, Maybe ByteString))
-> Maybe ByteString -> Maybe (ByteString, Maybe ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe ByteString
base'
    ]
  where
    mk :: a -> a -> (a, Maybe a)
mk a
k a
v = (a
k, a -> Maybe a
forall a. a -> Maybe a
Just a
v)
    state' :: ByteString
state' = case Maybe IssueState
st of
        Maybe IssueState
Nothing          -> ByteString
"all"
        Just IssueState
StateOpen   -> ByteString
"open"
        Just IssueState
StateClosed -> ByteString
"closed"
    sort' :: ByteString
sort' = case SortPR
sort of
        SortPR
SortPRCreated     -> ByteString
"created"
        SortPR
SortPRUpdated     -> ByteString
"updated"
        SortPR
SortPRPopularity  -> ByteString
"popularity"
        SortPR
SortPRLongRunning -> ByteString
"long-running"
    direction' :: ByteString
direction' = case SortDirection
dir of
       SortDirection
SortDescending -> ByteString
"desc"
       SortDirection
SortAscending  -> ByteString
"asc"
    head' :: Maybe ByteString
head' = (Text -> ByteString) -> Maybe Text -> Maybe ByteString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Text -> ByteString
TE.encodeUtf8 Maybe Text
head_
    base' :: Maybe ByteString
base' = (Text -> ByteString) -> Maybe Text -> Maybe ByteString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Text -> ByteString
TE.encodeUtf8 Maybe Text
base

-------------------------------------------------------------------------------
-- Pull request modifiers
-------------------------------------------------------------------------------

optionsBase :: Text -> PullRequestMod
optionsBase :: Text -> PullRequestMod
optionsBase Text
x = (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
PRMod ((PullRequestOptions -> PullRequestOptions) -> PullRequestMod)
-> (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
forall a b. (a -> b) -> a -> b
$ \PullRequestOptions
opts ->
    PullRequestOptions
opts { pullRequestOptionsBase :: Maybe Text
pullRequestOptionsBase = Text -> Maybe Text
forall a. a -> Maybe a
Just Text
x }

optionsNoBase :: PullRequestMod
optionsNoBase :: PullRequestMod
optionsNoBase = (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
PRMod ((PullRequestOptions -> PullRequestOptions) -> PullRequestMod)
-> (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
forall a b. (a -> b) -> a -> b
$ \PullRequestOptions
opts ->
    PullRequestOptions
opts { pullRequestOptionsBase :: Maybe Text
pullRequestOptionsBase = Maybe Text
forall a. Maybe a
Nothing }

optionsHead :: Text -> PullRequestMod
optionsHead :: Text -> PullRequestMod
optionsHead Text
x = (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
PRMod ((PullRequestOptions -> PullRequestOptions) -> PullRequestMod)
-> (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
forall a b. (a -> b) -> a -> b
$ \PullRequestOptions
opts ->
    PullRequestOptions
opts { pullRequestOptionsHead :: Maybe Text
pullRequestOptionsHead = Text -> Maybe Text
forall a. a -> Maybe a
Just Text
x }

optionsNoHead :: PullRequestMod
optionsNoHead :: PullRequestMod
optionsNoHead = (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
PRMod ((PullRequestOptions -> PullRequestOptions) -> PullRequestMod)
-> (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
forall a b. (a -> b) -> a -> b
$ \PullRequestOptions
opts ->
    PullRequestOptions
opts { pullRequestOptionsHead :: Maybe Text
pullRequestOptionsHead = Maybe Text
forall a. Maybe a
Nothing }

sortByPopularity :: PullRequestMod
sortByPopularity :: PullRequestMod
sortByPopularity = (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
PRMod ((PullRequestOptions -> PullRequestOptions) -> PullRequestMod)
-> (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
forall a b. (a -> b) -> a -> b
$ \PullRequestOptions
opts ->
    PullRequestOptions
opts { pullRequestOptionsSort :: SortPR
pullRequestOptionsSort = SortPR
SortPRPopularity }

sortByLongRunning :: PullRequestMod
sortByLongRunning :: PullRequestMod
sortByLongRunning = (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
PRMod ((PullRequestOptions -> PullRequestOptions) -> PullRequestMod)
-> (PullRequestOptions -> PullRequestOptions) -> PullRequestMod
forall a b. (a -> b) -> a -> b
$ \PullRequestOptions
opts ->
    PullRequestOptions
opts { pullRequestOptionsSort :: SortPR
pullRequestOptionsSort = SortPR
SortPRLongRunning }

-------------------------------------------------------------------------------
-- Issues
-------------------------------------------------------------------------------

-- | See <https://docs.github.com/en/rest/reference/issues#list-issues-assigned-to-the-authenticated-user--parameters>.
data IssueOptions = IssueOptions
    { IssueOptions -> IssueFilter
issueOptionsFilter    :: !IssueFilter
    , IssueOptions -> Maybe IssueState
issueOptionsState     :: !(Maybe IssueState)
    , IssueOptions -> [Name IssueLabel]
issueOptionsLabels    :: ![Name IssueLabel] -- TODO: change to newtype
    , IssueOptions -> SortIssue
issueOptionsSort      :: !SortIssue
    , IssueOptions -> SortDirection
issueOptionsDirection :: !SortDirection
    , IssueOptions -> Maybe UTCTime
issueOptionsSince     :: !(Maybe UTCTime)
    }
  deriving
    (IssueOptions -> IssueOptions -> Bool
(IssueOptions -> IssueOptions -> Bool)
-> (IssueOptions -> IssueOptions -> Bool) -> Eq IssueOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IssueOptions -> IssueOptions -> Bool
$c/= :: IssueOptions -> IssueOptions -> Bool
== :: IssueOptions -> IssueOptions -> Bool
$c== :: IssueOptions -> IssueOptions -> Bool
Eq, Eq IssueOptions
Eq IssueOptions
-> (IssueOptions -> IssueOptions -> Ordering)
-> (IssueOptions -> IssueOptions -> Bool)
-> (IssueOptions -> IssueOptions -> Bool)
-> (IssueOptions -> IssueOptions -> Bool)
-> (IssueOptions -> IssueOptions -> Bool)
-> (IssueOptions -> IssueOptions -> IssueOptions)
-> (IssueOptions -> IssueOptions -> IssueOptions)
-> Ord IssueOptions
IssueOptions -> IssueOptions -> Bool
IssueOptions -> IssueOptions -> Ordering
IssueOptions -> IssueOptions -> IssueOptions
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 :: IssueOptions -> IssueOptions -> IssueOptions
$cmin :: IssueOptions -> IssueOptions -> IssueOptions
max :: IssueOptions -> IssueOptions -> IssueOptions
$cmax :: IssueOptions -> IssueOptions -> IssueOptions
>= :: IssueOptions -> IssueOptions -> Bool
$c>= :: IssueOptions -> IssueOptions -> Bool
> :: IssueOptions -> IssueOptions -> Bool
$c> :: IssueOptions -> IssueOptions -> Bool
<= :: IssueOptions -> IssueOptions -> Bool
$c<= :: IssueOptions -> IssueOptions -> Bool
< :: IssueOptions -> IssueOptions -> Bool
$c< :: IssueOptions -> IssueOptions -> Bool
compare :: IssueOptions -> IssueOptions -> Ordering
$ccompare :: IssueOptions -> IssueOptions -> Ordering
$cp1Ord :: Eq IssueOptions
Ord, Int -> IssueOptions -> ShowS
[IssueOptions] -> ShowS
IssueOptions -> String
(Int -> IssueOptions -> ShowS)
-> (IssueOptions -> String)
-> ([IssueOptions] -> ShowS)
-> Show IssueOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IssueOptions] -> ShowS
$cshowList :: [IssueOptions] -> ShowS
show :: IssueOptions -> String
$cshow :: IssueOptions -> String
showsPrec :: Int -> IssueOptions -> ShowS
$cshowsPrec :: Int -> IssueOptions -> ShowS
Show, (forall x. IssueOptions -> Rep IssueOptions x)
-> (forall x. Rep IssueOptions x -> IssueOptions)
-> Generic IssueOptions
forall x. Rep IssueOptions x -> IssueOptions
forall x. IssueOptions -> Rep IssueOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IssueOptions x -> IssueOptions
$cfrom :: forall x. IssueOptions -> Rep IssueOptions x
Generic, Typeable, Typeable IssueOptions
DataType
Constr
Typeable IssueOptions
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> IssueOptions -> c IssueOptions)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c IssueOptions)
-> (IssueOptions -> Constr)
-> (IssueOptions -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c IssueOptions))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c IssueOptions))
-> ((forall b. Data b => b -> b) -> IssueOptions -> IssueOptions)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> IssueOptions -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> IssueOptions -> r)
-> (forall u. (forall d. Data d => d -> u) -> IssueOptions -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> IssueOptions -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> IssueOptions -> m IssueOptions)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> IssueOptions -> m IssueOptions)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> IssueOptions -> m IssueOptions)
-> Data IssueOptions
IssueOptions -> DataType
IssueOptions -> Constr
(forall b. Data b => b -> b) -> IssueOptions -> IssueOptions
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueOptions -> c IssueOptions
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueOptions
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) -> IssueOptions -> u
forall u. (forall d. Data d => d -> u) -> IssueOptions -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IssueOptions -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IssueOptions -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> IssueOptions -> m IssueOptions
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> IssueOptions -> m IssueOptions
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueOptions
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueOptions -> c IssueOptions
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c IssueOptions)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c IssueOptions)
$cIssueOptions :: Constr
$tIssueOptions :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> IssueOptions -> m IssueOptions
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> IssueOptions -> m IssueOptions
gmapMp :: (forall d. Data d => d -> m d) -> IssueOptions -> m IssueOptions
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> IssueOptions -> m IssueOptions
gmapM :: (forall d. Data d => d -> m d) -> IssueOptions -> m IssueOptions
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> IssueOptions -> m IssueOptions
gmapQi :: Int -> (forall d. Data d => d -> u) -> IssueOptions -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> IssueOptions -> u
gmapQ :: (forall d. Data d => d -> u) -> IssueOptions -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> IssueOptions -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IssueOptions -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IssueOptions -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IssueOptions -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IssueOptions -> r
gmapT :: (forall b. Data b => b -> b) -> IssueOptions -> IssueOptions
$cgmapT :: (forall b. Data b => b -> b) -> IssueOptions -> IssueOptions
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c IssueOptions)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c IssueOptions)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c IssueOptions)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c IssueOptions)
dataTypeOf :: IssueOptions -> DataType
$cdataTypeOf :: IssueOptions -> DataType
toConstr :: IssueOptions -> Constr
$ctoConstr :: IssueOptions -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueOptions
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueOptions
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueOptions -> c IssueOptions
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueOptions -> c IssueOptions
$cp1Data :: Typeable IssueOptions
Data)

defaultIssueOptions :: IssueOptions
defaultIssueOptions :: IssueOptions
defaultIssueOptions = IssueOptions :: IssueFilter
-> Maybe IssueState
-> [Name IssueLabel]
-> SortIssue
-> SortDirection
-> Maybe UTCTime
-> IssueOptions
IssueOptions
    { issueOptionsFilter :: IssueFilter
issueOptionsFilter    = IssueFilter
IssueFilterAssigned
    , issueOptionsState :: Maybe IssueState
issueOptionsState     = IssueState -> Maybe IssueState
forall a. a -> Maybe a
Just IssueState
StateOpen
    , issueOptionsLabels :: [Name IssueLabel]
issueOptionsLabels    = []
    , issueOptionsSort :: SortIssue
issueOptionsSort      = SortIssue
SortIssueCreated
    , issueOptionsDirection :: SortDirection
issueOptionsDirection = SortDirection
SortDescending
    , issueOptionsSince :: Maybe UTCTime
issueOptionsSince     = Maybe UTCTime
forall a. Maybe a
Nothing
    }

-- | See <https://docs.github.com/en/rest/reference/issues#list-issues-assigned-to-the-authenticated-user--parameters>.
newtype IssueMod = IssueMod (IssueOptions -> IssueOptions)

instance Semigroup IssueMod where
    IssueMod IssueOptions -> IssueOptions
f <> :: IssueMod -> IssueMod -> IssueMod
<> IssueMod IssueOptions -> IssueOptions
g = (IssueOptions -> IssueOptions) -> IssueMod
IssueMod (IssueOptions -> IssueOptions
g (IssueOptions -> IssueOptions)
-> (IssueOptions -> IssueOptions) -> IssueOptions -> IssueOptions
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IssueOptions -> IssueOptions
f)

instance Monoid IssueMod where
    mempty :: IssueMod
mempty  = (IssueOptions -> IssueOptions) -> IssueMod
IssueMod IssueOptions -> IssueOptions
forall a. a -> a
id
    mappend :: IssueMod -> IssueMod -> IssueMod
mappend = IssueMod -> IssueMod -> IssueMod
forall a. Semigroup a => a -> a -> a
(<>)

toIssueOptions :: IssueMod -> IssueOptions
toIssueOptions :: IssueMod -> IssueOptions
toIssueOptions (IssueMod IssueOptions -> IssueOptions
f) = IssueOptions -> IssueOptions
f IssueOptions
defaultIssueOptions

issueModToQueryString :: IssueMod -> QueryString
issueModToQueryString :: IssueMod -> QueryString
issueModToQueryString = IssueOptions -> QueryString
issueOptionsToQueryString (IssueOptions -> QueryString)
-> (IssueMod -> IssueOptions) -> IssueMod -> QueryString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IssueMod -> IssueOptions
toIssueOptions

issueOptionsToQueryString :: IssueOptions -> QueryString
issueOptionsToQueryString :: IssueOptions -> QueryString
issueOptionsToQueryString (IssueOptions IssueFilter
filt Maybe IssueState
st [Name IssueLabel]
labels SortIssue
sort SortDirection
dir Maybe UTCTime
since) =
    [ ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"state"     ByteString
state'
    , ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"sort"      ByteString
sort'
    , ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"direction" ByteString
direction'
    , ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"filter" ByteString
filt'
    ] QueryString -> QueryString -> QueryString
forall a. [a] -> [a] -> [a]
++ [Maybe (ByteString, Maybe ByteString)] -> QueryString
forall a. [Maybe a] -> [a]
catMaybes
    [ ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"labels" (ByteString -> (ByteString, Maybe ByteString))
-> Maybe ByteString -> Maybe (ByteString, Maybe ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe ByteString
labels'
    , ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"since" (ByteString -> (ByteString, Maybe ByteString))
-> Maybe ByteString -> Maybe (ByteString, Maybe ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe ByteString
since'
    ]
  where
    mk :: a -> a -> (a, Maybe a)
mk a
k a
v = (a
k, a -> Maybe a
forall a. a -> Maybe a
Just a
v)
    filt' :: ByteString
filt' = case IssueFilter
filt of
        IssueFilter
IssueFilterAssigned   -> ByteString
"assigned"
        IssueFilter
IssueFilterCreated    -> ByteString
"created"
        IssueFilter
IssueFilterMentioned  -> ByteString
"mentioned"
        IssueFilter
IssueFilterSubscribed -> ByteString
"subscribed"
        IssueFilter
IssueFilterAll        -> ByteString
"all"
    state' :: ByteString
state' = case Maybe IssueState
st of
        Maybe IssueState
Nothing          -> ByteString
"all"
        Just IssueState
StateOpen   -> ByteString
"open"
        Just IssueState
StateClosed -> ByteString
"closed"
    sort' :: ByteString
sort' = case SortIssue
sort of
        SortIssue
SortIssueCreated  -> ByteString
"created"
        SortIssue
SortIssueUpdated  -> ByteString
"updated"
        SortIssue
SortIssueComments -> ByteString
"comments"
    direction' :: ByteString
direction' = case SortDirection
dir of
       SortDirection
SortDescending -> ByteString
"desc"
       SortDirection
SortAscending  -> ByteString
"asc"

    since' :: Maybe ByteString
since' = (UTCTime -> ByteString) -> Maybe UTCTime -> Maybe ByteString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Text -> ByteString
TE.encodeUtf8 (Text -> ByteString) -> (UTCTime -> Text) -> UTCTime -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Text
T.pack (String -> Text) -> (UTCTime -> String) -> UTCTime -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UTCTime -> String
forall a. Show a => a -> String
show) Maybe UTCTime
since
    labels' :: Maybe ByteString
labels' = Text -> ByteString
TE.encodeUtf8 (Text -> ByteString)
-> ([Name IssueLabel] -> Text) -> [Name IssueLabel] -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> [Text] -> Text
T.intercalate Text
"," ([Text] -> Text)
-> ([Name IssueLabel] -> [Text]) -> [Name IssueLabel] -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Name IssueLabel -> Text) -> [Name IssueLabel] -> [Text]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Name IssueLabel -> Text
forall entity. Name entity -> Text
untagName ([Name IssueLabel] -> ByteString)
-> Maybe [Name IssueLabel] -> Maybe ByteString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Name IssueLabel] -> Maybe [Name IssueLabel]
forall (f :: * -> *) a. Foldable f => f a -> Maybe (f a)
nullToNothing [Name IssueLabel]
labels

nullToNothing :: Foldable f => f a -> Maybe (f a)
nullToNothing :: f a -> Maybe (f a)
nullToNothing f a
xs
    | f a -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null f a
xs   = Maybe (f a)
forall a. Maybe a
Nothing
    | Bool
otherwise = f a -> Maybe (f a)
forall a. a -> Maybe a
Just f a
xs

-------------------------------------------------------------------------------
-- Issues modifiers
-------------------------------------------------------------------------------

class HasComments mod where
    sortByComments :: mod

instance HasComments IssueMod where
    sortByComments :: IssueMod
sortByComments = (IssueOptions -> IssueOptions) -> IssueMod
IssueMod ((IssueOptions -> IssueOptions) -> IssueMod)
-> (IssueOptions -> IssueOptions) -> IssueMod
forall a b. (a -> b) -> a -> b
$ \IssueOptions
opts ->
        IssueOptions
opts { issueOptionsSort :: SortIssue
issueOptionsSort = SortIssue
SortIssueComments }

instance HasComments IssueRepoMod where
    sortByComments :: IssueRepoMod
sortByComments = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
        IssueRepoOptions
opts { issueRepoOptionsSort :: SortIssue
issueRepoOptionsSort = SortIssue
SortIssueComments }


class HasLabels mod where
    optionsLabels :: Foldable f => f (Name IssueLabel) -> mod

instance HasLabels IssueMod where
    optionsLabels :: f (Name IssueLabel) -> IssueMod
optionsLabels f (Name IssueLabel)
lbls = (IssueOptions -> IssueOptions) -> IssueMod
IssueMod ((IssueOptions -> IssueOptions) -> IssueMod)
-> (IssueOptions -> IssueOptions) -> IssueMod
forall a b. (a -> b) -> a -> b
$ \IssueOptions
opts ->
        IssueOptions
opts { issueOptionsLabels :: [Name IssueLabel]
issueOptionsLabels = f (Name IssueLabel) -> [Name IssueLabel]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList f (Name IssueLabel)
lbls }

instance HasLabels IssueRepoMod where
    optionsLabels :: f (Name IssueLabel) -> IssueRepoMod
optionsLabels f (Name IssueLabel)
lbls = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
        IssueRepoOptions
opts { issueRepoOptionsLabels :: [Name IssueLabel]
issueRepoOptionsLabels = f (Name IssueLabel) -> [Name IssueLabel]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList f (Name IssueLabel)
lbls }


class HasSince mod where
    optionsSince :: UTCTime -> mod
    optionsSinceAll :: mod

instance HasSince IssueMod where
    optionsSince :: UTCTime -> IssueMod
optionsSince UTCTime
since = (IssueOptions -> IssueOptions) -> IssueMod
IssueMod ((IssueOptions -> IssueOptions) -> IssueMod)
-> (IssueOptions -> IssueOptions) -> IssueMod
forall a b. (a -> b) -> a -> b
$ \IssueOptions
opts ->
        IssueOptions
opts { issueOptionsSince :: Maybe UTCTime
issueOptionsSince = UTCTime -> Maybe UTCTime
forall a. a -> Maybe a
Just UTCTime
since }
    optionsSinceAll :: IssueMod
optionsSinceAll = (IssueOptions -> IssueOptions) -> IssueMod
IssueMod ((IssueOptions -> IssueOptions) -> IssueMod)
-> (IssueOptions -> IssueOptions) -> IssueMod
forall a b. (a -> b) -> a -> b
$ \IssueOptions
opts ->
        IssueOptions
opts { issueOptionsSince :: Maybe UTCTime
issueOptionsSince = Maybe UTCTime
forall a. Maybe a
Nothing }

instance HasSince IssueRepoMod where
    optionsSince :: UTCTime -> IssueRepoMod
optionsSince UTCTime
since = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
        IssueRepoOptions
opts { issueRepoOptionsSince :: Maybe UTCTime
issueRepoOptionsSince = UTCTime -> Maybe UTCTime
forall a. a -> Maybe a
Just UTCTime
since }
    optionsSinceAll :: IssueRepoMod
optionsSinceAll = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
        IssueRepoOptions
opts { issueRepoOptionsSince :: Maybe UTCTime
issueRepoOptionsSince = Maybe UTCTime
forall a. Maybe a
Nothing }

-------------------------------------------------------------------------------
-- Only issues modifiers
-------------------------------------------------------------------------------

optionsAssignedIssues, optionsCreatedIssues, optionsMentionedIssues,
  optionsSubscribedIssues, optionsAllIssues  :: IssueMod
optionsAssignedIssues :: IssueMod
optionsAssignedIssues   = IssueFilter -> IssueMod
issueFilter IssueFilter
IssueFilterAssigned
optionsCreatedIssues :: IssueMod
optionsCreatedIssues    = IssueFilter -> IssueMod
issueFilter IssueFilter
IssueFilterCreated
optionsMentionedIssues :: IssueMod
optionsMentionedIssues  = IssueFilter -> IssueMod
issueFilter IssueFilter
IssueFilterMentioned
optionsSubscribedIssues :: IssueMod
optionsSubscribedIssues = IssueFilter -> IssueMod
issueFilter IssueFilter
IssueFilterSubscribed
optionsAllIssues :: IssueMod
optionsAllIssues        = IssueFilter -> IssueMod
issueFilter IssueFilter
IssueFilterAll

issueFilter :: IssueFilter -> IssueMod
issueFilter :: IssueFilter -> IssueMod
issueFilter IssueFilter
f = (IssueOptions -> IssueOptions) -> IssueMod
IssueMod ((IssueOptions -> IssueOptions) -> IssueMod)
-> (IssueOptions -> IssueOptions) -> IssueMod
forall a b. (a -> b) -> a -> b
$ \IssueOptions
opts ->
    IssueOptions
opts { issueOptionsFilter :: IssueFilter
issueOptionsFilter = IssueFilter
f }

-------------------------------------------------------------------------------
-- Issues repo
-------------------------------------------------------------------------------

-- | Parameters of "list repository issues" (@get /repos/{owner}/{repo}/issues@).
--
-- See <https://docs.github.com/en/rest/reference/issues#list-repository-issues>.
--
data IssueRepoOptions = IssueRepoOptions
    { IssueRepoOptions -> FilterBy (Id Milestone)
issueRepoOptionsMilestone :: !(FilterBy (Id Milestone))   -- ^ 'optionsMilestone' etc.
    , IssueRepoOptions -> Maybe IssueState
issueRepoOptionsState     :: !(Maybe IssueState)          -- ^ 'HasState'
    , IssueRepoOptions -> FilterBy (Name User)
issueRepoOptionsAssignee  :: !(FilterBy (Name User))      -- ^ 'optionsAssignee' etc.
    , IssueRepoOptions -> Maybe (Name User)
issueRepoOptionsCreator   :: !(Maybe (Name User))         -- ^ 'optionsCreator'
    , IssueRepoOptions -> Maybe (Name User)
issueRepoOptionsMentioned :: !(Maybe (Name User))         -- ^ 'optionsMentioned'
    , IssueRepoOptions -> [Name IssueLabel]
issueRepoOptionsLabels    :: ![Name IssueLabel]           -- ^ 'HasLabels'
    , IssueRepoOptions -> SortIssue
issueRepoOptionsSort      :: !SortIssue                   -- ^ 'HasCreatedUpdated' and 'HasComments'
    , IssueRepoOptions -> SortDirection
issueRepoOptionsDirection :: !SortDirection               -- ^ 'HasDirection'
    , IssueRepoOptions -> Maybe UTCTime
issueRepoOptionsSince     :: !(Maybe UTCTime)             -- ^ 'HasSince'
    }
  deriving
    (IssueRepoOptions -> IssueRepoOptions -> Bool
(IssueRepoOptions -> IssueRepoOptions -> Bool)
-> (IssueRepoOptions -> IssueRepoOptions -> Bool)
-> Eq IssueRepoOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IssueRepoOptions -> IssueRepoOptions -> Bool
$c/= :: IssueRepoOptions -> IssueRepoOptions -> Bool
== :: IssueRepoOptions -> IssueRepoOptions -> Bool
$c== :: IssueRepoOptions -> IssueRepoOptions -> Bool
Eq, Eq IssueRepoOptions
Eq IssueRepoOptions
-> (IssueRepoOptions -> IssueRepoOptions -> Ordering)
-> (IssueRepoOptions -> IssueRepoOptions -> Bool)
-> (IssueRepoOptions -> IssueRepoOptions -> Bool)
-> (IssueRepoOptions -> IssueRepoOptions -> Bool)
-> (IssueRepoOptions -> IssueRepoOptions -> Bool)
-> (IssueRepoOptions -> IssueRepoOptions -> IssueRepoOptions)
-> (IssueRepoOptions -> IssueRepoOptions -> IssueRepoOptions)
-> Ord IssueRepoOptions
IssueRepoOptions -> IssueRepoOptions -> Bool
IssueRepoOptions -> IssueRepoOptions -> Ordering
IssueRepoOptions -> IssueRepoOptions -> IssueRepoOptions
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 :: IssueRepoOptions -> IssueRepoOptions -> IssueRepoOptions
$cmin :: IssueRepoOptions -> IssueRepoOptions -> IssueRepoOptions
max :: IssueRepoOptions -> IssueRepoOptions -> IssueRepoOptions
$cmax :: IssueRepoOptions -> IssueRepoOptions -> IssueRepoOptions
>= :: IssueRepoOptions -> IssueRepoOptions -> Bool
$c>= :: IssueRepoOptions -> IssueRepoOptions -> Bool
> :: IssueRepoOptions -> IssueRepoOptions -> Bool
$c> :: IssueRepoOptions -> IssueRepoOptions -> Bool
<= :: IssueRepoOptions -> IssueRepoOptions -> Bool
$c<= :: IssueRepoOptions -> IssueRepoOptions -> Bool
< :: IssueRepoOptions -> IssueRepoOptions -> Bool
$c< :: IssueRepoOptions -> IssueRepoOptions -> Bool
compare :: IssueRepoOptions -> IssueRepoOptions -> Ordering
$ccompare :: IssueRepoOptions -> IssueRepoOptions -> Ordering
$cp1Ord :: Eq IssueRepoOptions
Ord, Int -> IssueRepoOptions -> ShowS
[IssueRepoOptions] -> ShowS
IssueRepoOptions -> String
(Int -> IssueRepoOptions -> ShowS)
-> (IssueRepoOptions -> String)
-> ([IssueRepoOptions] -> ShowS)
-> Show IssueRepoOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IssueRepoOptions] -> ShowS
$cshowList :: [IssueRepoOptions] -> ShowS
show :: IssueRepoOptions -> String
$cshow :: IssueRepoOptions -> String
showsPrec :: Int -> IssueRepoOptions -> ShowS
$cshowsPrec :: Int -> IssueRepoOptions -> ShowS
Show, (forall x. IssueRepoOptions -> Rep IssueRepoOptions x)
-> (forall x. Rep IssueRepoOptions x -> IssueRepoOptions)
-> Generic IssueRepoOptions
forall x. Rep IssueRepoOptions x -> IssueRepoOptions
forall x. IssueRepoOptions -> Rep IssueRepoOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IssueRepoOptions x -> IssueRepoOptions
$cfrom :: forall x. IssueRepoOptions -> Rep IssueRepoOptions x
Generic, Typeable, Typeable IssueRepoOptions
DataType
Constr
Typeable IssueRepoOptions
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> IssueRepoOptions -> c IssueRepoOptions)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c IssueRepoOptions)
-> (IssueRepoOptions -> Constr)
-> (IssueRepoOptions -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c IssueRepoOptions))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c IssueRepoOptions))
-> ((forall b. Data b => b -> b)
    -> IssueRepoOptions -> IssueRepoOptions)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> IssueRepoOptions -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> IssueRepoOptions -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> IssueRepoOptions -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> IssueRepoOptions -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> IssueRepoOptions -> m IssueRepoOptions)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> IssueRepoOptions -> m IssueRepoOptions)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> IssueRepoOptions -> m IssueRepoOptions)
-> Data IssueRepoOptions
IssueRepoOptions -> DataType
IssueRepoOptions -> Constr
(forall b. Data b => b -> b)
-> IssueRepoOptions -> IssueRepoOptions
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueRepoOptions -> c IssueRepoOptions
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueRepoOptions
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) -> IssueRepoOptions -> u
forall u. (forall d. Data d => d -> u) -> IssueRepoOptions -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IssueRepoOptions -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IssueRepoOptions -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> IssueRepoOptions -> m IssueRepoOptions
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> IssueRepoOptions -> m IssueRepoOptions
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueRepoOptions
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueRepoOptions -> c IssueRepoOptions
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c IssueRepoOptions)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c IssueRepoOptions)
$cIssueRepoOptions :: Constr
$tIssueRepoOptions :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> IssueRepoOptions -> m IssueRepoOptions
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> IssueRepoOptions -> m IssueRepoOptions
gmapMp :: (forall d. Data d => d -> m d)
-> IssueRepoOptions -> m IssueRepoOptions
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> IssueRepoOptions -> m IssueRepoOptions
gmapM :: (forall d. Data d => d -> m d)
-> IssueRepoOptions -> m IssueRepoOptions
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> IssueRepoOptions -> m IssueRepoOptions
gmapQi :: Int -> (forall d. Data d => d -> u) -> IssueRepoOptions -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> IssueRepoOptions -> u
gmapQ :: (forall d. Data d => d -> u) -> IssueRepoOptions -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> IssueRepoOptions -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IssueRepoOptions -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IssueRepoOptions -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IssueRepoOptions -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IssueRepoOptions -> r
gmapT :: (forall b. Data b => b -> b)
-> IssueRepoOptions -> IssueRepoOptions
$cgmapT :: (forall b. Data b => b -> b)
-> IssueRepoOptions -> IssueRepoOptions
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c IssueRepoOptions)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c IssueRepoOptions)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c IssueRepoOptions)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c IssueRepoOptions)
dataTypeOf :: IssueRepoOptions -> DataType
$cdataTypeOf :: IssueRepoOptions -> DataType
toConstr :: IssueRepoOptions -> Constr
$ctoConstr :: IssueRepoOptions -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueRepoOptions
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IssueRepoOptions
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueRepoOptions -> c IssueRepoOptions
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IssueRepoOptions -> c IssueRepoOptions
$cp1Data :: Typeable IssueRepoOptions
Data)

defaultIssueRepoOptions :: IssueRepoOptions
defaultIssueRepoOptions :: IssueRepoOptions
defaultIssueRepoOptions = IssueRepoOptions :: FilterBy (Id Milestone)
-> Maybe IssueState
-> FilterBy (Name User)
-> Maybe (Name User)
-> Maybe (Name User)
-> [Name IssueLabel]
-> SortIssue
-> SortDirection
-> Maybe UTCTime
-> IssueRepoOptions
IssueRepoOptions
    { issueRepoOptionsMilestone :: FilterBy (Id Milestone)
issueRepoOptionsMilestone = FilterBy (Id Milestone)
forall a. FilterBy a
FilterNotSpecified
    , issueRepoOptionsState :: Maybe IssueState
issueRepoOptionsState     = (IssueState -> Maybe IssueState
forall a. a -> Maybe a
Just IssueState
StateOpen)
    , issueRepoOptionsAssignee :: FilterBy (Name User)
issueRepoOptionsAssignee  = FilterBy (Name User)
forall a. FilterBy a
FilterNotSpecified
    , issueRepoOptionsCreator :: Maybe (Name User)
issueRepoOptionsCreator   = Maybe (Name User)
forall a. Maybe a
Nothing
    , issueRepoOptionsMentioned :: Maybe (Name User)
issueRepoOptionsMentioned = Maybe (Name User)
forall a. Maybe a
Nothing
    , issueRepoOptionsLabels :: [Name IssueLabel]
issueRepoOptionsLabels    = []
    , issueRepoOptionsSort :: SortIssue
issueRepoOptionsSort      = SortIssue
SortIssueCreated
    , issueRepoOptionsDirection :: SortDirection
issueRepoOptionsDirection = SortDirection
SortDescending
    , issueRepoOptionsSince :: Maybe UTCTime
issueRepoOptionsSince     = Maybe UTCTime
forall a. Maybe a
Nothing
    }

-- | See <https://developer.github.com/v3/issues/#parameters-1>.
newtype IssueRepoMod = IssueRepoMod (IssueRepoOptions -> IssueRepoOptions)

instance Semigroup IssueRepoMod where
    IssueRepoMod IssueRepoOptions -> IssueRepoOptions
f <> :: IssueRepoMod -> IssueRepoMod -> IssueRepoMod
<> IssueRepoMod IssueRepoOptions -> IssueRepoOptions
g = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod (IssueRepoOptions -> IssueRepoOptions
g (IssueRepoOptions -> IssueRepoOptions)
-> (IssueRepoOptions -> IssueRepoOptions)
-> IssueRepoOptions
-> IssueRepoOptions
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IssueRepoOptions -> IssueRepoOptions
f)

instance Monoid IssueRepoMod where
    mempty :: IssueRepoMod
mempty  = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod IssueRepoOptions -> IssueRepoOptions
forall a. a -> a
id
    mappend :: IssueRepoMod -> IssueRepoMod -> IssueRepoMod
mappend = IssueRepoMod -> IssueRepoMod -> IssueRepoMod
forall a. Semigroup a => a -> a -> a
(<>)

toIssueRepoOptions :: IssueRepoMod -> IssueRepoOptions
toIssueRepoOptions :: IssueRepoMod -> IssueRepoOptions
toIssueRepoOptions (IssueRepoMod IssueRepoOptions -> IssueRepoOptions
f) = IssueRepoOptions -> IssueRepoOptions
f IssueRepoOptions
defaultIssueRepoOptions

issueRepoModToQueryString :: IssueRepoMod -> QueryString
issueRepoModToQueryString :: IssueRepoMod -> QueryString
issueRepoModToQueryString = IssueRepoOptions -> QueryString
issueRepoOptionsToQueryString (IssueRepoOptions -> QueryString)
-> (IssueRepoMod -> IssueRepoOptions)
-> IssueRepoMod
-> QueryString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IssueRepoMod -> IssueRepoOptions
toIssueRepoOptions

issueRepoOptionsToQueryString :: IssueRepoOptions -> QueryString
issueRepoOptionsToQueryString :: IssueRepoOptions -> QueryString
issueRepoOptionsToQueryString IssueRepoOptions {[Name IssueLabel]
Maybe UTCTime
Maybe (Name User)
Maybe IssueState
FilterBy (Name User)
FilterBy (Id Milestone)
SortIssue
SortDirection
issueRepoOptionsSince :: Maybe UTCTime
issueRepoOptionsDirection :: SortDirection
issueRepoOptionsSort :: SortIssue
issueRepoOptionsLabels :: [Name IssueLabel]
issueRepoOptionsMentioned :: Maybe (Name User)
issueRepoOptionsCreator :: Maybe (Name User)
issueRepoOptionsAssignee :: FilterBy (Name User)
issueRepoOptionsState :: Maybe IssueState
issueRepoOptionsMilestone :: FilterBy (Id Milestone)
issueRepoOptionsMentioned :: IssueRepoOptions -> Maybe (Name User)
issueRepoOptionsCreator :: IssueRepoOptions -> Maybe (Name User)
issueRepoOptionsAssignee :: IssueRepoOptions -> FilterBy (Name User)
issueRepoOptionsMilestone :: IssueRepoOptions -> FilterBy (Id Milestone)
issueRepoOptionsSince :: IssueRepoOptions -> Maybe UTCTime
issueRepoOptionsLabels :: IssueRepoOptions -> [Name IssueLabel]
issueRepoOptionsSort :: IssueRepoOptions -> SortIssue
issueRepoOptionsDirection :: IssueRepoOptions -> SortDirection
issueRepoOptionsState :: IssueRepoOptions -> Maybe IssueState
..} =
    [ ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"state"     ByteString
state'
    , ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"sort"      ByteString
sort'
    , ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"direction" ByteString
direction'
    ] QueryString -> QueryString -> QueryString
forall a. [a] -> [a] -> [a]
++ [Maybe (ByteString, Maybe ByteString)] -> QueryString
forall a. [Maybe a] -> [a]
catMaybes
    [ ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"milestone" (ByteString -> (ByteString, Maybe ByteString))
-> Maybe ByteString -> Maybe (ByteString, Maybe ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe ByteString
milestone'
    , ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"assignee"  (ByteString -> (ByteString, Maybe ByteString))
-> Maybe ByteString -> Maybe (ByteString, Maybe ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe ByteString
assignee'
    , ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"labels"    (ByteString -> (ByteString, Maybe ByteString))
-> Maybe ByteString -> Maybe (ByteString, Maybe ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe ByteString
labels'
    , ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"since"     (ByteString -> (ByteString, Maybe ByteString))
-> Maybe ByteString -> Maybe (ByteString, Maybe ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe ByteString
since'
    , ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"creator"   (ByteString -> (ByteString, Maybe ByteString))
-> Maybe ByteString -> Maybe (ByteString, Maybe ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe ByteString
creator'
    , ByteString -> ByteString -> (ByteString, Maybe ByteString)
forall a a. a -> a -> (a, Maybe a)
mk ByteString
"mentioned" (ByteString -> (ByteString, Maybe ByteString))
-> Maybe ByteString -> Maybe (ByteString, Maybe ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe ByteString
mentioned'
    ]
  where
    mk :: a -> a -> (a, Maybe a)
mk a
k a
v = (a
k, a -> Maybe a
forall a. a -> Maybe a
Just a
v)
    filt :: (t -> Text) -> FilterBy t -> Maybe ByteString
filt t -> Text
f FilterBy t
x = case FilterBy t
x of
        FilterBy t
FilterAny          -> ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just ByteString
"*"
        FilterBy t
FilterNone         -> ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just ByteString
"none"
        FilterBy t
x'        -> ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just (ByteString -> Maybe ByteString) -> ByteString -> Maybe ByteString
forall a b. (a -> b) -> a -> b
$ Text -> ByteString
TE.encodeUtf8 (Text -> ByteString) -> Text -> ByteString
forall a b. (a -> b) -> a -> b
$ t -> Text
f t
x'
        FilterBy t
FilterNotSpecified -> Maybe ByteString
forall a. Maybe a
Nothing

    milestone' :: Maybe ByteString
milestone' = (Id Milestone -> Text)
-> FilterBy (Id Milestone) -> Maybe ByteString
forall t. (t -> Text) -> FilterBy t -> Maybe ByteString
filt (String -> Text
T.pack (String -> Text)
-> (Id Milestone -> String) -> Id Milestone -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Id Milestone -> Int) -> Id Milestone -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Id Milestone -> Int
forall entity. Id entity -> Int
untagId) FilterBy (Id Milestone)
issueRepoOptionsMilestone
    assignee' :: Maybe ByteString
assignee'  = (Name User -> Text) -> FilterBy (Name User) -> Maybe ByteString
forall t. (t -> Text) -> FilterBy t -> Maybe ByteString
filt Name User -> Text
forall entity. Name entity -> Text
untagName FilterBy (Name User)
issueRepoOptionsAssignee

    state' :: ByteString
state' = case Maybe IssueState
issueRepoOptionsState of
        Maybe IssueState
Nothing          -> ByteString
"all"
        Just IssueState
StateOpen   -> ByteString
"open"
        Just IssueState
StateClosed -> ByteString
"closed"
    sort' :: ByteString
sort' = case SortIssue
issueRepoOptionsSort of
        SortIssue
SortIssueCreated  -> ByteString
"created"
        SortIssue
SortIssueUpdated  -> ByteString
"updated"
        SortIssue
SortIssueComments -> ByteString
"comments"
    direction' :: ByteString
direction' = case SortDirection
issueRepoOptionsDirection of
       SortDirection
SortDescending -> ByteString
"desc"
       SortDirection
SortAscending  -> ByteString
"asc"

    since' :: Maybe ByteString
since'     = Text -> ByteString
TE.encodeUtf8 (Text -> ByteString) -> (UTCTime -> Text) -> UTCTime -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Text
T.pack (String -> Text) -> (UTCTime -> String) -> UTCTime -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UTCTime -> String
forall a. Show a => a -> String
show (UTCTime -> ByteString) -> Maybe UTCTime -> Maybe ByteString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe UTCTime
issueRepoOptionsSince
    labels' :: Maybe ByteString
labels'    = Text -> ByteString
TE.encodeUtf8 (Text -> ByteString)
-> ([Name IssueLabel] -> Text) -> [Name IssueLabel] -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> [Text] -> Text
T.intercalate Text
"," ([Text] -> Text)
-> ([Name IssueLabel] -> [Text]) -> [Name IssueLabel] -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Name IssueLabel -> Text) -> [Name IssueLabel] -> [Text]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Name IssueLabel -> Text
forall entity. Name entity -> Text
untagName ([Name IssueLabel] -> ByteString)
-> Maybe [Name IssueLabel] -> Maybe ByteString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Name IssueLabel] -> Maybe [Name IssueLabel]
forall (f :: * -> *) a. Foldable f => f a -> Maybe (f a)
nullToNothing [Name IssueLabel]
issueRepoOptionsLabels
    creator' :: Maybe ByteString
creator'   = Text -> ByteString
TE.encodeUtf8 (Text -> ByteString)
-> (Name User -> Text) -> Name User -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Name User -> Text
forall entity. Name entity -> Text
untagName (Name User -> ByteString) -> Maybe (Name User) -> Maybe ByteString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (Name User)
issueRepoOptionsCreator
    mentioned' :: Maybe ByteString
mentioned' = Text -> ByteString
TE.encodeUtf8 (Text -> ByteString)
-> (Name User -> Text) -> Name User -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Name User -> Text
forall entity. Name entity -> Text
untagName (Name User -> ByteString) -> Maybe (Name User) -> Maybe ByteString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (Name User)
issueRepoOptionsMentioned

-------------------------------------------------------------------------------
-- Issues repo modifiers
-------------------------------------------------------------------------------

-- | Issues created by a certain user.
optionsCreator :: Name User -> IssueRepoMod
optionsCreator :: Name User -> IssueRepoMod
optionsCreator Name User
u = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
    IssueRepoOptions
opts { issueRepoOptionsCreator :: Maybe (Name User)
issueRepoOptionsCreator = Name User -> Maybe (Name User)
forall a. a -> Maybe a
Just Name User
u }

-- | Issue mentioning the given user.
optionsMentioned :: Name User -> IssueRepoMod
optionsMentioned :: Name User -> IssueRepoMod
optionsMentioned Name User
u = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
    IssueRepoOptions
opts { issueRepoOptionsMentioned :: Maybe (Name User)
issueRepoOptionsMentioned = Name User -> Maybe (Name User)
forall a. a -> Maybe a
Just Name User
u }

-- | Don't care about milestones (default).
--
-- 'optionsAnyMilestone' means there should be some milestone, but it can be any.
--
-- See <https://developer.github.com/v3/issues/#list-issues-for-a-repository>
optionsIrrelevantMilestone :: IssueRepoMod
optionsIrrelevantMilestone :: IssueRepoMod
optionsIrrelevantMilestone = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
    IssueRepoOptions
opts { issueRepoOptionsMilestone :: FilterBy (Id Milestone)
issueRepoOptionsMilestone = FilterBy (Id Milestone)
forall a. FilterBy a
FilterNotSpecified }

-- | Issues that have a milestone.
optionsAnyMilestone :: IssueRepoMod
optionsAnyMilestone :: IssueRepoMod
optionsAnyMilestone = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
    IssueRepoOptions
opts { issueRepoOptionsMilestone :: FilterBy (Id Milestone)
issueRepoOptionsMilestone = FilterBy (Id Milestone)
forall a. FilterBy a
FilterAny }

-- | Issues that have no milestone.
optionsNoMilestone :: IssueRepoMod
optionsNoMilestone :: IssueRepoMod
optionsNoMilestone = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
    IssueRepoOptions
opts { issueRepoOptionsMilestone :: FilterBy (Id Milestone)
issueRepoOptionsMilestone = FilterBy (Id Milestone)
forall a. FilterBy a
FilterNone }

-- | Issues with the given milestone.
optionsMilestone :: Id Milestone -> IssueRepoMod
optionsMilestone :: Id Milestone -> IssueRepoMod
optionsMilestone Id Milestone
m = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
    IssueRepoOptions
opts { issueRepoOptionsMilestone :: FilterBy (Id Milestone)
issueRepoOptionsMilestone = Id Milestone -> FilterBy (Id Milestone)
forall a. a -> FilterBy a
FilterBy Id Milestone
m }

-- | Issues with or without assignee (default).
optionsIrrelevantAssignee :: IssueRepoMod
optionsIrrelevantAssignee :: IssueRepoMod
optionsIrrelevantAssignee = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
    IssueRepoOptions
opts { issueRepoOptionsAssignee :: FilterBy (Name User)
issueRepoOptionsAssignee = FilterBy (Name User)
forall a. FilterBy a
FilterNotSpecified }

-- | Issues assigned to someone.
optionsAnyAssignee :: IssueRepoMod
optionsAnyAssignee :: IssueRepoMod
optionsAnyAssignee = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
    IssueRepoOptions
opts { issueRepoOptionsAssignee :: FilterBy (Name User)
issueRepoOptionsAssignee = FilterBy (Name User)
forall a. FilterBy a
FilterAny }

-- | Issues assigned to nobody.
optionsNoAssignee :: IssueRepoMod
optionsNoAssignee :: IssueRepoMod
optionsNoAssignee = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
    IssueRepoOptions
opts { issueRepoOptionsAssignee :: FilterBy (Name User)
issueRepoOptionsAssignee = FilterBy (Name User)
forall a. FilterBy a
FilterNone }

-- | Issues assigned to a specific user.
optionsAssignee :: Name User -> IssueRepoMod
optionsAssignee :: Name User -> IssueRepoMod
optionsAssignee Name User
u = (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
IssueRepoMod ((IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod)
-> (IssueRepoOptions -> IssueRepoOptions) -> IssueRepoMod
forall a b. (a -> b) -> a -> b
$ \IssueRepoOptions
opts ->
    IssueRepoOptions
opts { issueRepoOptionsAssignee :: FilterBy (Name User)
issueRepoOptionsAssignee = Name User -> FilterBy (Name User)
forall a. a -> FilterBy a
FilterBy Name User
u }