module GitHub.Data.Email where

import GitHub.Internal.Prelude
import Prelude ()

import qualified Data.Text as T

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

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

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

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

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

instance FromJSON Email where
    parseJSON :: Value -> Parser Email
parseJSON = String -> (Object -> Parser Email) -> Value -> Parser Email
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"Email" ((Object -> Parser Email) -> Value -> Parser Email)
-> (Object -> Parser Email) -> Value -> Parser Email
forall a b. (a -> b) -> a -> b
$ \Object
o -> Text -> Bool -> Bool -> Maybe EmailVisibility -> Email
Email
        (Text -> Bool -> Bool -> Maybe EmailVisibility -> Email)
-> Parser Text
-> Parser (Bool -> Bool -> Maybe EmailVisibility -> Email)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.:  Key
"email"
        Parser (Bool -> Bool -> Maybe EmailVisibility -> Email)
-> Parser Bool -> Parser (Bool -> Maybe EmailVisibility -> Email)
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 Bool
forall a. FromJSON a => Object -> Key -> Parser a
.:  Key
"verified"
        Parser (Bool -> Maybe EmailVisibility -> Email)
-> Parser Bool -> Parser (Maybe EmailVisibility -> Email)
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 Bool
forall a. FromJSON a => Object -> Key -> Parser a
.:  Key
"primary"
        Parser (Maybe EmailVisibility -> Email)
-> Parser (Maybe EmailVisibility) -> Parser Email
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 EmailVisibility)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"visibility"