{-# 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.Connect.Types.UserIdentityInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data UserIdentityInfo = UserIdentityInfo'
{
UserIdentityInfo -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
UserIdentityInfo -> Maybe Text
firstName :: Prelude.Maybe Prelude.Text,
UserIdentityInfo -> Maybe Text
lastName :: Prelude.Maybe Prelude.Text,
UserIdentityInfo -> Maybe Text
mobile :: Prelude.Maybe Prelude.Text,
UserIdentityInfo -> Maybe Text
secondaryEmail :: Prelude.Maybe Prelude.Text
}
deriving (UserIdentityInfo -> UserIdentityInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserIdentityInfo -> UserIdentityInfo -> Bool
$c/= :: UserIdentityInfo -> UserIdentityInfo -> Bool
== :: UserIdentityInfo -> UserIdentityInfo -> Bool
$c== :: UserIdentityInfo -> UserIdentityInfo -> Bool
Prelude.Eq, ReadPrec [UserIdentityInfo]
ReadPrec UserIdentityInfo
Int -> ReadS UserIdentityInfo
ReadS [UserIdentityInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserIdentityInfo]
$creadListPrec :: ReadPrec [UserIdentityInfo]
readPrec :: ReadPrec UserIdentityInfo
$creadPrec :: ReadPrec UserIdentityInfo
readList :: ReadS [UserIdentityInfo]
$creadList :: ReadS [UserIdentityInfo]
readsPrec :: Int -> ReadS UserIdentityInfo
$creadsPrec :: Int -> ReadS UserIdentityInfo
Prelude.Read, Int -> UserIdentityInfo -> ShowS
[UserIdentityInfo] -> ShowS
UserIdentityInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserIdentityInfo] -> ShowS
$cshowList :: [UserIdentityInfo] -> ShowS
show :: UserIdentityInfo -> String
$cshow :: UserIdentityInfo -> String
showsPrec :: Int -> UserIdentityInfo -> ShowS
$cshowsPrec :: Int -> UserIdentityInfo -> ShowS
Prelude.Show, forall x. Rep UserIdentityInfo x -> UserIdentityInfo
forall x. UserIdentityInfo -> Rep UserIdentityInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserIdentityInfo x -> UserIdentityInfo
$cfrom :: forall x. UserIdentityInfo -> Rep UserIdentityInfo x
Prelude.Generic)
newUserIdentityInfo ::
UserIdentityInfo
newUserIdentityInfo :: UserIdentityInfo
newUserIdentityInfo =
UserIdentityInfo'
{ $sel:email:UserIdentityInfo' :: Maybe Text
email = forall a. Maybe a
Prelude.Nothing,
$sel:firstName:UserIdentityInfo' :: Maybe Text
firstName = forall a. Maybe a
Prelude.Nothing,
$sel:lastName:UserIdentityInfo' :: Maybe Text
lastName = forall a. Maybe a
Prelude.Nothing,
$sel:mobile:UserIdentityInfo' :: Maybe Text
mobile = forall a. Maybe a
Prelude.Nothing,
$sel:secondaryEmail:UserIdentityInfo' :: Maybe Text
secondaryEmail = forall a. Maybe a
Prelude.Nothing
}
userIdentityInfo_email :: Lens.Lens' UserIdentityInfo (Prelude.Maybe Prelude.Text)
userIdentityInfo_email :: Lens' UserIdentityInfo (Maybe Text)
userIdentityInfo_email = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentityInfo' {Maybe Text
email :: Maybe Text
$sel:email:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
email} -> Maybe Text
email) (\s :: UserIdentityInfo
s@UserIdentityInfo' {} Maybe Text
a -> UserIdentityInfo
s {$sel:email:UserIdentityInfo' :: Maybe Text
email = Maybe Text
a} :: UserIdentityInfo)
userIdentityInfo_firstName :: Lens.Lens' UserIdentityInfo (Prelude.Maybe Prelude.Text)
userIdentityInfo_firstName :: Lens' UserIdentityInfo (Maybe Text)
userIdentityInfo_firstName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentityInfo' {Maybe Text
firstName :: Maybe Text
$sel:firstName:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
firstName} -> Maybe Text
firstName) (\s :: UserIdentityInfo
s@UserIdentityInfo' {} Maybe Text
a -> UserIdentityInfo
s {$sel:firstName:UserIdentityInfo' :: Maybe Text
firstName = Maybe Text
a} :: UserIdentityInfo)
userIdentityInfo_lastName :: Lens.Lens' UserIdentityInfo (Prelude.Maybe Prelude.Text)
userIdentityInfo_lastName :: Lens' UserIdentityInfo (Maybe Text)
userIdentityInfo_lastName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentityInfo' {Maybe Text
lastName :: Maybe Text
$sel:lastName:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
lastName} -> Maybe Text
lastName) (\s :: UserIdentityInfo
s@UserIdentityInfo' {} Maybe Text
a -> UserIdentityInfo
s {$sel:lastName:UserIdentityInfo' :: Maybe Text
lastName = Maybe Text
a} :: UserIdentityInfo)
userIdentityInfo_mobile :: Lens.Lens' UserIdentityInfo (Prelude.Maybe Prelude.Text)
userIdentityInfo_mobile :: Lens' UserIdentityInfo (Maybe Text)
userIdentityInfo_mobile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentityInfo' {Maybe Text
mobile :: Maybe Text
$sel:mobile:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
mobile} -> Maybe Text
mobile) (\s :: UserIdentityInfo
s@UserIdentityInfo' {} Maybe Text
a -> UserIdentityInfo
s {$sel:mobile:UserIdentityInfo' :: Maybe Text
mobile = Maybe Text
a} :: UserIdentityInfo)
userIdentityInfo_secondaryEmail :: Lens.Lens' UserIdentityInfo (Prelude.Maybe Prelude.Text)
userIdentityInfo_secondaryEmail :: Lens' UserIdentityInfo (Maybe Text)
userIdentityInfo_secondaryEmail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentityInfo' {Maybe Text
secondaryEmail :: Maybe Text
$sel:secondaryEmail:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
secondaryEmail} -> Maybe Text
secondaryEmail) (\s :: UserIdentityInfo
s@UserIdentityInfo' {} Maybe Text
a -> UserIdentityInfo
s {$sel:secondaryEmail:UserIdentityInfo' :: Maybe Text
secondaryEmail = Maybe Text
a} :: UserIdentityInfo)
instance Data.FromJSON UserIdentityInfo where
parseJSON :: Value -> Parser UserIdentityInfo
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"UserIdentityInfo"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> UserIdentityInfo
UserIdentityInfo'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Email")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FirstName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Mobile")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SecondaryEmail")
)
instance Prelude.Hashable UserIdentityInfo where
hashWithSalt :: Int -> UserIdentityInfo -> Int
hashWithSalt Int
_salt UserIdentityInfo' {Maybe Text
secondaryEmail :: Maybe Text
mobile :: Maybe Text
lastName :: Maybe Text
firstName :: Maybe Text
email :: Maybe Text
$sel:secondaryEmail:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
$sel:mobile:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
$sel:lastName:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
$sel:firstName:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
$sel:email:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
email
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
firstName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
mobile
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
secondaryEmail
instance Prelude.NFData UserIdentityInfo where
rnf :: UserIdentityInfo -> ()
rnf UserIdentityInfo' {Maybe Text
secondaryEmail :: Maybe Text
mobile :: Maybe Text
lastName :: Maybe Text
firstName :: Maybe Text
email :: Maybe Text
$sel:secondaryEmail:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
$sel:mobile:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
$sel:lastName:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
$sel:firstName:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
$sel:email:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
email
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
firstName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
mobile
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
secondaryEmail
instance Data.ToJSON UserIdentityInfo where
toJSON :: UserIdentityInfo -> Value
toJSON UserIdentityInfo' {Maybe Text
secondaryEmail :: Maybe Text
mobile :: Maybe Text
lastName :: Maybe Text
firstName :: Maybe Text
email :: Maybe Text
$sel:secondaryEmail:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
$sel:mobile:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
$sel:lastName:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
$sel:firstName:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
$sel:email:UserIdentityInfo' :: UserIdentityInfo -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Email" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
email,
(Key
"FirstName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
firstName,
(Key
"LastName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
lastName,
(Key
"Mobile" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
mobile,
(Key
"SecondaryEmail" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
secondaryEmail
]
)