{-# 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.SESV2.Types.SuppressionAttributes where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SESV2.Types.SuppressionListReason
data SuppressionAttributes = SuppressionAttributes'
{
SuppressionAttributes -> Maybe [SuppressionListReason]
suppressedReasons :: Prelude.Maybe [SuppressionListReason]
}
deriving (SuppressionAttributes -> SuppressionAttributes -> Bool
(SuppressionAttributes -> SuppressionAttributes -> Bool)
-> (SuppressionAttributes -> SuppressionAttributes -> Bool)
-> Eq SuppressionAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SuppressionAttributes -> SuppressionAttributes -> Bool
$c/= :: SuppressionAttributes -> SuppressionAttributes -> Bool
== :: SuppressionAttributes -> SuppressionAttributes -> Bool
$c== :: SuppressionAttributes -> SuppressionAttributes -> Bool
Prelude.Eq, ReadPrec [SuppressionAttributes]
ReadPrec SuppressionAttributes
Int -> ReadS SuppressionAttributes
ReadS [SuppressionAttributes]
(Int -> ReadS SuppressionAttributes)
-> ReadS [SuppressionAttributes]
-> ReadPrec SuppressionAttributes
-> ReadPrec [SuppressionAttributes]
-> Read SuppressionAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SuppressionAttributes]
$creadListPrec :: ReadPrec [SuppressionAttributes]
readPrec :: ReadPrec SuppressionAttributes
$creadPrec :: ReadPrec SuppressionAttributes
readList :: ReadS [SuppressionAttributes]
$creadList :: ReadS [SuppressionAttributes]
readsPrec :: Int -> ReadS SuppressionAttributes
$creadsPrec :: Int -> ReadS SuppressionAttributes
Prelude.Read, Int -> SuppressionAttributes -> ShowS
[SuppressionAttributes] -> ShowS
SuppressionAttributes -> String
(Int -> SuppressionAttributes -> ShowS)
-> (SuppressionAttributes -> String)
-> ([SuppressionAttributes] -> ShowS)
-> Show SuppressionAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SuppressionAttributes] -> ShowS
$cshowList :: [SuppressionAttributes] -> ShowS
show :: SuppressionAttributes -> String
$cshow :: SuppressionAttributes -> String
showsPrec :: Int -> SuppressionAttributes -> ShowS
$cshowsPrec :: Int -> SuppressionAttributes -> ShowS
Prelude.Show, (forall x. SuppressionAttributes -> Rep SuppressionAttributes x)
-> (forall x. Rep SuppressionAttributes x -> SuppressionAttributes)
-> Generic SuppressionAttributes
forall x. Rep SuppressionAttributes x -> SuppressionAttributes
forall x. SuppressionAttributes -> Rep SuppressionAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SuppressionAttributes x -> SuppressionAttributes
$cfrom :: forall x. SuppressionAttributes -> Rep SuppressionAttributes x
Prelude.Generic)
newSuppressionAttributes ::
SuppressionAttributes
newSuppressionAttributes :: SuppressionAttributes
newSuppressionAttributes =
SuppressionAttributes' :: Maybe [SuppressionListReason] -> SuppressionAttributes
SuppressionAttributes'
{ $sel:suppressedReasons:SuppressionAttributes' :: Maybe [SuppressionListReason]
suppressedReasons =
Maybe [SuppressionListReason]
forall a. Maybe a
Prelude.Nothing
}
suppressionAttributes_suppressedReasons :: Lens.Lens' SuppressionAttributes (Prelude.Maybe [SuppressionListReason])
suppressionAttributes_suppressedReasons :: (Maybe [SuppressionListReason]
-> f (Maybe [SuppressionListReason]))
-> SuppressionAttributes -> f SuppressionAttributes
suppressionAttributes_suppressedReasons = (SuppressionAttributes -> Maybe [SuppressionListReason])
-> (SuppressionAttributes
-> Maybe [SuppressionListReason] -> SuppressionAttributes)
-> Lens
SuppressionAttributes
SuppressionAttributes
(Maybe [SuppressionListReason])
(Maybe [SuppressionListReason])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuppressionAttributes' {Maybe [SuppressionListReason]
suppressedReasons :: Maybe [SuppressionListReason]
$sel:suppressedReasons:SuppressionAttributes' :: SuppressionAttributes -> Maybe [SuppressionListReason]
suppressedReasons} -> Maybe [SuppressionListReason]
suppressedReasons) (\s :: SuppressionAttributes
s@SuppressionAttributes' {} Maybe [SuppressionListReason]
a -> SuppressionAttributes
s {$sel:suppressedReasons:SuppressionAttributes' :: Maybe [SuppressionListReason]
suppressedReasons = Maybe [SuppressionListReason]
a} :: SuppressionAttributes) ((Maybe [SuppressionListReason]
-> f (Maybe [SuppressionListReason]))
-> SuppressionAttributes -> f SuppressionAttributes)
-> ((Maybe [SuppressionListReason]
-> f (Maybe [SuppressionListReason]))
-> Maybe [SuppressionListReason]
-> f (Maybe [SuppressionListReason]))
-> (Maybe [SuppressionListReason]
-> f (Maybe [SuppressionListReason]))
-> SuppressionAttributes
-> f SuppressionAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[SuppressionListReason]
[SuppressionListReason]
[SuppressionListReason]
[SuppressionListReason]
-> Iso
(Maybe [SuppressionListReason])
(Maybe [SuppressionListReason])
(Maybe [SuppressionListReason])
(Maybe [SuppressionListReason])
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
[SuppressionListReason]
[SuppressionListReason]
[SuppressionListReason]
[SuppressionListReason]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON SuppressionAttributes where
parseJSON :: Value -> Parser SuppressionAttributes
parseJSON =
String
-> (Object -> Parser SuppressionAttributes)
-> Value
-> Parser SuppressionAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SuppressionAttributes"
( \Object
x ->
Maybe [SuppressionListReason] -> SuppressionAttributes
SuppressionAttributes'
(Maybe [SuppressionListReason] -> SuppressionAttributes)
-> Parser (Maybe [SuppressionListReason])
-> Parser SuppressionAttributes
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [SuppressionListReason]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SuppressedReasons"
Parser (Maybe (Maybe [SuppressionListReason]))
-> Maybe [SuppressionListReason]
-> Parser (Maybe [SuppressionListReason])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [SuppressionListReason]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable SuppressionAttributes
instance Prelude.NFData SuppressionAttributes