{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.ListSuppressedDestinations
-- 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)
--
-- Retrieves a list of email addresses that are on the suppression list for
-- your account.
module Amazonka.SESV2.ListSuppressedDestinations
  ( -- * Creating a Request
    ListSuppressedDestinations (..),
    newListSuppressedDestinations,

    -- * Request Lenses
    listSuppressedDestinations_reasons,
    listSuppressedDestinations_endDate,
    listSuppressedDestinations_startDate,
    listSuppressedDestinations_nextToken,
    listSuppressedDestinations_pageSize,

    -- * Destructuring the Response
    ListSuppressedDestinationsResponse (..),
    newListSuppressedDestinationsResponse,

    -- * Response Lenses
    listSuppressedDestinationsResponse_nextToken,
    listSuppressedDestinationsResponse_suppressedDestinationSummaries,
    listSuppressedDestinationsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SESV2.Types

-- | A request to obtain a list of email destinations that are on the
-- suppression list for your account.
--
-- /See:/ 'newListSuppressedDestinations' smart constructor.
data ListSuppressedDestinations = ListSuppressedDestinations'
  { -- | The factors that caused the email address to be added to .
    ListSuppressedDestinations -> Maybe [SuppressionListReason]
reasons :: Prelude.Maybe [SuppressionListReason],
    -- | Used to filter the list of suppressed email destinations so that it only
    -- includes addresses that were added to the list before a specific date.
    -- The date that you specify should be in Unix time format.
    ListSuppressedDestinations -> Maybe POSIX
endDate :: Prelude.Maybe Core.POSIX,
    -- | Used to filter the list of suppressed email destinations so that it only
    -- includes addresses that were added to the list after a specific date.
    -- The date that you specify should be in Unix time format.
    ListSuppressedDestinations -> Maybe POSIX
startDate :: Prelude.Maybe Core.POSIX,
    -- | A token returned from a previous call to @ListSuppressedDestinations@ to
    -- indicate the position in the list of suppressed email addresses.
    ListSuppressedDestinations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The number of results to show in a single call to
    -- @ListSuppressedDestinations@. If the number of results is larger than
    -- the number you specified in this parameter, then the response includes a
    -- @NextToken@ element, which you can use to obtain additional results.
    ListSuppressedDestinations -> Maybe Int
pageSize :: Prelude.Maybe Prelude.Int
  }
  deriving (ListSuppressedDestinations -> ListSuppressedDestinations -> Bool
(ListSuppressedDestinations -> ListSuppressedDestinations -> Bool)
-> (ListSuppressedDestinations
    -> ListSuppressedDestinations -> Bool)
-> Eq ListSuppressedDestinations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSuppressedDestinations -> ListSuppressedDestinations -> Bool
$c/= :: ListSuppressedDestinations -> ListSuppressedDestinations -> Bool
== :: ListSuppressedDestinations -> ListSuppressedDestinations -> Bool
$c== :: ListSuppressedDestinations -> ListSuppressedDestinations -> Bool
Prelude.Eq, ReadPrec [ListSuppressedDestinations]
ReadPrec ListSuppressedDestinations
Int -> ReadS ListSuppressedDestinations
ReadS [ListSuppressedDestinations]
(Int -> ReadS ListSuppressedDestinations)
-> ReadS [ListSuppressedDestinations]
-> ReadPrec ListSuppressedDestinations
-> ReadPrec [ListSuppressedDestinations]
-> Read ListSuppressedDestinations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSuppressedDestinations]
$creadListPrec :: ReadPrec [ListSuppressedDestinations]
readPrec :: ReadPrec ListSuppressedDestinations
$creadPrec :: ReadPrec ListSuppressedDestinations
readList :: ReadS [ListSuppressedDestinations]
$creadList :: ReadS [ListSuppressedDestinations]
readsPrec :: Int -> ReadS ListSuppressedDestinations
$creadsPrec :: Int -> ReadS ListSuppressedDestinations
Prelude.Read, Int -> ListSuppressedDestinations -> ShowS
[ListSuppressedDestinations] -> ShowS
ListSuppressedDestinations -> String
(Int -> ListSuppressedDestinations -> ShowS)
-> (ListSuppressedDestinations -> String)
-> ([ListSuppressedDestinations] -> ShowS)
-> Show ListSuppressedDestinations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSuppressedDestinations] -> ShowS
$cshowList :: [ListSuppressedDestinations] -> ShowS
show :: ListSuppressedDestinations -> String
$cshow :: ListSuppressedDestinations -> String
showsPrec :: Int -> ListSuppressedDestinations -> ShowS
$cshowsPrec :: Int -> ListSuppressedDestinations -> ShowS
Prelude.Show, (forall x.
 ListSuppressedDestinations -> Rep ListSuppressedDestinations x)
