module GitHub.Data.Invitation where

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

import qualified Data.Text as T

data Invitation = Invitation
    { Invitation -> Id Invitation
invitationId        :: !(Id Invitation)
    -- TODO: technically either one should be, maybe both. use `these` ?
    , Invitation -> Maybe (Name User)
invitationLogin     :: !(Maybe (Name User))
    , Invitation -> Maybe Text
invitationEmail     :: !(Maybe Text)
    , Invitation -> InvitationRole
invitationRole      :: !InvitationRole
    , Invitation -> UTCTime
invitationCreatedAt :: !UTCTime
    , Invitation -> SimpleUser
inviter             :: !SimpleUser
    }
  deriving (Int -> Invitation -> ShowS
[Invitation] -> ShowS
Invitation -> String
(Int -> Invitation -> ShowS)
-> (Invitation -> String)
-> ([Invitation] -> ShowS)
-> Show Invitation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Invitation -> ShowS
showsPrec :: Int -> Invitation -> ShowS
$cshow :: Invitation -> String
show :: Invitation -> String
$cshowList :: [Invitation] -> ShowS
showList :: [Invitation] -> ShowS
Show, Typeable Invitation
Typeable Invitation =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Invitation -> c Invitation)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Invitation)
-> (Invitation -> Constr)
-> (Invitation -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Invitation))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c Invitation))
-> ((forall b. Data b => b -> b) -> Invitation -> Invitation)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Invitation -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Invitation -> r)
-> (forall u. (forall d. Data d => d -> u) -> Invitation -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Invitation -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Invitation -> m Invitation)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Invitation -> m Invitation)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Invitation -> m Invitation)
-> Data Invitation
Invitation -> Constr
Invitation -> DataType
(forall b. Data b => b -> b) -> Invitation -> Invitation
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) -> Invitation -> u
forall u. (forall d. Data d => d -> u) -> Invitation -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Invitation -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Invitation -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Invitation -> m Invitation
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Invitation -> m Invitation
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Invitation
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Invitation -> c Invitation
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Invitation)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Invitation)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Invitation -> c Invitation
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Invitation -> c Invitation
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Invitation
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Invitation
$ctoConstr :: Invitation -> Constr
toConstr :: Invitation -> Constr
$cdataTypeOf :: Invitation -> DataType
dataTypeOf :: Invitation -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Invitation)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Invitation)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Invitation)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Invitation)
$cgmapT :: (forall b. Data b => b -> b) -> Invitation -> Invitation
gmapT :: (forall b. Data b => b -> b) -> Invitation -> Invitation
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Invitation -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Invitation -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Invitation -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Invitation -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Invitation -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Invitation -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Invitation -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Invitation -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Invitation -> m Invitation
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Invitation -> m Invitation
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Invitation -> m Invitation
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Invitation -> m Invitation
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Invitation -> m Invitation
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Invitation -> m Invitation
Data, Typeable, Invitation -> Invitation -> Bool
(Invitation -> Invitation -> Bool)
-> (Invitation -> Invitation -> Bool) -> Eq Invitation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Invitation -> Invitation -> Bool
== :: Invitation -> Invitation -> Bool
$c/= :: Invitation -> Invitation -> Bool
/= :: Invitation -> Invitation -> Bool
Eq, Eq Invitation
Eq Invitation =>
(Invitation -> Invitation -> Ordering)
-> (Invitation -> Invitation -> Bool)
-> (Invitation -> Invitation -> Bool)
-> (Invitation -> Invitation -> Bool)
-> (Invitation -> Invitation -> Bool)
-> (Invitation -> Invitation -> Invitation)
-> (Invitation -> Invitation -> Invitation)
-> Ord Invitation
Invitation -> Invitation -> Bool
Invitation -> Invitation -> Ordering
Invitation -> Invitation -> Invitation
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Invitation -> Invitation -> Ordering
compare :: Invitation -> Invitation -> Ordering
$c< :: Invitation -> Invitation -> Bool
< :: Invitation -> Invitation -> Bool
$c<= :: Invitation -> Invitation -> Bool
<= :: Invitation -> Invitation -> Bool
$c> :: Invitation -> Invitation -> Bool
> :: Invitation -> Invitation -> Bool
$c>= :: Invitation -> Invitation -> Bool
>= :: Invitation -> Invitation -> Bool
$cmax :: Invitation -> Invitation -> Invitation
max :: Invitation -> Invitation -> Invitation
$cmin :: Invitation -> Invitation -> Invitation
min :: Invitation -> Invitation -> Invitation
Ord, (forall x. Invitation -> Rep Invitation x)
-> (forall x. Rep Invitation x -> Invitation) -> Generic Invitation
forall x. Rep Invitation x -> Invitation
forall x. Invitation -> Rep Invitation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Invitation -> Rep Invitation x
from :: forall x. Invitation -> Rep Invitation x
$cto :: forall x. Rep Invitation x -> Invitation
to :: forall x. Rep Invitation x -> Invitation
Generic)

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

