{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SESV2.Types.SuppressedDestinationAttributes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(SuppressedDestinationAttributes
 -> SuppressedDestinationAttributes -> Bool)
-> (SuppressedDestinationAttributes
    -> SuppressedDestinationAttributes -> Bool)
-> Eq SuppressedDestinationAttributes
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]
(Int -> ReadS SuppressedDestinationAttributes)
-> ReadS [SuppressedDestinationAttributes]
-> ReadPrec SuppressedDestinationAttributes
-> ReadPrec [SuppressedDestinationAttributes]
-> Read 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
(Int -> SuppressedDestinationAttributes -> ShowS)
-> (SuppressedDestinationAttributes -> String)
-> ([SuppressedDestinationAttributes] -> ShowS)
-> Show SuppressedDestinationAttributes
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.
 SuppressedDestinationAttributes
 -> Rep SuppressedDestinationAttributes x)
-> (forall x.
    Rep SuppressedDestinationAttributes x
    -> SuppressedDestinationAttributes)
-> Generic SuppressedDestinationAttributes
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' :: Maybe Text -> Maybe Text -> SuppressedDestinationAttributes
SuppressedDestinationAttributes'
    { $sel:feedbackId:SuppressedDestinationAttributes' :: Maybe Text
feedbackId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:messageId:SuppressedDestinationAttributes' :: Maybe Text
messageId = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> SuppressedDestinationAttributes
-> f SuppressedDestinationAttributes
suppressedDestinationAttributes_feedbackId = (SuppressedDestinationAttributes -> Maybe Text)
-> (SuppressedDestinationAttributes
    -> Maybe Text -> SuppressedDestinationAttributes)
-> Lens
     SuppressedDestinationAttributes
     SuppressedDestinationAttributes
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> SuppressedDestinationAttributes
-> f SuppressedDestinationAttributes
suppressedDestinationAttributes_messageId = (SuppressedDestinationAttributes -> Maybe Text)
-> (SuppressedDestinationAttributes
    -> Maybe Text -> SuppressedDestinationAttributes)
-> Lens
     SuppressedDestinationAttributes
     SuppressedDestinationAttributes
     (Maybe Text)
     (Maybe Text)
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
  Core.FromJSON
    SuppressedDestinationAttributes
  where
  parseJSON :: Value -> Parser SuppressedDestinationAttributes
parseJSON =
    String
-> (Object -> Parser SuppressedDestinationAttributes)
-> Value
-> Parser SuppressedDestinationAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SuppressedDestinationAttributes"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> SuppressedDestinationAttributes
SuppressedDestinationAttributes'
            (Maybe Text -> Maybe Text -> SuppressedDestinationAttributes)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> SuppressedDestinationAttributes)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FeedbackId")
            Parser (Maybe Text -> SuppressedDestinationAttributes)
-> Parser (Maybe Text) -> Parser SuppressedDestinationAttributes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MessageId")
      )

instance
  Prelude.Hashable
    SuppressedDestinationAttributes

instance
  Prelude.NFData
    SuppressedDestinationAttributes