-> (forall x.
    Rep ListSuppressedDestinations x -> ListSuppressedDestinations)
-> Generic ListSuppressedDestinations
forall x.
Rep ListSuppressedDestinations x -> ListSuppressedDestinations
forall x.
ListSuppressedDestinations -> Rep ListSuppressedDestinations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSuppressedDestinations x -> ListSuppressedDestinations
$cfrom :: forall x.
ListSuppressedDestinations -> Rep ListSuppressedDestinations x
Prelude.Generic)

-- |
-- Create a value of 'ListSuppressedDestinations' 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:
--
-- 'reasons', 'listSuppressedDestinations_reasons' - The factors that caused the email address to be added to .
--
-- 'endDate', 'listSuppressedDestinations_endDate' - Used to filter the list of suppressed email destinations so that it only
-- includes addresses that were added to the list before a specific date.
-- The date that you specify should be in Unix time format.
--
-- 'startDate', 'listSuppressedDestinations_startDate' - Used to filter the list of suppressed email destinations so that it only
-- includes addresses that were added to the list after a specific date.
-- The date that you specify should be in Unix time format.
--
-- 'nextToken', 'listSuppressedDestinations_nextToken' - A token returned from a previous call to @ListSuppressedDestinations@ to
-- indicate the position in the list of suppressed email addresses.
--
-- 'pageSize', 'listSuppressedDestinations_pageSize' - The number of results to show in a single call to
-- @ListSuppressedDestinations@. If the number of results is larger than
-- the number you specified in this parameter, then the response includes a
-- @NextToken@ element, which you can use to obtain additional results.
newListSuppressedDestinations ::
  ListSuppressedDestinations
newListSuppressedDestinations :: ListSuppressedDestinations
newListSuppressedDestinations =
  ListSuppressedDestinations' :: Maybe [SuppressionListReason]
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Int
-> ListSuppressedDestinations
ListSuppressedDestinations'
    { $sel:reasons:ListSuppressedDestinations' :: Maybe [SuppressionListReason]
reasons =
        Maybe [SuppressionListReason]
forall a. Maybe a
Prelude.Nothing,
      $sel:endDate:ListSuppressedDestinations' :: Maybe POSIX
endDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:startDate:ListSuppressedDestinations' :: Maybe POSIX
startDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSuppressedDestinations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:ListSuppressedDestinations' :: Maybe Int
pageSize = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The factors that caused the email address to be added to .
listSuppressedDestinations_reasons :: Lens.Lens' ListSuppressedDestinations (Prelude.Maybe [SuppressionListReason])
listSuppressedDestinations_reasons :: (Maybe [SuppressionListReason]
 -> f (Maybe [SuppressionListReason]))
-> ListSuppressedDestinations -> f ListSuppressedDestinations
listSuppressedDestinations_reasons = (ListSuppressedDestinations -> Maybe [SuppressionListReason])
-> (ListSuppressedDestinations
    -> Maybe [SuppressionListReason] -> ListSuppressedDestinations)
-> Lens
     ListSuppressedDestinations
     ListSuppressedDestinations
     (Maybe [SuppressionListReason])
     (Maybe [SuppressionListReason])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSuppressedDestinations' {Maybe [SuppressionListReason]
reasons :: Maybe [SuppressionListReason]
$sel:reasons:ListSuppressedDestinations' :: ListSuppressedDestinations -> Maybe [SuppressionListReason]
reasons} -> Maybe [SuppressionListReason]
reasons) (\s :: ListSuppressedDestinations
s@ListSuppressedDestinations' {} Maybe [SuppressionListReason]
a -> ListSuppressedDestinations
s {$sel:reasons:ListSuppressedDestinations' :: Maybe [SuppressionListReason]
reasons = Maybe [SuppressionListReason]
a} :: ListSuppressedDestinations) ((Maybe [SuppressionListReason]
  -> f (Maybe [SuppressionListReason]))
 -> ListSuppressedDestinations -> f ListSuppressedDestinations)