instance FromJSON Invitation where
    parseJSON :: Value -> Parser Invitation
parseJSON = String
-> (Object -> Parser Invitation) -> Value -> Parser Invitation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"Invitation" ((Object -> Parser Invitation) -> Value -> Parser Invitation)
-> (Object -> Parser Invitation) -> Value -> Parser Invitation
forall a b. (a -> b) -> a -> b
$ \Object
o -> Id Invitation
-> Maybe (Name User)
-> Maybe Text
-> InvitationRole
-> UTCTime
-> SimpleUser
-> Invitation
Invitation
        (Id Invitation
 -> Maybe (Name User)
 -> Maybe Text
 -> InvitationRole
 -> UTCTime
 -> SimpleUser
 -> Invitation)
-> Parser (Id Invitation)
-> Parser
     (Maybe (Name User)
      -> Maybe Text
      -> InvitationRole
      -> UTCTime
      -> SimpleUser
      -> Invitation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser (Id Invitation)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"id"
        Parser
  (Maybe (Name User)
   -> Maybe Text
   -> InvitationRole
   -> UTCTime
   -> SimpleUser
   -> Invitation)
-> Parser (Maybe (Name User))
-> Parser
     (Maybe Text
      -> InvitationRole -> UTCTime -> SimpleUser -> Invitation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser (Maybe (Name User))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"login"
        Parser
  (Maybe Text
   -> InvitationRole -> UTCTime -> SimpleUser -> Invitation)
-> Parser (Maybe Text)
-> Parser (InvitationRole -> UTCTime -> SimpleUser -> Invitation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"email"
        Parser (InvitationRole -> UTCTime -> SimpleUser -> Invitation)
-> Parser InvitationRole
-> Parser (UTCTime -> SimpleUser -> Invitation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser InvitationRole
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"role"
        Parser (UTCTime -> SimpleUser -> Invitation)
-> Parser UTCTime -> Parser (SimpleUser -> Invitation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser UTCTime
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"created_at"
        Parser (SimpleUser -> Invitation)
-> Parser SimpleUser -> Parser Invitation
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser SimpleUser
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"inviter"


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

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

instance FromJSON InvitationRole where
    parseJSON :: Value -> Parser InvitationRole
parseJSON = String
-> (Text -> Parser InvitationRole)
-> Value
-> Parser InvitationRole
forall a. String -> (Text -> Parser a) -> Value -> Parser a
withText String
"InvitationRole" ((Text -> Parser InvitationRole) -> Value -> Parser InvitationRole)
-> (Text -> Parser InvitationRole)
-> Value
-> Parser InvitationRole
forall a b. (a -> b) -> a -> b
$ \Text
t -> case Text -> Text
T.toLower Text
t of
        Text
"direct_member"   -> InvitationRole -> Parser InvitationRole
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InvitationRole
InvitationRoleDirectMember
        Text
"admin"           -> InvitationRole -> Parser InvitationRole
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InvitationRole
InvitationRoleAdmin
        Text
"billing_manager" -> InvitationRole -> Parser InvitationRole
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InvitationRole
InvitationRoleBillingManager
        Text
"hiring_manager"  -> InvitationRole -> Parser InvitationRole
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InvitationRole
InvitationRoleHiringManager
        Text
"reinstate"       -> InvitationRole -> Parser InvitationRole
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InvitationRole
InvitationRoleReinstate
        Text
_                 -> String -> Parser InvitationRole
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail (String -> Parser InvitationRole)
-> String -> Parser InvitationRole
forall a b. (a -> b) -> a -> b
$ String
"Unknown InvitationRole: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Text -> String
T.unpack Text
t

data RepoInvitation = RepoInvitation
    { RepoInvitation -> Id RepoInvitation
repoInvitationId         :: !(Id RepoInvitation)
    , RepoInvitation -> SimpleUser
repoInvitationInvitee    :: !SimpleUser
    , RepoInvitation -> SimpleUser
repoInvitationInviter    :: !SimpleUser
    , RepoInvitation -> Repo
repoInvitationRepo       :: !Repo
    , RepoInvitation -> URL
repoInvitationUrl        :: !URL
    , RepoInvitation -> UTCTime
repoInvitationCreatedAt  :: !UTCTime
    , RepoInvitation -> Text
repoInvitationPermission :: !Text
    , RepoInvitation -> URL
repoInvitationHtmlUrl    :: !URL
    }
  deriving (Int -> RepoInvitation -> ShowS
[RepoInvitation] -> ShowS
RepoInvitation -> String
(Int -> RepoInvitation -> ShowS)
-> (RepoInvitation -> String)
-> ([RepoInvitation] -> ShowS)
-> Show RepoInvitation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RepoInvitation -> ShowS
showsPrec :: Int -> RepoInvitation -> ShowS
$cshow :: RepoInvitation -> String
show :: RepoInvitation -> String
$cshowList :: [RepoInvitation] -> ShowS
showList :: [RepoInvitation] -> ShowS
Show, Typeable RepoInvitation
Typeable RepoInvitation =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> RepoInvitation -> c RepoInvitation)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RepoInvitation)
-> (RepoInvitation -> Constr)
-> (RepoInvitation -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RepoInvitation))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c RepoInvitation))
-> ((forall b. Data b => b -> b)
    -> RepoInvitation -> RepoInvitation)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> RepoInvitation -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> RepoInvitation -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> RepoInvitation -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> RepoInvitation -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> RepoInvitation -> m RepoInvitation)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> RepoInvitation -> m RepoInvitation)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> RepoInvitation -> m RepoInvitation)
