{-# 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.SES.Types.IdentityDkimAttributes where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SES.Types.VerificationStatus
data IdentityDkimAttributes = IdentityDkimAttributes'
{
IdentityDkimAttributes -> Maybe [Text]
dkimTokens :: Prelude.Maybe [Prelude.Text],
IdentityDkimAttributes -> Bool
dkimEnabled :: Prelude.Bool,
IdentityDkimAttributes -> VerificationStatus
dkimVerificationStatus :: VerificationStatus
}
deriving (IdentityDkimAttributes -> IdentityDkimAttributes -> Bool
(IdentityDkimAttributes -> IdentityDkimAttributes -> Bool)
-> (IdentityDkimAttributes -> IdentityDkimAttributes -> Bool)
-> Eq IdentityDkimAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IdentityDkimAttributes -> IdentityDkimAttributes -> Bool
$c/= :: IdentityDkimAttributes -> IdentityDkimAttributes -> Bool
== :: IdentityDkimAttributes -> IdentityDkimAttributes -> Bool
$c== :: IdentityDkimAttributes -> IdentityDkimAttributes -> Bool
Prelude.Eq, ReadPrec [IdentityDkimAttributes]
ReadPrec IdentityDkimAttributes
Int -> ReadS IdentityDkimAttributes
ReadS [IdentityDkimAttributes]
(Int -> ReadS IdentityDkimAttributes)
-> ReadS [IdentityDkimAttributes]
-> ReadPrec IdentityDkimAttributes
-> ReadPrec [IdentityDkimAttributes]
-> Read IdentityDkimAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IdentityDkimAttributes]
$creadListPrec :: ReadPrec [IdentityDkimAttributes]
readPrec :: ReadPrec IdentityDkimAttributes
$creadPrec :: ReadPrec IdentityDkimAttributes
readList :: ReadS [IdentityDkimAttributes]
$creadList :: ReadS [IdentityDkimAttributes]
readsPrec :: Int -> ReadS IdentityDkimAttributes
$creadsPrec :: Int -> ReadS IdentityDkimAttributes
Prelude.Read, Int -> IdentityDkimAttributes -> ShowS
[IdentityDkimAttributes] -> ShowS
IdentityDkimAttributes -> String
(Int -> IdentityDkimAttributes -> ShowS)
-> (IdentityDkimAttributes -> String)
-> ([IdentityDkimAttributes] -> ShowS)
-> Show IdentityDkimAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IdentityDkimAttributes] -> ShowS
$cshowList :: [IdentityDkimAttributes] -> ShowS
show :: IdentityDkimAttributes -> String
$cshow :: IdentityDkimAttributes -> String
showsPrec :: Int -> IdentityDkimAttributes -> ShowS
$cshowsPrec :: Int -> IdentityDkimAttributes -> ShowS
Prelude.Show, (forall x. IdentityDkimAttributes -> Rep IdentityDkimAttributes x)
-> (forall x.
Rep IdentityDkimAttributes x -> IdentityDkimAttributes)
-> Generic IdentityDkimAttributes
forall x. Rep IdentityDkimAttributes x -> IdentityDkimAttributes
forall x. IdentityDkimAttributes -> Rep IdentityDkimAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IdentityDkimAttributes x -> IdentityDkimAttributes
$cfrom :: forall x. IdentityDkimAttributes -> Rep IdentityDkimAttributes x
Prelude.Generic)
newIdentityDkimAttributes ::
Prelude.Bool ->
VerificationStatus ->
IdentityDkimAttributes
newIdentityDkimAttributes :: Bool -> VerificationStatus -> IdentityDkimAttributes
newIdentityDkimAttributes
Bool
pDkimEnabled_
VerificationStatus
pDkimVerificationStatus_ =
IdentityDkimAttributes' :: Maybe [Text]
-> Bool -> VerificationStatus -> IdentityDkimAttributes
IdentityDkimAttributes'
{ $sel:dkimTokens:IdentityDkimAttributes' :: Maybe [Text]
dkimTokens =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:dkimEnabled:IdentityDkimAttributes' :: Bool
dkimEnabled = Bool
pDkimEnabled_,
$sel:dkimVerificationStatus:IdentityDkimAttributes' :: VerificationStatus
dkimVerificationStatus = VerificationStatus
pDkimVerificationStatus_
}
identityDkimAttributes_dkimTokens :: Lens.Lens' IdentityDkimAttributes (Prelude.Maybe [Prelude.Text])
identityDkimAttributes_dkimTokens :: (Maybe [Text] -> f (Maybe [Text]))
-> IdentityDkimAttributes -> f IdentityDkimAttributes
identityDkimAttributes_dkimTokens = (IdentityDkimAttributes -> Maybe [Text])
-> (IdentityDkimAttributes
-> Maybe [Text] -> IdentityDkimAttributes)
-> Lens
IdentityDkimAttributes
IdentityDkimAttributes
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityDkimAttributes' {Maybe [Text]
dkimTokens :: Maybe [Text]
$sel:dkimTokens:IdentityDkimAttributes' :: IdentityDkimAttributes -> Maybe [Text]
dkimTokens} -> Maybe [Text]
dkimTokens) (\s :: IdentityDkimAttributes
s@IdentityDkimAttributes' {} Maybe [Text]
a -> IdentityDkimAttributes
s {$sel:dkimTokens:IdentityDkimAttributes' :: Maybe [Text]
dkimTokens = Maybe [Text]
a} :: IdentityDkimAttributes) ((Maybe [Text] -> f (Maybe [Text]))
-> IdentityDkimAttributes -> f IdentityDkimAttributes)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> IdentityDkimAttributes
-> f IdentityDkimAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
identityDkimAttributes_dkimEnabled :: Lens.Lens' IdentityDkimAttributes Prelude.Bool
identityDkimAttributes_dkimEnabled :: (Bool -> f Bool)
-> IdentityDkimAttributes -> f IdentityDkimAttributes
identityDkimAttributes_dkimEnabled = (IdentityDkimAttributes -> Bool)
-> (IdentityDkimAttributes -> Bool -> IdentityDkimAttributes)
-> Lens IdentityDkimAttributes IdentityDkimAttributes Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityDkimAttributes' {Bool
dkimEnabled :: Bool
$sel:dkimEnabled:IdentityDkimAttributes' :: IdentityDkimAttributes -> Bool
dkimEnabled} -> Bool
dkimEnabled) (\s :: IdentityDkimAttributes
s@IdentityDkimAttributes' {} Bool
a -> IdentityDkimAttributes
s {$sel:dkimEnabled:IdentityDkimAttributes' :: Bool
dkimEnabled = Bool
a} :: IdentityDkimAttributes)
identityDkimAttributes_dkimVerificationStatus :: Lens.Lens' IdentityDkimAttributes VerificationStatus
identityDkimAttributes_dkimVerificationStatus :: (VerificationStatus -> f VerificationStatus)
-> IdentityDkimAttributes -> f IdentityDkimAttributes
identityDkimAttributes_dkimVerificationStatus = (IdentityDkimAttributes -> VerificationStatus)
-> (IdentityDkimAttributes
-> VerificationStatus -> IdentityDkimAttributes)
-> Lens
IdentityDkimAttributes
IdentityDkimAttributes
VerificationStatus
VerificationStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityDkimAttributes' {VerificationStatus
dkimVerificationStatus :: VerificationStatus
$sel:dkimVerificationStatus:IdentityDkimAttributes' :: IdentityDkimAttributes -> VerificationStatus
dkimVerificationStatus} -> VerificationStatus
dkimVerificationStatus) (\s :: IdentityDkimAttributes
s@IdentityDkimAttributes' {} VerificationStatus
a -> IdentityDkimAttributes
s {$sel:dkimVerificationStatus:IdentityDkimAttributes' :: VerificationStatus
dkimVerificationStatus = VerificationStatus
a} :: IdentityDkimAttributes)
instance Core.FromXML IdentityDkimAttributes where
parseXML :: [Node] -> Either String IdentityDkimAttributes
parseXML [Node]
x =
Maybe [Text]
-> Bool -> VerificationStatus -> IdentityDkimAttributes
IdentityDkimAttributes'
(Maybe [Text]
-> Bool -> VerificationStatus -> IdentityDkimAttributes)
-> Either String (Maybe [Text])
-> Either
String (Bool -> VerificationStatus -> IdentityDkimAttributes)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DkimTokens" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either
String (Bool -> VerificationStatus -> IdentityDkimAttributes)
-> Either String Bool
-> Either String (VerificationStatus -> IdentityDkimAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Bool
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"DkimEnabled")
Either String (VerificationStatus -> IdentityDkimAttributes)
-> Either String VerificationStatus
-> Either String IdentityDkimAttributes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String VerificationStatus
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"DkimVerificationStatus")
instance Prelude.Hashable IdentityDkimAttributes
instance Prelude.NFData IdentityDkimAttributes