-> ((Maybe [SuppressionListReason]
     -> f (Maybe [SuppressionListReason]))
    -> Maybe [SuppressionListReason]
    -> f (Maybe [SuppressionListReason]))
-> (Maybe [SuppressionListReason]
    -> f (Maybe [SuppressionListReason]))
-> ListSuppressedDestinations
-> f ListSuppressedDestinations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SuppressionListReason]
  [SuppressionListReason]
  [SuppressionListReason]
  [SuppressionListReason]
-> Iso
     (Maybe [SuppressionListReason])
     (Maybe [SuppressionListReason])
     (Maybe [SuppressionListReason])
     (Maybe [SuppressionListReason])
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 AnIso
  [SuppressionListReason]
  [SuppressionListReason]
  [SuppressionListReason]
  [SuppressionListReason]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Used to filter the list of suppressed email destinations so that it only
-- includes addresses that were added to the list before a specific date.
-- The date that you specify should be in Unix time format.
listSuppressedDestinations_endDate :: Lens.Lens' ListSuppressedDestinations (Prelude.Maybe Prelude.UTCTime)
listSuppressedDestinations_endDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListSuppressedDestinations -> f ListSuppressedDestinations
listSuppressedDestinations_endDate = (ListSuppressedDestinations -> Maybe POSIX)
-> (ListSuppressedDestinations
    -> Maybe POSIX -> ListSuppressedDestinations)
-> Lens
     ListSuppressedDestinations
     ListSuppressedDestinations
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSuppressedDestinations' {Maybe POSIX
endDate :: Maybe POSIX
$sel:endDate:ListSuppressedDestinations' :: ListSuppressedDestinations -> Maybe POSIX
endDate} -> Maybe POSIX
endDate) (\s :: ListSuppressedDestinations
s@ListSuppressedDestinations' {} Maybe POSIX
a -> ListSuppressedDestinations
s {$sel:endDate:ListSuppressedDestinations' :: Maybe POSIX
endDate = Maybe POSIX
a} :: ListSuppressedDestinations) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListSuppressedDestinations -> f ListSuppressedDestinations)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListSuppressedDestinations
-> f ListSuppressedDestinations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Used to filter the list of suppressed email destinations so that it only
-- includes addresses that were added to the list after a specific date.
-- The date that you specify should be in Unix time format.
listSuppressedDestinations_startDate :: Lens.Lens' ListSuppressedDestinations (Prelude.Maybe Prelude.UTCTime)
listSuppressedDestinations_startDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListSuppressedDestinations -> f ListSuppressedDestinations
listSuppressedDestinations_startDate = (ListSuppressedDestinations -> Maybe POSIX)
-> (ListSuppressedDestinations
    -> Maybe POSIX -> ListSuppressedDestinations)
-> Lens
     ListSuppressedDestinations
     ListSuppressedDestinations
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSuppressedDestinations' {Maybe POSIX
startDate :: Maybe POSIX
$sel:startDate:ListSuppressedDestinations' :: ListSuppressedDestinations -> Maybe POSIX
startDate} -> Maybe POSIX
startDate) (\s :: ListSuppressedDestinations
s@ListSuppressedDestinations' {} Maybe POSIX
a -> ListSuppressedDestinations
s {$sel:startDate:ListSuppressedDestinations' :: Maybe POSIX
startDate = Maybe POSIX
a} :: ListSuppressedDestinations) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListSuppressedDestinations -> f ListSuppressedDestinations)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListSuppressedDestinations
-> f ListSuppressedDestinations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A token returned from a previous call to @ListSuppressedDestinations@ to
-- indicate the position in the list of suppressed email addresses.
listSuppressedDestinations_nextToken :: Lens.Lens' ListSuppressedDestinations (Prelude.Maybe Prelude.Text)
listSuppressedDestinations_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSuppressedDestinations -> f ListSuppressedDestinations
listSuppressedDestinations_nextToken = (ListSuppressedDestinations -> Maybe Text)
-> (ListSuppressedDestinations
    -> Maybe Text -> ListSuppressedDestinations)
