{-# 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.SuppressedDestinationAttributes
-- 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.SuppressedDestinationAttributes 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

-- | An object that contains additional attributes that are related an email
-- address that is on the suppression list for your account.
--
-- /See:/ 'newSuppressedDestinationAttributes' smart constructor.
data SuppressedDestinationAttributes = SuppressedDestinationAttributes'
  { -- | A unique identifier that\'s generated when an email address is added to
    -- the suppression list for your account.
    SuppressedDestinationAttributes -> Maybe Text
feedbackId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the email message that caused the email address
    -- to be added to the suppression list for your account.
    SuppressedDestinationAttributes -> Maybe Text
messageId :: Prelude.Maybe Prelude.Text
  }
  deriving (SuppressedDestinationAttributes
-> SuppressedDestinationAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SuppressedDestinationAttributes
-> SuppressedDestinationAttributes -> Bool
$c/= :: SuppressedDestinationAttributes
-> SuppressedDestinationAttributes -> Bool
== :: SuppressedDestinationAttributes
-> SuppressedDestinationAttributes -> Bool
$c== :: SuppressedDestinationAttributes
-> SuppressedDestinationAttributes -> Bool
Prelude.Eq, ReadPrec [SuppressedDestinationAttributes]
ReadPrec SuppressedDestinationAttributes
Int -> ReadS SuppressedDestinationAttributes
ReadS [SuppressedDestinationAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SuppressedDestinationAttributes]
$creadListPrec :: ReadPrec [SuppressedDestinationAttributes]
readPrec :: ReadPrec SuppressedDestinationAttributes
$creadPrec :: ReadPrec SuppressedDestinationAttributes
readList :: ReadS [SuppressedDestinationAttributes]
$creadList :: ReadS [SuppressedDestinationAttributes]
readsPrec :: Int -> ReadS SuppressedDestinationAttributes
$creadsPrec :: Int -> ReadS SuppressedDestinationAttributes
Prelude.Read, Int -> SuppressedDestinationAttributes -> ShowS
[SuppressedDestinationAttributes] -> ShowS
SuppressedDestinationAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SuppressedDestinationAttributes] -> ShowS
$cshowList :: [SuppressedDestinationAttributes] -> ShowS
show :: SuppressedDestinationAttributes -> String
$cshow :: SuppressedDestinationAttributes -> String
showsPrec :: Int -> SuppressedDestinationAttributes -> ShowS
$cshowsPrec :: Int -> SuppressedDestinationAttributes -> ShowS
Prelude.Show, forall x.
Rep SuppressedDestinationAttributes x
-> SuppressedDestinationAttributes
forall x.
SuppressedDestinationAttributes
-> Rep SuppressedDestinationAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SuppressedDestinationAttributes x
-> SuppressedDestinationAttributes
$cfrom :: forall x.
SuppressedDestinationAttributes
-> Rep SuppressedDestinationAttributes x
Prelude.Generic)

-- |
-- Create a value of 'SuppressedDestinationAttributes' 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:
--
-- 'feedbackId', 'suppressedDestinationAttributes_feedbackId' - A unique identifier that\'s generated when an email address is added to
-- the suppression list for your account.
--
-- 'messageId', 'suppressedDestinationAttributes_messageId' - The unique identifier of the email message that caused the email address
-- to be added to the suppression list for your account.
newSuppressedDestinationAttributes ::
  SuppressedDestinationAttributes
newSuppressedDestinationAttributes :: SuppressedDestinationAttributes
newSuppressedDestinationAttributes =
  SuppressedDestinationAttributes'
    { $sel:feedbackId:SuppressedDestinationAttributes' :: Maybe Text
feedbackId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:messageId:SuppressedDestinationAttributes' :: Maybe Text
messageId = forall a. Maybe a
Prelude.Nothing
    }

-- | A unique identifier that\'s generated when an email address is added to
-- the suppression list for your account.
suppressedDestinationAttributes_feedbackId :: Lens.Lens' SuppressedDestinationAttributes (Prelude.Maybe Prelude.Text)
suppressedDestinationAttributes_feedbackId :: Lens' SuppressedDestinationAttributes (Maybe Text)
suppressedDestinationAttributes_feedbackId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuppressedDestinationAttributes' {Maybe Text
feedbackId :: Maybe Text
$sel:feedbackId:SuppressedDestinationAttributes' :: SuppressedDestinationAttributes -> Maybe Text
feedbackId} -> Maybe Text
feedbackId) (\s :: SuppressedDestinationAttributes
s@SuppressedDestinationAttributes' {} Maybe Text
a -> SuppressedDestinationAttributes
s {$sel:feedbackId:SuppressedDestinationAttributes' :: Maybe Text
feedbackId = Maybe Text
a} :: SuppressedDestinationAttributes)

-- | The unique identifier of the email message that caused the email address
-- to be added to the suppression list for your account.
suppressedDestinationAttributes_messageId :: Lens.Lens' SuppressedDestinationAttributes (Prelude.Maybe Prelude.Text)
suppressedDestinationAttributes_messageId :: Lens' SuppressedDestinationAttributes (Maybe Text)
suppressedDestinationAttributes_messageId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuppressedDestinationAttributes' {Maybe Text
messageId :: Maybe Text
$sel:messageId:SuppressedDestinationAttributes' :: SuppressedDestinationAttributes -> Maybe Text
messageId} -> Maybe Text
messageId) (\s :: SuppressedDestinationAttributes
s@SuppressedDestinationAttributes' {} Maybe Text
a -> SuppressedDestinationAttributes
s {$sel:messageId:SuppressedDestinationAttributes' :: Maybe Text
messageId = Maybe Text
a} :: SuppressedDestinationAttributes)

instance
  Data.FromJSON
    SuppressedDestinationAttributes
  where
  parseJSON :: Value -> Parser SuppressedDestinationAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SuppressedDestinationAttributes"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> SuppressedDestinationAttributes
SuppressedDestinationAttributes'
            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
"FeedbackId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MessageId")
      )

instance
  Prelude.Hashable
    SuppressedDestinationAttributes
  where
  hashWithSalt :: Int -> SuppressedDestinationAttributes -> Int
hashWithSalt
    Int
_salt
    SuppressedDestinationAttributes' {Maybe Text
messageId :: Maybe Text
feedbackId :: Maybe Text
$sel:messageId:SuppressedDestinationAttributes' :: SuppressedDestinationAttributes -> Maybe Text
$sel:feedbackId:SuppressedDestinationAttributes' :: SuppressedDestinationAttributes -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
feedbackId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
messageId

instance
  Prelude.NFData
    SuppressedDestinationAttributes
  where
  rnf :: SuppressedDestinationAttributes -> ()
rnf SuppressedDestinationAttributes' {Maybe Text
messageId :: Maybe Text
feedbackId :: Maybe Text
$sel:messageId:SuppressedDestinationAttributes' :: SuppressedDestinationAttributes -> Maybe Text
$sel:feedbackId:SuppressedDestinationAttributes' :: SuppressedDestinationAttributes -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
feedbackId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
messageId