{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SESV2.Types.SuppressedDestinationSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SESV2.Types.SuppressedDestinationSummary 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

-- | A summary that describes the suppressed email address.
--
-- /See:/ 'newSuppressedDestinationSummary' smart constructor.
data SuppressedDestinationSummary = SuppressedDestinationSummary'
  { -- | The email address that\'s on the suppression list for your account.
    SuppressedDestinationSummary -> Text
emailAddress :: Prelude.Text,
    -- | The reason that the address was added to the suppression list for your
    -- account.
    SuppressedDestinationSummary -> SuppressionListReason
reason :: SuppressionListReason,
    -- | The date and time when the suppressed destination was last updated,
    -- shown in Unix time format.
    SuppressedDestinationSummary -> POSIX
lastUpdateTime :: Data.POSIX
  }
  deriving (SuppressedDestinationSummary
-> SuppressedDestinationSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SuppressedDestinationSummary
-> SuppressedDestinationSummary -> Bool
$c/= :: SuppressedDestinationSummary
-> SuppressedDestinationSummary -> Bool
== :: SuppressedDestinationSummary
-> SuppressedDestinationSummary -> Bool
$c== :: SuppressedDestinationSummary
-> SuppressedDestinationSummary -> Bool
Prelude.Eq, ReadPrec [SuppressedDestinationSummary]
ReadPrec SuppressedDestinationSummary
Int -> ReadS SuppressedDestinationSummary
ReadS [SuppressedDestinationSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SuppressedDestinationSummary]
$creadListPrec :: ReadPrec [SuppressedDestinationSummary]
readPrec :: ReadPrec SuppressedDestinationSummary
$creadPrec :: ReadPrec SuppressedDestinationSummary
readList :: ReadS [SuppressedDestinationSummary]
$creadList :: ReadS [SuppressedDestinationSummary]
readsPrec :: Int -> ReadS SuppressedDestinationSummary
$creadsPrec :: Int -> ReadS SuppressedDestinationSummary
Prelude.Read, Int -> SuppressedDestinationSummary -> ShowS
[SuppressedDestinationSummary] -> ShowS
SuppressedDestinationSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SuppressedDestinationSummary] -> ShowS
$cshowList :: [SuppressedDestinationSummary] -> ShowS
show :: SuppressedDestinationSummary -> String
$cshow :: SuppressedDestinationSummary -> String
showsPrec :: Int -> SuppressedDestinationSummary -> ShowS
$cshowsPrec :: Int -> SuppressedDestinationSummary -> ShowS
Prelude.Show, forall x.
Rep SuppressedDestinationSummary x -> SuppressedDestinationSummary
forall x.
SuppressedDestinationSummary -> Rep SuppressedDestinationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SuppressedDestinationSummary x -> SuppressedDestinationSummary
$cfrom :: forall x.
SuppressedDestinationSummary -> Rep SuppressedDestinationSummary x
Prelude.Generic)

-- |
-- Create a value of 'SuppressedDestinationSummary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'emailAddress', 'suppressedDestinationSummary_emailAddress' - The email address that\'s on the suppression list for your account.
--
-- 'reason', 'suppressedDestinationSummary_reason' - The reason that the address was added to the suppression list for your
-- account.
--
-- 'lastUpdateTime', 'suppressedDestinationSummary_lastUpdateTime' - The date and time when the suppressed destination was last updated,
-- shown in Unix time format.
newSuppressedDestinationSummary ::
  -- | 'emailAddress'
  Prelude.Text ->
  -- | 'reason'
  SuppressionListReason ->
  -- | 'lastUpdateTime'
  Prelude.UTCTime ->
  SuppressedDestinationSummary
newSuppressedDestinationSummary :: Text
-> SuppressionListReason -> UTCTime -> SuppressedDestinationSummary
newSuppressedDestinationSummary
  Text
pEmailAddress_
  SuppressionListReason
pReason_
  UTCTime
pLastUpdateTime_ =
    SuppressedDestinationSummary'
      { $sel:emailAddress:SuppressedDestinationSummary' :: Text
emailAddress =
          Text
pEmailAddress_,
        $sel:reason:SuppressedDestinationSummary' :: SuppressionListReason
reason = SuppressionListReason
pReason_,
        $sel:lastUpdateTime:SuppressedDestinationSummary' :: POSIX
lastUpdateTime =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastUpdateTime_
      }