-> Lens
     ListSuppressedDestinations
     ListSuppressedDestinations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSuppressedDestinations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSuppressedDestinations' :: ListSuppressedDestinations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSuppressedDestinations
s@ListSuppressedDestinations' {} Maybe Text
a -> ListSuppressedDestinations
s {$sel:nextToken:ListSuppressedDestinations' :: Maybe Text
nextToken = Maybe Text
a} :: ListSuppressedDestinations)

-- | The number of results to show in a single call to
-- @ListSuppressedDestinations@. If the number of results is larger than
-- the number you specified in this parameter, then the response includes a
-- @NextToken@ element, which you can use to obtain additional results.
listSuppressedDestinations_pageSize :: Lens.Lens' ListSuppressedDestinations (Prelude.Maybe Prelude.Int)
listSuppressedDestinations_pageSize :: (Maybe Int -> f (Maybe Int))
-> ListSuppressedDestinations -> f ListSuppressedDestinations
listSuppressedDestinations_pageSize = (ListSuppressedDestinations -> Maybe Int)
-> (ListSuppressedDestinations
    -> Maybe Int -> ListSuppressedDestinations)
-> Lens
     ListSuppressedDestinations
     ListSuppressedDestinations
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSuppressedDestinations' {Maybe Int
pageSize :: Maybe Int
$sel:pageSize:ListSuppressedDestinations' :: ListSuppressedDestinations -> Maybe Int
pageSize} -> Maybe Int
pageSize) (\s :: ListSuppressedDestinations
s@ListSuppressedDestinations' {} Maybe Int
a -> ListSuppressedDestinations
s {$sel:pageSize:ListSuppressedDestinations' :: Maybe Int
pageSize = Maybe Int
a} :: ListSuppressedDestinations)

instance Core.AWSRequest ListSuppressedDestinations where
  type
    AWSResponse ListSuppressedDestinations =
      ListSuppressedDestinationsResponse
  request :: ListSuppressedDestinations -> Request ListSuppressedDestinations
request = Service
-> ListSuppressedDestinations -> Request ListSuppressedDestinations
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListSuppressedDestinations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListSuppressedDestinations)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListSuppressedDestinations))
-> Logger
-> Service
-> Proxy ListSuppressedDestinations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListSuppressedDestinations)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [SuppressedDestinationSummary]
-> Int
-> ListSuppressedDestinationsResponse
ListSuppressedDestinationsResponse'
            (Maybe Text
 -> Maybe [SuppressedDestinationSummary]
 -> Int
 -> ListSuppressedDestinationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [SuppressedDestinationSummary]
      -> Int -> ListSuppressedDestinationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Maybe [SuppressedDestinationSummary]
   -> Int -> ListSuppressedDestinationsResponse)
