{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:suppressedReasons:SuppressionAttributes' :: Maybe [SuppressionListReason]
suppressedReasons =
forall a. Maybe a
Prelude.Nothing
}
suppressionAttributes_suppressedReasons :: Lens.Lens' SuppressionAttributes (Prelude.Maybe [SuppressionListReason])
suppressionAttributes_suppressedReasons :: Lens' SuppressionAttributes (Maybe [SuppressionListReason])
suppressionAttributes_suppressedReasons = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON SuppressionAttributes where
parseJSON :: Value -> Parser SuppressionAttributes
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SuppressionAttributes"
( \Object
x ->
Maybe [SuppressionListReason] -> SuppressionAttributes
SuppressionAttributes'
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
"SuppressedReasons"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable SuppressionAttributes where
hashWithSalt :: Int -> SuppressionAttributes -> Int
hashWithSalt Int
_salt SuppressionAttributes' {Maybe [SuppressionListReason]
suppressedReasons :: Maybe [SuppressionListReason]
$sel:suppressedReasons:SuppressionAttributes' :: SuppressionAttributes -> Maybe [SuppressionListReason]
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SuppressionListReason]
suppressedReasons
instance Prelude.NFData SuppressionAttributes where
rnf :: SuppressionAttributes -> ()
rnf SuppressionAttributes' {Maybe [SuppressionListReason]
suppressedReasons :: Maybe [SuppressionListReason]
$sel:suppressedReasons:SuppressionAttributes' :: SuppressionAttributes -> Maybe [SuppressionListReason]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [SuppressionListReason]
suppressedReasons