{-# 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.Lens as Lens
import Amazonka.PinpointEmail.Types.IdentityType
import qualified Amazonka.Prelude as Prelude
data IdentityInfo = IdentityInfo'
{
IdentityInfo -> Maybe IdentityType
identityType :: Prelude.Maybe IdentityType,
IdentityInfo -> Maybe Text
identityName :: Prelude.Maybe Prelude.Text,
IdentityInfo -> Maybe Bool
sendingEnabled :: Prelude.Maybe Prelude.Bool
}
deriving (IdentityInfo -> IdentityInfo -> Bool
(IdentityInfo -> IdentityInfo -> Bool)
-> (IdentityInfo -> IdentityInfo -> Bool) -> Eq IdentityInfo
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]
(Int -> ReadS IdentityInfo)
-> ReadS [IdentityInfo]
-> ReadPrec IdentityInfo
-> ReadPrec [IdentityInfo]
-> Read 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
(Int -> IdentityInfo -> ShowS)
-> (IdentityInfo -> String)
-> ([IdentityInfo] -> ShowS)
-> Show IdentityInfo
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. IdentityInfo -> Rep IdentityInfo x)
-> (forall x. Rep IdentityInfo x -> IdentityInfo)
-> Generic IdentityInfo
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' :: Maybe IdentityType -> Maybe Text -> Maybe Bool -> IdentityInfo
IdentityInfo'
{ $sel:identityType:IdentityInfo' :: Maybe IdentityType
identityType = Maybe IdentityType
forall a. Maybe a
Prelude.Nothing,
$sel:identityName:IdentityInfo' :: Maybe Text
identityName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sendingEnabled:IdentityInfo' :: Maybe Bool
sendingEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
identityInfo_identityType :: Lens.Lens' IdentityInfo (Prelude.Maybe IdentityType)
identityInfo_identityType :: (Maybe IdentityType -> f (Maybe IdentityType))
-> IdentityInfo -> f IdentityInfo
identityInfo_identityType = (IdentityInfo -> Maybe IdentityType)
-> (IdentityInfo -> Maybe IdentityType -> IdentityInfo)
-> Lens
IdentityInfo IdentityInfo (Maybe IdentityType) (Maybe 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_identityName :: Lens.Lens' IdentityInfo (Prelude.Maybe Prelude.Text)
identityInfo_identityName :: (Maybe Text -> f (Maybe Text)) -> IdentityInfo -> f IdentityInfo
identityInfo_identityName = (IdentityInfo -> Maybe Text)
-> (IdentityInfo -> Maybe Text -> IdentityInfo)
-> Lens IdentityInfo IdentityInfo (Maybe Text) (Maybe Text)
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_sendingEnabled :: Lens.Lens' IdentityInfo (Prelude.Maybe Prelude.Bool)
identityInfo_sendingEnabled :: (Maybe Bool -> f (Maybe Bool)) -> IdentityInfo -> f IdentityInfo
identityInfo_sendingEnabled = (IdentityInfo -> Maybe Bool)
-> (IdentityInfo -> Maybe Bool -> IdentityInfo)
-> Lens IdentityInfo IdentityInfo (Maybe Bool) (Maybe Bool)
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 Core.FromJSON IdentityInfo where
parseJSON :: Value -> Parser IdentityInfo
parseJSON =
String
-> (Object -> Parser IdentityInfo) -> Value -> Parser IdentityInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"IdentityInfo"
( \Object
x ->
Maybe IdentityType -> Maybe Text -> Maybe Bool -> IdentityInfo
IdentityInfo'
(Maybe IdentityType -> Maybe Text -> Maybe Bool -> IdentityInfo)
-> Parser (Maybe IdentityType)
-> Parser (Maybe Text -> Maybe Bool -> IdentityInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe IdentityType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IdentityType")
Parser (Maybe Text -> Maybe Bool -> IdentityInfo)
-> Parser (Maybe Text) -> Parser (Maybe Bool -> IdentityInfo)
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
"IdentityName")
Parser (Maybe Bool -> IdentityInfo)
-> Parser (Maybe Bool) -> Parser IdentityInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SendingEnabled")
)
instance Prelude.Hashable IdentityInfo
instance Prelude.NFData IdentityInfo