-> Either String (Maybe [SuppressedDestinationSummary])
-> Either String (Int -> ListSuppressedDestinationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [SuppressedDestinationSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SuppressedDestinationSummaries"
                            Either String (Maybe (Maybe [SuppressedDestinationSummary]))
-> Maybe [SuppressedDestinationSummary]
-> Either String (Maybe [SuppressedDestinationSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [SuppressedDestinationSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListSuppressedDestinationsResponse)
-> Either String Int
-> Either String ListSuppressedDestinationsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListSuppressedDestinations

instance Prelude.NFData ListSuppressedDestinations

instance Core.ToHeaders ListSuppressedDestinations where
  toHeaders :: ListSuppressedDestinations -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListSuppressedDestinations -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath ListSuppressedDestinations where
  toPath :: ListSuppressedDestinations -> ByteString
toPath =
    ByteString -> ListSuppressedDestinations -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v2/email/suppression/addresses"

instance Core.ToQuery ListSuppressedDestinations where
  toQuery :: ListSuppressedDestinations -> QueryString
toQuery ListSuppressedDestinations' {Maybe Int
Maybe [SuppressionListReason]
Maybe Text
Maybe POSIX
pageSize :: Maybe Int
nextToken :: Maybe Text
startDate :: Maybe POSIX
endDate :: Maybe POSIX
reasons :: Maybe [SuppressionListReason]
$sel:pageSize:ListSuppressedDestinations' :: ListSuppressedDestinations -> Maybe Int
$sel:nextToken:ListSuppressedDestinations' :: ListSuppressedDestinations -> Maybe Text
$sel:startDate:ListSuppressedDestinations' :: ListSuppressedDestinations -> Maybe POSIX
$sel:endDate:ListSuppressedDestinations' :: ListSuppressedDestinations -> Maybe POSIX
$sel:reasons:ListSuppressedDestinations' :: ListSuppressedDestinations -> Maybe [SuppressionListReason]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Reason"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [SuppressionListReason] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([SuppressionListReason] -> QueryString)
-> Maybe [SuppressionListReason] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SuppressionListReason]
reasons),
        ByteString
"EndDate" ByteString -> Maybe POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe POSIX
endDate,
        ByteString
"StartDate" ByteString -> Maybe POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe POSIX
startDate,
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"PageSize" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
pageSize
      ]

-- | A list of suppressed email addresses.
--
-- /See:/ 'newListSuppressedDestinationsResponse' smart constructor.
data ListSuppressedDestinationsResponse = ListSuppressedDestinationsResponse'
  { -- | A token that indicates that there are additional email addresses on the
    -- suppression list for your account. To view additional suppressed
    -- addresses, issue another request to @ListSuppressedDestinations@, and
    -- pass this token in the @NextToken@ parameter.
    ListSuppressedDestinationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of summaries, each containing a summary for a suppressed email
    -- destination.
    ListSuppressedDestinationsResponse
-> Maybe [SuppressedDestinationSummary]
suppressedDestinationSummaries :: Prelude.Maybe [SuppressedDestinationSummary],
    -- | The response's http status code.
    ListSuppressedDestinationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSuppressedDestinationsResponse
-> ListSuppressedDestinationsResponse -> Bool
(ListSuppressedDestinationsResponse
 -> ListSuppressedDestinationsResponse -> Bool)
-> (ListSuppressedDestinationsResponse
    -> ListSuppressedDestinationsResponse -> Bool)
-> Eq ListSuppressedDestinationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSuppressedDestinationsResponse
-> ListSuppressedDestinationsResponse -> Bool
$c/= :: ListSuppressedDestinationsResponse
-> ListSuppressedDestinationsResponse -> Bool
== :: ListSuppressedDestinationsResponse
-> ListSuppressedDestinationsResponse -> Bool
$c== :: ListSuppressedDestinationsResponse
-> ListSuppressedDestinationsResponse -> Bool
Prelude.Eq, ReadPrec [ListSuppressedDestinationsResponse]
ReadPrec ListSuppressedDestinationsResponse
Int -> ReadS ListSuppressedDestinationsResponse
ReadS [ListSuppressedDestinationsResponse]
(Int -> ReadS ListSuppressedDestinationsResponse)
-> ReadS [ListSuppressedDestinationsResponse]
-> ReadPrec ListSuppressedDestinationsResponse
-> ReadPrec [ListSuppressedDestinationsResponse]
-> Read ListSuppressedDestinationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSuppressedDestinationsResponse]
$creadListPrec :: ReadPrec [ListSuppressedDestinationsResponse]
readPrec :: ReadPrec ListSuppressedDestinationsResponse
$creadPrec :: ReadPrec ListSuppressedDestinationsResponse
readList :: ReadS [ListSuppressedDestinationsResponse]
$creadList :: ReadS [ListSuppressedDestinationsResponse]
readsPrec :: Int -> ReadS ListSuppressedDestinationsResponse
$creadsPrec :: Int -> ReadS ListSuppressedDestinationsResponse
Prelude.Read, Int -> ListSuppressedDestinationsResponse -> ShowS
[ListSuppressedDestinationsResponse] -> ShowS
ListSuppressedDestinationsResponse -> String
(Int -> ListSuppressedDestinationsResponse -> ShowS)
-> (ListSuppressedDestinationsResponse -> String)
-> ([ListSuppressedDestinationsResponse] -> ShowS)
-> Show ListSuppressedDestinationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSuppressedDestinationsResponse] -> ShowS
$cshowList :: [ListSuppressedDestinationsResponse] -> ShowS
show :: ListSuppressedDestinationsResponse -> String
$cshow :: ListSuppressedDestinationsResponse -> String
showsPrec :: Int -> ListSuppressedDestinationsResponse -> ShowS
$cshowsPrec :: Int -> ListSuppressedDestinationsResponse -> ShowS
Prelude.Show, (forall x.
 ListSuppressedDestinationsResponse
 -> Rep ListSuppressedDestinationsResponse x)