-> Data RepoInvitation
RepoInvitation -> Constr
RepoInvitation -> DataType
(forall b. Data b => b -> b) -> RepoInvitation -> RepoInvitation
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) -> RepoInvitation -> u
forall u. (forall d. Data d => d -> u) -> RepoInvitation -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RepoInvitation -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RepoInvitation -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> RepoInvitation -> m RepoInvitation
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> RepoInvitation -> m RepoInvitation
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RepoInvitation
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RepoInvitation -> c RepoInvitation
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RepoInvitation)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RepoInvitation)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RepoInvitation -> c RepoInvitation
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RepoInvitation -> c RepoInvitation
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RepoInvitation
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RepoInvitation
$ctoConstr :: RepoInvitation -> Constr
toConstr :: RepoInvitation -> Constr
$cdataTypeOf :: RepoInvitation -> DataType
dataTypeOf :: RepoInvitation -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RepoInvitation)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RepoInvitation)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RepoInvitation)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RepoInvitation)
$cgmapT :: (forall b. Data b => b -> b) -> RepoInvitation -> RepoInvitation
gmapT :: (forall b. Data b => b -> b) -> RepoInvitation -> RepoInvitation
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RepoInvitation -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RepoInvitation -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RepoInvitation -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RepoInvitation -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> RepoInvitation -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> RepoInvitation -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> RepoInvitation -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> RepoInvitation -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> RepoInvitation -> m RepoInvitation
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> RepoInvitation -> m RepoInvitation
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> RepoInvitation -> m RepoInvitation
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> RepoInvitation -> m RepoInvitation
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> RepoInvitation -> m RepoInvitation
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> RepoInvitation -> m RepoInvitation
Data, Typeable, RepoInvitation -> RepoInvitation -> Bool
(RepoInvitation -> RepoInvitation -> Bool)
-> (RepoInvitation -> RepoInvitation -> Bool) -> Eq RepoInvitation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RepoInvitation -> RepoInvitation -> Bool
== :: RepoInvitation -> RepoInvitation -> Bool
$c/= :: RepoInvitation -> RepoInvitation -> Bool
/= :: RepoInvitation -> RepoInvitation -> Bool
Eq, Eq RepoInvitation
Eq RepoInvitation =>
(RepoInvitation -> RepoInvitation -> Ordering)
-> (RepoInvitation -> RepoInvitation -> Bool)
-> (RepoInvitation -> RepoInvitation -> Bool)
-> (RepoInvitation -> RepoInvitation -> Bool)
-> (RepoInvitation -> RepoInvitation -> Bool)
-> (RepoInvitation -> RepoInvitation -> RepoInvitation)
-> (RepoInvitation -> RepoInvitation -> RepoInvitation)
-> Ord RepoInvitation
RepoInvitation -> RepoInvitation -> Bool
RepoInvitation -> RepoInvitation -> Ordering
RepoInvitation -> RepoInvitation -> RepoInvitation
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: RepoInvitation -> RepoInvitation -> Ordering
compare :: RepoInvitation -> RepoInvitation -> Ordering
$c< :: RepoInvitation -> RepoInvitation -> Bool
< :: RepoInvitation -> RepoInvitation -> Bool
$c<= :: RepoInvitation -> RepoInvitation -> Bool
<= :: RepoInvitation -> RepoInvitation -> Bool
$c> :: RepoInvitation -> RepoInvitation -> Bool
> :: RepoInvitation -> RepoInvitation -> Bool
$c>= :: RepoInvitation -> RepoInvitation -> Bool
>= :: RepoInvitation -> RepoInvitation -> Bool
$cmax :: RepoInvitation -> RepoInvitation -> RepoInvitation
max :: RepoInvitation -> RepoInvitation -> RepoInvitation
$cmin :: RepoInvitation -> RepoInvitation -> RepoInvitation
min :: RepoInvitation -> RepoInvitation -> RepoInvitation
Ord, (forall x. RepoInvitation -> Rep RepoInvitation x)
-> (forall x. Rep RepoInvitation x -> RepoInvitation)
-> Generic RepoInvitation
forall x. Rep RepoInvitation x -> RepoInvitation
forall x. RepoInvitation -> Rep RepoInvitation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RepoInvitation -> Rep RepoInvitation x
from :: forall x. RepoInvitation -> Rep RepoInvitation x
$cto :: forall x. Rep RepoInvitation x -> RepoInvitation
to :: forall x. Rep RepoInvitation x -> RepoInvitation
Generic)

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

