{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CodeCommit.Types.UserInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UserInfo = UserInfo'
{
UserInfo -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
UserInfo -> Maybe Text
date :: Prelude.Maybe Prelude.Text,
UserInfo -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (UserInfo -> UserInfo -> Bool
(UserInfo -> UserInfo -> Bool)
-> (UserInfo -> UserInfo -> Bool) -> Eq UserInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserInfo -> UserInfo -> Bool
$c/= :: UserInfo -> UserInfo -> Bool
== :: UserInfo -> UserInfo -> Bool
$c== :: UserInfo -> UserInfo -> Bool
Prelude.Eq, ReadPrec [UserInfo]
ReadPrec UserInfo
Int -> ReadS UserInfo
ReadS [UserInfo]
(Int -> ReadS UserInfo)
-> ReadS [UserInfo]
-> ReadPrec UserInfo
-> ReadPrec [UserInfo]
-> Read UserInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserInfo]
$creadListPrec :: ReadPrec [UserInfo]
readPrec :: ReadPrec UserInfo
$creadPrec :: ReadPrec UserInfo
readList :: ReadS [UserInfo]
$creadList :: ReadS [UserInfo]
readsPrec :: Int -> ReadS UserInfo
$creadsPrec :: Int -> ReadS UserInfo
Prelude.Read, Int -> UserInfo -> ShowS
[UserInfo] -> ShowS
UserInfo -> String
(Int -> UserInfo -> ShowS)
-> (UserInfo -> String) -> ([UserInfo] -> ShowS) -> Show UserInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserInfo] -> ShowS
$cshowList :: [UserInfo] -> ShowS
show :: UserInfo -> String
$cshow :: UserInfo -> String
showsPrec :: Int -> UserInfo -> ShowS
$cshowsPrec :: Int -> UserInfo -> ShowS
Prelude.Show, (forall x. UserInfo -> Rep UserInfo x)
-> (forall x. Rep UserInfo x -> UserInfo) -> Generic UserInfo
forall x. Rep UserInfo x -> UserInfo
forall x. UserInfo -> Rep UserInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserInfo x -> UserInfo
$cfrom :: forall x. UserInfo -> Rep UserInfo x
Prelude.Generic)
newUserInfo ::
UserInfo
newUserInfo :: UserInfo
newUserInfo =
UserInfo' :: Maybe Text -> Maybe Text -> Maybe Text -> UserInfo
UserInfo'
{ $sel:email:UserInfo' :: Maybe Text
email = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:date:UserInfo' :: Maybe Text
date = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:UserInfo' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
userInfo_email :: Lens.Lens' UserInfo (Prelude.Maybe Prelude.Text)
userInfo_email :: (Maybe Text -> f (Maybe Text)) -> UserInfo -> f UserInfo
userInfo_email = (UserInfo -> Maybe Text)
-> (UserInfo -> Maybe Text -> UserInfo)
-> Lens UserInfo UserInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserInfo' {Maybe Text
email :: Maybe Text
$sel:email:UserInfo' :: UserInfo -> Maybe Text
email} -> Maybe Text
email) (\s :: UserInfo
s@UserInfo' {} Maybe Text
a -> UserInfo
s {$sel:email:UserInfo' :: Maybe Text
email = Maybe Text
a} :: UserInfo)
userInfo_date :: Lens.Lens' UserInfo (Prelude.Maybe Prelude.Text)
userInfo_date :: (Maybe Text -> f (Maybe Text)) -> UserInfo -> f UserInfo
userInfo_date = (UserInfo -> Maybe Text)
-> (UserInfo -> Maybe Text -> UserInfo)
-> Lens UserInfo UserInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserInfo' {Maybe Text
date :: Maybe Text
$sel:date:UserInfo' :: UserInfo -> Maybe Text
date} -> Maybe Text
date) (\s :: UserInfo
s@UserInfo' {} Maybe Text
a -> UserInfo
s {$sel:date:UserInfo' :: Maybe Text
date = Maybe Text
a} :: UserInfo)
userInfo_name :: Lens.Lens' UserInfo (Prelude.Maybe Prelude.Text)
userInfo_name :: (Maybe Text -> f (Maybe Text)) -> UserInfo -> f UserInfo
userInfo_name = (UserInfo -> Maybe Text)
-> (UserInfo -> Maybe Text -> UserInfo)
-> Lens UserInfo UserInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserInfo' {Maybe Text
name :: Maybe Text
$sel:name:UserInfo' :: UserInfo -> Maybe Text
name} -> Maybe Text
name) (\s :: UserInfo
s@UserInfo' {} Maybe Text
a -> UserInfo
s {$sel:name:UserInfo' :: Maybe Text
name = Maybe Text
a} :: UserInfo)
instance Core.FromJSON UserInfo where
parseJSON :: Value -> Parser UserInfo
parseJSON =
String -> (Object -> Parser UserInfo) -> Value -> Parser UserInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UserInfo"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> UserInfo
UserInfo'
(Maybe Text -> Maybe Text -> Maybe Text -> UserInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> UserInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"email")
Parser (Maybe Text -> Maybe Text -> UserInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> UserInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"date")
Parser (Maybe Text -> UserInfo)
-> Parser (Maybe Text) -> Parser UserInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
)
instance Prelude.Hashable UserInfo
instance Prelude.NFData UserInfo