-> (forall x.
    Rep ListSuppressedDestinationsResponse x
    -> ListSuppressedDestinationsResponse)
-> Generic ListSuppressedDestinationsResponse
forall x.
Rep ListSuppressedDestinationsResponse x
-> ListSuppressedDestinationsResponse
forall x.
ListSuppressedDestinationsResponse
-> Rep ListSuppressedDestinationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSuppressedDestinationsResponse x
-> ListSuppressedDestinationsResponse
$cfrom :: forall x.
ListSuppressedDestinationsResponse
-> Rep ListSuppressedDestinationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSuppressedDestinationsResponse' 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:
--
-- 'nextToken', 'listSuppressedDestinationsResponse_nextToken' - A token that indicates that there are additional email addresses on the
-- suppression list for your account. To view additional suppressed
-- addresses, issue another request to @ListSuppressedDestinations@, and
-- pass this token in the @NextToken@ parameter.
--
-- 'suppressedDestinationSummaries', 'listSuppressedDestinationsResponse_suppressedDestinationSummaries' - A list of summaries, each containing a summary for a suppressed email
-- destination.
--
-- 'httpStatus', 'listSuppressedDestinationsResponse_httpStatus' - The response's http status code.
newListSuppressedDestinationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSuppressedDestinationsResponse
newListSuppressedDestinationsResponse :: Int -> ListSuppressedDestinationsResponse
newListSuppressedDestinationsResponse Int
pHttpStatus_ =
  ListSuppressedDestinationsResponse' :: Maybe Text