-- | The email address that\'s on the suppression list for your account.
suppressedDestinationSummary_emailAddress :: Lens.Lens' SuppressedDestinationSummary Prelude.Text
suppressedDestinationSummary_emailAddress :: Lens' SuppressedDestinationSummary Text
suppressedDestinationSummary_emailAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuppressedDestinationSummary' {Text
emailAddress :: Text
$sel:emailAddress:SuppressedDestinationSummary' :: SuppressedDestinationSummary -> Text
emailAddress} -> Text
emailAddress) (\s :: SuppressedDestinationSummary
s@SuppressedDestinationSummary' {} Text
a -> SuppressedDestinationSummary
s {$sel:emailAddress:SuppressedDestinationSummary' :: Text
emailAddress = Text
a} :: SuppressedDestinationSummary)

-- | The reason that the address was added to the suppression list for your
-- account.
suppressedDestinationSummary_reason :: Lens.Lens' SuppressedDestinationSummary SuppressionListReason
suppressedDestinationSummary_reason :: Lens' SuppressedDestinationSummary SuppressionListReason
suppressedDestinationSummary_reason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuppressedDestinationSummary' {SuppressionListReason
reason :: SuppressionListReason
$sel:reason:SuppressedDestinationSummary' :: SuppressedDestinationSummary -> SuppressionListReason
reason} -> SuppressionListReason
reason) (\s :: SuppressedDestinationSummary
s@SuppressedDestinationSummary' {} SuppressionListReason
a -> SuppressedDestinationSummary
s {$sel:reason:SuppressedDestinationSummary' :: SuppressionListReason
reason = SuppressionListReason
a} :: SuppressedDestinationSummary)

-- | The date and time when the suppressed destination was last updated,
-- shown in Unix time format.
suppressedDestinationSummary_lastUpdateTime :: Lens.Lens' SuppressedDestinationSummary Prelude.UTCTime
suppressedDestinationSummary_lastUpdateTime :: Lens' SuppressedDestinationSummary UTCTime
suppressedDestinationSummary_lastUpdateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuppressedDestinationSummary' {POSIX
lastUpdateTime :: POSIX
$sel:lastUpdateTime:SuppressedDestinationSummary' :: SuppressedDestinationSummary -> POSIX
lastUpdateTime} -> POSIX
lastUpdateTime) (\s :: SuppressedDestinationSummary
s@SuppressedDestinationSummary' {} POSIX
a -> SuppressedDestinationSummary
s {$sel:lastUpdateTime:SuppressedDestinationSummary' :: POSIX
lastUpdateTime = POSIX
a} :: SuppressedDestinationSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON SuppressedDestinationSummary where
  parseJSON :: Value -> Parser SuppressedDestinationSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SuppressedDestinationSummary"
      ( \Object
x ->
          Text
-> SuppressionListReason -> POSIX -> SuppressedDestinationSummary
SuppressedDestinationSummary'
            forall (f :: * -> *) a b. Functor 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
    SuppressedDestinationSummary
  where
  hashWithSalt :: Int -> SuppressedDestinationSummary -> Int
hashWithSalt Int
_salt SuppressedDestinationSummary' {Text
POSIX
SuppressionListReason
lastUpdateTime :: POSIX
reason :: SuppressionListReason
emailAddress :: Text
$sel:lastUpdateTime:SuppressedDestinationSummary' :: SuppressedDestinationSummary -> POSIX
$sel:reason:SuppressedDestinationSummary' :: SuppressedDestinationSummary -> SuppressionListReason
$sel:emailAddress:SuppressedDestinationSummary' :: SuppressedDestinationSummary -> Text
..} =
    Int
_salt
      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 SuppressedDestinationSummary where
  rnf :: SuppressedDestinationSummary -> ()
rnf SuppressedDestinationSummary' {Text
POSIX
SuppressionListReason
lastUpdateTime :: POSIX
reason :: SuppressionListReason
emailAddress :: Text
$sel:lastUpdateTime:SuppressedDestinationSummary' :: SuppressedDestinationSummary -> POSIX
$sel:reason:SuppressedDestinationSummary' :: SuppressedDestinationSummary -> SuppressionListReason
$sel:emailAddress:SuppressedDestinationSummary' :: SuppressedDestinationSummary -> Text
..} =
    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