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