-> Maybe [SuppressedDestinationSummary]
-> Int
-> ListSuppressedDestinationsResponse
ListSuppressedDestinationsResponse'
    { $sel:nextToken:ListSuppressedDestinationsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:suppressedDestinationSummaries:ListSuppressedDestinationsResponse' :: Maybe [SuppressedDestinationSummary]
suppressedDestinationSummaries =
        Maybe [SuppressedDestinationSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSuppressedDestinationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A token that indicates that there are additional email addresses on the
-- suppression list for your account. To view additional suppressed
-- addresses, issue another request to @ListSuppressedDestinations@, and
-- pass this token in the @NextToken@ parameter.
listSuppressedDestinationsResponse_nextToken :: Lens.Lens' ListSuppressedDestinationsResponse (Prelude.Maybe Prelude.Text)
listSuppressedDestinationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSuppressedDestinationsResponse
-> f ListSuppressedDestinationsResponse
listSuppressedDestinationsResponse_nextToken = (ListSuppressedDestinationsResponse -> Maybe Text)
-> (ListSuppressedDestinationsResponse
    -> Maybe Text -> ListSuppressedDestinationsResponse)
-> Lens
     ListSuppressedDestinationsResponse
     ListSuppressedDestinationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSuppressedDestinationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSuppressedDestinationsResponse' :: ListSuppressedDestinationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSuppressedDestinationsResponse
s@ListSuppressedDestinationsResponse' {} Maybe Text
a -> ListSuppressedDestinationsResponse
s {$sel:nextToken:ListSuppressedDestinationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSuppressedDestinationsResponse)

-- | A list of summaries, each containing a summary for a suppressed email
-- destination.
listSuppressedDestinationsResponse_suppressedDestinationSummaries :: Lens.Lens' ListSuppressedDestinationsResponse (Prelude.Maybe [SuppressedDestinationSummary])
listSuppressedDestinationsResponse_suppressedDestinationSummaries :: (Maybe [SuppressedDestinationSummary]
 -> f (Maybe [SuppressedDestinationSummary]))
-> ListSuppressedDestinationsResponse
-> f ListSuppressedDestinationsResponse
listSuppressedDestinationsResponse_suppressedDestinationSummaries = (ListSuppressedDestinationsResponse
 -> Maybe [SuppressedDestinationSummary])
-> (ListSuppressedDestinationsResponse
    -> Maybe [SuppressedDestinationSummary]
    -> ListSuppressedDestinationsResponse)
-> Lens
     ListSuppressedDestinationsResponse
     ListSuppressedDestinationsResponse
     (Maybe [SuppressedDestinationSummary])
     (Maybe [SuppressedDestinationSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSuppressedDestinationsResponse' {Maybe [SuppressedDestinationSummary]
suppressedDestinationSummaries :: Maybe [SuppressedDestinationSummary]
$sel:suppressedDestinationSummaries:ListSuppressedDestinationsResponse' :: ListSuppressedDestinationsResponse
-> Maybe [SuppressedDestinationSummary]
suppressedDestinationSummaries} -> Maybe [SuppressedDestinationSummary]
suppressedDestinationSummaries) (\s :: ListSuppressedDestinationsResponse
s@ListSuppressedDestinationsResponse' {} Maybe [SuppressedDestinationSummary]
a -> ListSuppressedDestinationsResponse
s {$sel:suppressedDestinationSummaries:ListSuppressedDestinationsResponse' :: Maybe [SuppressedDestinationSummary]
suppressedDestinationSummaries = Maybe [SuppressedDestinationSummary]
a} :: ListSuppressedDestinationsResponse) ((Maybe [SuppressedDestinationSummary]
  -> f (Maybe [SuppressedDestinationSummary]))
 -> ListSuppressedDestinationsResponse
 -> f ListSuppressedDestinationsResponse)
-> ((Maybe [SuppressedDestinationSummary]
     -> f (Maybe [SuppressedDestinationSummary]))
    -> Maybe [SuppressedDestinationSummary]
    -> f (Maybe [SuppressedDestinationSummary]))
-> (Maybe [SuppressedDestinationSummary]
    -> f (Maybe [SuppressedDestinationSummary]))
-> ListSuppressedDestinationsResponse
-> f ListSuppressedDestinationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SuppressedDestinationSummary]
  [SuppressedDestinationSummary]
  [SuppressedDestinationSummary]
  [SuppressedDestinationSummary]
-> Iso
     (Maybe [SuppressedDestinationSummary])
     (Maybe [SuppressedDestinationSummary])
     (Maybe [SuppressedDestinationSummary])
     (Maybe [SuppressedDestinationSummary])
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 AnIso
  [SuppressedDestinationSummary]
  [SuppressedDestinationSummary]
  [SuppressedDestinationSummary]
  [SuppressedDestinationSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listSuppressedDestinationsResponse_httpStatus :: Lens.Lens' ListSuppressedDestinationsResponse Prelude.Int
listSuppressedDestinationsResponse_httpStatus :: (Int -> f Int)
-> ListSuppressedDestinationsResponse
-> f ListSuppressedDestinationsResponse
listSuppressedDestinationsResponse_httpStatus = (ListSuppressedDestinationsResponse -> Int)
-> (ListSuppressedDestinationsResponse
    -> Int -> ListSuppressedDestinationsResponse)
-> Lens
     ListSuppressedDestinationsResponse
     ListSuppressedDestinationsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSuppressedDestinationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListSuppressedDestinationsResponse' :: ListSuppressedDestinationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListSuppressedDestinationsResponse
s@ListSuppressedDestinationsResponse' {} Int
a -> ListSuppressedDestinationsResponse
s {$sel:httpStatus:ListSuppressedDestinationsResponse' :: Int
httpStatus = Int
a} :: ListSuppressedDestinationsResponse)

instance
  Prelude.NFData
    ListSuppressedDestinationsResponse