{-# 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.SuppressedDestination 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.SuppressedDestinationAttributes
import Amazonka.SESV2.Types.SuppressionListReason
data SuppressedDestination = SuppressedDestination'
{
SuppressedDestination -> Maybe SuppressedDestinationAttributes
attributes :: Prelude.Maybe SuppressedDestinationAttributes,
SuppressedDestination -> Text
emailAddress :: Prelude.Text,
SuppressedDestination -> SuppressionListReason
reason :: SuppressionListReason,
SuppressedDestination -> POSIX
lastUpdateTime :: Data.POSIX
}
deriving (SuppressedDestination -> SuppressedDestination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SuppressedDestination -> SuppressedDestination -> Bool
$c/= :: SuppressedDestination -> SuppressedDestination -> Bool
== :: SuppressedDestination -> SuppressedDestination -> Bool
$c== :: SuppressedDestination -> SuppressedDestination -> Bool
Prelude.Eq, ReadPrec [SuppressedDestination]
ReadPrec SuppressedDestination
Int -> ReadS SuppressedDestination
ReadS [SuppressedDestination]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SuppressedDestination]
$creadListPrec :: ReadPrec [SuppressedDestination]
readPrec :: ReadPrec SuppressedDestination
$creadPrec :: ReadPrec SuppressedDestination
readList :: ReadS [SuppressedDestination]
$creadList :: ReadS [SuppressedDestination]
readsPrec :: Int -> ReadS SuppressedDestination
$creadsPrec :: Int -> ReadS SuppressedDestination
Prelude.Read, Int -> SuppressedDestination -> ShowS
[SuppressedDestination] -> ShowS
SuppressedDestination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SuppressedDestination] -> ShowS
$cshowList :: [SuppressedDestination] -> ShowS
show :: SuppressedDestination -> String
$cshow :: SuppressedDestination -> String
showsPrec :: Int -> SuppressedDestination -> ShowS
$cshowsPrec :: Int -> SuppressedDestination -> ShowS
Prelude.Show, forall x. Rep SuppressedDestination x -> SuppressedDestination
forall x. SuppressedDestination -> Rep SuppressedDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SuppressedDestination x -> SuppressedDestination
$cfrom :: forall x. SuppressedDestination -> Rep SuppressedDestination x
Prelude.Generic)
newSuppressedDestination ::
Prelude.Text ->
SuppressionListReason ->
Prelude.UTCTime ->
SuppressedDestination
newSuppressedDestination :: Text -> SuppressionListReason -> UTCTime -> SuppressedDestination
newSuppressedDestination
Text
pEmailAddress_
SuppressionListReason
pReason_
UTCTime
pLastUpdateTime_ =
SuppressedDestination'
{ $sel:attributes:SuppressedDestination' :: Maybe SuppressedDestinationAttributes
attributes =
forall a. Maybe a
Prelude.Nothing,
$sel:emailAddress:SuppressedDestination' :: Text
emailAddress = Text
pEmailAddress_,
$sel:reason:SuppressedDestination' :: SuppressionListReason
reason = SuppressionListReason
pReason_,
$sel:lastUpdateTime:SuppressedDestination' :: POSIX
lastUpdateTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastUpdateTime_
}
suppressedDestination_attributes :: Lens.Lens' SuppressedDestination (Prelude.Maybe SuppressedDestinationAttributes)
suppressedDestination_attributes :: Lens' SuppressedDestination (Maybe SuppressedDestinationAttributes)
suppressedDestination_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuppressedDestination' {Maybe SuppressedDestinationAttributes
attributes :: Maybe SuppressedDestinationAttributes
$sel:attributes:SuppressedDestination' :: SuppressedDestination -> Maybe SuppressedDestinationAttributes
attributes} -> Maybe SuppressedDestinationAttributes
attributes) (\s :: SuppressedDestination
s@SuppressedDestination' {} Maybe SuppressedDestinationAttributes
a -> SuppressedDestination
s {$sel:attributes:SuppressedDestination' :: Maybe SuppressedDestinationAttributes
attributes = Maybe SuppressedDestinationAttributes
a} :: SuppressedDestination)
suppressedDestination_emailAddress :: Lens.Lens' SuppressedDestination Prelude.Text
suppressedDestination_emailAddress :: Lens' SuppressedDestination Text
suppressedDestination_emailAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuppressedDestination' {Text
emailAddress :: Text
$sel:emailAddress:SuppressedDestination' :: SuppressedDestination -> Text
emailAddress} -> Text
emailAddress) (\s :: SuppressedDestination
s@SuppressedDestination' {} Text
a -> SuppressedDestination
s {$sel:emailAddress:SuppressedDestination' :: Text
emailAddress = Text
a} :: SuppressedDestination)
suppressedDestination_reason :: Lens.Lens' SuppressedDestination SuppressionListReason
suppressedDestination_reason :: Lens' SuppressedDestination SuppressionListReason
suppressedDestination_reason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuppressedDestination' {SuppressionListReason
reason :: SuppressionListReason
$sel:reason:SuppressedDestination' :: SuppressedDestination -> SuppressionListReason
reason} -> SuppressionListReason
reason) (\s :: SuppressedDestination
s@SuppressedDestination' {} SuppressionListReason
a -> SuppressedDestination
s {$sel:reason:SuppressedDestination' :: SuppressionListReason
reason = SuppressionListReason
a} :: SuppressedDestination)
suppressedDestination_lastUpdateTime :: Lens.Lens' SuppressedDestination Prelude.UTCTime
suppressedDestination_lastUpdateTime :: Lens' SuppressedDestination UTCTime
suppressedDestination_lastUpdateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuppressedDestination' {POSIX
lastUpdateTime :: POSIX
$sel:lastUpdateTime:SuppressedDestination' :: SuppressedDestination -> POSIX
lastUpdateTime} -> POSIX
lastUpdateTime) (\s :: SuppressedDestination
s@SuppressedDestination' {} POSIX
a -> SuppressedDestination
s {$sel:lastUpdateTime:SuppressedDestination' :: POSIX
lastUpdateTime = POSIX
a} :: SuppressedDestination) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON SuppressedDestination where
parseJSON :: Value -> Parser SuppressedDestination
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SuppressedDestination"
( \Object
x ->
Maybe SuppressedDestinationAttributes
-> Text -> SuppressionListReason -> POSIX -> SuppressedDestination
SuppressedDestination'
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
"Attributes")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"EmailAddress")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Reason")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"LastUpdateTime")
)
instance Prelude.Hashable SuppressedDestination where
hashWithSalt :: Int -> SuppressedDestination -> Int
hashWithSalt Int
_salt SuppressedDestination' {Maybe SuppressedDestinationAttributes
Text
POSIX
SuppressionListReason
lastUpdateTime :: POSIX
reason :: SuppressionListReason
emailAddress :: Text
attributes :: Maybe SuppressedDestinationAttributes
$sel:lastUpdateTime:SuppressedDestination' :: SuppressedDestination -> POSIX
$sel:reason:SuppressedDestination' :: SuppressedDestination -> SuppressionListReason
$sel:emailAddress:SuppressedDestination' :: SuppressedDestination -> Text
$sel:attributes:SuppressedDestination' :: SuppressedDestination -> Maybe SuppressedDestinationAttributes
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SuppressedDestinationAttributes
attributes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
emailAddress
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SuppressionListReason
reason
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
lastUpdateTime
instance Prelude.NFData SuppressedDestination where
rnf :: SuppressedDestination -> ()
rnf SuppressedDestination' {Maybe SuppressedDestinationAttributes
Text
POSIX
SuppressionListReason
lastUpdateTime :: POSIX
reason :: SuppressionListReason
emailAddress :: Text
attributes :: Maybe SuppressedDestinationAttributes
$sel:lastUpdateTime:SuppressedDestination' :: SuppressedDestination -> POSIX
$sel:reason:SuppressedDestination' :: SuppressedDestination -> SuppressionListReason
$sel:emailAddress:SuppressedDestination' :: SuppressedDestination -> Text
$sel:attributes:SuppressedDestination' :: SuppressedDestination -> Maybe SuppressedDestinationAttributes
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe SuppressedDestinationAttributes
attributes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
emailAddress
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SuppressionListReason
reason
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
lastUpdateTime