instance FromJSON RepoInvitation where
    parseJSON :: Value -> Parser RepoInvitation
parseJSON = String
-> (Object -> Parser RepoInvitation)
-> Value
-> Parser RepoInvitation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"RepoInvitation" ((Object -> Parser RepoInvitation)
 -> Value -> Parser RepoInvitation)
-> (Object -> Parser RepoInvitation)
-> Value
-> Parser RepoInvitation
forall a b. (a -> b) -> a -> b
$ \Object
o -> Id RepoInvitation
-> SimpleUser
-> SimpleUser
-> Repo
-> URL
-> UTCTime
-> Text
-> URL
-> RepoInvitation
RepoInvitation
        (Id RepoInvitation
 -> SimpleUser
 -> SimpleUser
 -> Repo
 -> URL
 -> UTCTime
 -> Text
 -> URL
 -> RepoInvitation)
-> Parser (Id RepoInvitation)
-> Parser
     (SimpleUser
      -> SimpleUser
      -> Repo
      -> URL
      -> UTCTime
      -> Text
      -> URL
      -> RepoInvitation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser (Id RepoInvitation)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"id"
        Parser
  (SimpleUser
   -> SimpleUser
   -> Repo
   -> URL
   -> UTCTime
   -> Text
   -> URL
   -> RepoInvitation)
-> Parser SimpleUser
-> Parser
     (SimpleUser
      -> Repo -> URL -> UTCTime -> Text -> URL -> RepoInvitation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser SimpleUser
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"invitee"
        Parser
  (SimpleUser
   -> Repo -> URL -> UTCTime -> Text -> URL -> RepoInvitation)
-> Parser SimpleUser
-> Parser (Repo -> URL -> UTCTime -> Text -> URL -> RepoInvitation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser SimpleUser
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"inviter"
        Parser (Repo -> URL -> UTCTime -> Text -> URL -> RepoInvitation)
-> Parser Repo
-> Parser (URL -> UTCTime -> Text -> URL -> RepoInvitation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser Repo
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"repository"
        Parser (URL -> UTCTime -> Text -> URL -> RepoInvitation)
-> Parser URL -> Parser (UTCTime -> Text -> URL -> RepoInvitation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser URL
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"url"
        Parser (UTCTime -> Text -> URL -> RepoInvitation)
-> Parser UTCTime -> Parser (Text -> URL -> RepoInvitation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser UTCTime
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"created_at"
        Parser (Text -> URL -> RepoInvitation)
-> Parser Text -> Parser (URL -> RepoInvitation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"permissions"
        Parser (URL -> RepoInvitation)
-> Parser URL -> Parser RepoInvitation
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser URL
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"html_url"