{-# 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.PinpointEmail.Types.IdentityInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.PinpointEmail.Types.IdentityType
import qualified Amazonka.Prelude as Prelude
data IdentityInfo = IdentityInfo'
{
IdentityInfo -> Maybe Text
identityName :: Prelude.Maybe Prelude.Text,
IdentityInfo -> Maybe IdentityType
identityType :: Prelude.Maybe IdentityType,
IdentityInfo -> Maybe Bool
sendingEnabled :: Prelude.Maybe Prelude.Bool
}
deriving (IdentityInfo -> IdentityInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IdentityInfo -> IdentityInfo -> Bool
$c/= :: IdentityInfo -> IdentityInfo -> Bool
== :: IdentityInfo -> IdentityInfo -> Bool
$c== :: IdentityInfo -> IdentityInfo -> Bool
Prelude.Eq, ReadPrec [IdentityInfo]
ReadPrec IdentityInfo
Int -> ReadS IdentityInfo
ReadS [IdentityInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IdentityInfo]
$creadListPrec :: ReadPrec [IdentityInfo]
readPrec :: ReadPrec IdentityInfo
$creadPrec :: ReadPrec IdentityInfo
readList :: ReadS [IdentityInfo]
$creadList :: ReadS [IdentityInfo]
readsPrec :: Int -> ReadS IdentityInfo
$creadsPrec :: Int -> ReadS IdentityInfo
Prelude.Read, Int -> IdentityInfo -> ShowS
[IdentityInfo] -> ShowS
IdentityInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IdentityInfo] -> ShowS
$cshowList :: [IdentityInfo] -> ShowS
show :: IdentityInfo -> String
$cshow :: IdentityInfo -> String
showsPrec :: Int -> IdentityInfo -> ShowS
$cshowsPrec :: Int -> IdentityInfo -> ShowS
Prelude.Show, forall x. Rep IdentityInfo x -> IdentityInfo
forall x. IdentityInfo -> Rep IdentityInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IdentityInfo x -> IdentityInfo
$cfrom :: forall x. IdentityInfo -> Rep IdentityInfo x
Prelude.Generic)
newIdentityInfo ::
IdentityInfo
newIdentityInfo :: IdentityInfo
newIdentityInfo =
IdentityInfo'
{ $sel:identityName:IdentityInfo' :: Maybe Text
identityName = forall a. Maybe a
Prelude.Nothing,
$sel:identityType:IdentityInfo' :: Maybe IdentityType
identityType = forall a. Maybe a
Prelude.Nothing,
$sel:sendingEnabled:IdentityInfo' :: Maybe Bool
sendingEnabled = forall a. Maybe a
Prelude.Nothing
}
identityInfo_identityName :: Lens.Lens' IdentityInfo (Prelude.Maybe Prelude.Text)
identityInfo_identityName :: Lens' IdentityInfo (Maybe Text)
identityInfo_identityName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityInfo' {Maybe Text
identityName :: Maybe Text
$sel:identityName:IdentityInfo' :: IdentityInfo -> Maybe Text
identityName} -> Maybe Text
identityName) (\s :: IdentityInfo
s@IdentityInfo' {} Maybe Text
a -> IdentityInfo
s {$sel:identityName:IdentityInfo' :: Maybe Text
identityName = Maybe Text
a} :: IdentityInfo)
identityInfo_identityType :: Lens.Lens' IdentityInfo (Prelude.Maybe IdentityType)
identityInfo_identityType :: Lens' IdentityInfo (Maybe IdentityType)
identityInfo_identityType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityInfo' {Maybe IdentityType
identityType :: Maybe IdentityType
$sel:identityType:IdentityInfo' :: IdentityInfo -> Maybe IdentityType
identityType} -> Maybe IdentityType
identityType) (\s :: IdentityInfo
s@IdentityInfo' {} Maybe IdentityType
a -> IdentityInfo
s {$sel:identityType:IdentityInfo' :: Maybe IdentityType
identityType = Maybe IdentityType
a} :: IdentityInfo)
identityInfo_sendingEnabled :: Lens.Lens' IdentityInfo (Prelude.Maybe Prelude.Bool)
identityInfo_sendingEnabled :: Lens' IdentityInfo (Maybe Bool)
identityInfo_sendingEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityInfo' {Maybe Bool
sendingEnabled :: Maybe Bool
$sel:sendingEnabled:IdentityInfo' :: IdentityInfo -> Maybe Bool
sendingEnabled} -> Maybe Bool
sendingEnabled) (\s :: IdentityInfo
s@IdentityInfo' {} Maybe Bool
a -> IdentityInfo
s {$sel:sendingEnabled:IdentityInfo' :: Maybe Bool
sendingEnabled = Maybe Bool
a} :: IdentityInfo)
instance Data.FromJSON IdentityInfo where
parseJSON :: Value -> Parser IdentityInfo
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"IdentityInfo"
( \Object
x ->
Maybe Text -> Maybe IdentityType -> Maybe Bool -> IdentityInfo
IdentityInfo'
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
"IdentityName")
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
"IdentityType")
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
"SendingEnabled")
)
instance Prelude.Hashable IdentityInfo where
hashWithSalt :: Int -> IdentityInfo -> Int
hashWithSalt Int
_salt IdentityInfo' {Maybe Bool
Maybe Text
Maybe IdentityType
sendingEnabled :: Maybe Bool
identityType :: Maybe IdentityType
identityName :: Maybe Text
$sel:sendingEnabled:IdentityInfo' :: IdentityInfo -> Maybe Bool
$sel:identityType:IdentityInfo' :: IdentityInfo -> Maybe IdentityType
$sel:identityName:IdentityInfo' :: IdentityInfo -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
identityName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IdentityType
identityType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
sendingEnabled
instance Prelude.NFData IdentityInfo where
rnf :: IdentityInfo -> ()
rnf IdentityInfo' {Maybe Bool
Maybe Text
Maybe IdentityType
sendingEnabled :: Maybe Bool
identityType :: Maybe IdentityType
identityName :: Maybe Text
$sel:sendingEnabled:IdentityInfo' :: IdentityInfo -> Maybe Bool
$sel:identityType:IdentityInfo' :: IdentityInfo -> Maybe IdentityType
$sel:identityName:IdentityInfo' :: IdentityInfo -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
identityName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IdentityType
identityType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
sendingEnabled