{-# 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 #-}
module Amazonka.SESV2.PutConfigurationSetSuppressionOptions
(
PutConfigurationSetSuppressionOptions (..),
newPutConfigurationSetSuppressionOptions,
putConfigurationSetSuppressionOptions_suppressedReasons,
putConfigurationSetSuppressionOptions_configurationSetName,
PutConfigurationSetSuppressionOptionsResponse (..),
newPutConfigurationSetSuppressionOptionsResponse,
putConfigurationSetSuppressionOptionsResponse_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
data PutConfigurationSetSuppressionOptions = PutConfigurationSetSuppressionOptions'
{
PutConfigurationSetSuppressionOptions
-> Maybe [SuppressionListReason]
suppressedReasons :: Prelude.Maybe [SuppressionListReason],
PutConfigurationSetSuppressionOptions -> Text
configurationSetName :: Prelude.Text
}
deriving (PutConfigurationSetSuppressionOptions
-> PutConfigurationSetSuppressionOptions -> Bool
(PutConfigurationSetSuppressionOptions
-> PutConfigurationSetSuppressionOptions -> Bool)
-> (PutConfigurationSetSuppressionOptions
-> PutConfigurationSetSuppressionOptions -> Bool)
-> Eq PutConfigurationSetSuppressionOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutConfigurationSetSuppressionOptions
-> PutConfigurationSetSuppressionOptions -> Bool
$c/= :: PutConfigurationSetSuppressionOptions
-> PutConfigurationSetSuppressionOptions -> Bool
== :: PutConfigurationSetSuppressionOptions
-> PutConfigurationSetSuppressionOptions -> Bool
$c== :: PutConfigurationSetSuppressionOptions
-> PutConfigurationSetSuppressionOptions -> Bool
Prelude.Eq, ReadPrec [PutConfigurationSetSuppressionOptions]
ReadPrec PutConfigurationSetSuppressionOptions
Int -> ReadS PutConfigurationSetSuppressionOptions
ReadS [PutConfigurationSetSuppressionOptions]
(Int -> ReadS PutConfigurationSetSuppressionOptions)
-> ReadS [PutConfigurationSetSuppressionOptions]
-> ReadPrec PutConfigurationSetSuppressionOptions
-> ReadPrec [PutConfigurationSetSuppressionOptions]
-> Read PutConfigurationSetSuppressionOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutConfigurationSetSuppressionOptions]
$creadListPrec :: ReadPrec [PutConfigurationSetSuppressionOptions]
readPrec :: ReadPrec PutConfigurationSetSuppressionOptions
$creadPrec :: ReadPrec PutConfigurationSetSuppressionOptions
readList :: ReadS [PutConfigurationSetSuppressionOptions]
$creadList :: ReadS [PutConfigurationSetSuppressionOptions]
readsPrec :: Int -> ReadS PutConfigurationSetSuppressionOptions
$creadsPrec :: Int -> ReadS PutConfigurationSetSuppressionOptions
Prelude.Read, Int -> PutConfigurationSetSuppressionOptions -> ShowS
[PutConfigurationSetSuppressionOptions] -> ShowS
PutConfigurationSetSuppressionOptions -> String
(Int -> PutConfigurationSetSuppressionOptions -> ShowS)
-> (PutConfigurationSetSuppressionOptions -> String)
-> ([PutConfigurationSetSuppressionOptions] -> ShowS)
-> Show PutConfigurationSetSuppressionOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutConfigurationSetSuppressionOptions] -> ShowS
$cshowList :: [PutConfigurationSetSuppressionOptions] -> ShowS
show :: PutConfigurationSetSuppressionOptions -> String
$cshow :: PutConfigurationSetSuppressionOptions -> String
showsPrec :: Int -> PutConfigurationSetSuppressionOptions -> ShowS
$cshowsPrec :: Int -> PutConfigurationSetSuppressionOptions -> ShowS
Prelude.Show, (forall x.
PutConfigurationSetSuppressionOptions
-> Rep PutConfigurationSetSuppressionOptions x)
-> (forall x.
Rep PutConfigurationSetSuppressionOptions x
-> PutConfigurationSetSuppressionOptions)
-> Generic PutConfigurationSetSuppressionOptions
forall x.
Rep PutConfigurationSetSuppressionOptions x
-> PutConfigurationSetSuppressionOptions
forall x.
PutConfigurationSetSuppressionOptions
-> Rep PutConfigurationSetSuppressionOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutConfigurationSetSuppressionOptions x
-> PutConfigurationSetSuppressionOptions
$cfrom :: forall x.
PutConfigurationSetSuppressionOptions
-> Rep PutConfigurationSetSuppressionOptions x
Prelude.Generic)
newPutConfigurationSetSuppressionOptions ::
Prelude.Text ->
PutConfigurationSetSuppressionOptions
newPutConfigurationSetSuppressionOptions :: Text -> PutConfigurationSetSuppressionOptions
newPutConfigurationSetSuppressionOptions
Text
pConfigurationSetName_ =
PutConfigurationSetSuppressionOptions' :: Maybe [SuppressionListReason]
-> Text -> PutConfigurationSetSuppressionOptions
PutConfigurationSetSuppressionOptions'
{ $sel:suppressedReasons:PutConfigurationSetSuppressionOptions' :: Maybe [SuppressionListReason]
suppressedReasons =
Maybe [SuppressionListReason]
forall a. Maybe a
Prelude.Nothing,
$sel:configurationSetName:PutConfigurationSetSuppressionOptions' :: Text
configurationSetName =
Text
pConfigurationSetName_
}
putConfigurationSetSuppressionOptions_suppressedReasons :: Lens.Lens' PutConfigurationSetSuppressionOptions (Prelude.Maybe [SuppressionListReason])
putConfigurationSetSuppressionOptions_suppressedReasons :: (Maybe [SuppressionListReason]
-> f (Maybe [SuppressionListReason]))
-> PutConfigurationSetSuppressionOptions
-> f PutConfigurationSetSuppressionOptions
putConfigurationSetSuppressionOptions_suppressedReasons = (PutConfigurationSetSuppressionOptions
-> Maybe [SuppressionListReason])
-> (PutConfigurationSetSuppressionOptions
-> Maybe [SuppressionListReason]
-> PutConfigurationSetSuppressionOptions)
-> Lens
PutConfigurationSetSuppressionOptions
PutConfigurationSetSuppressionOptions
(Maybe [SuppressionListReason])
(Maybe [SuppressionListReason])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConfigurationSetSuppressionOptions' {Maybe [SuppressionListReason]
suppressedReasons :: Maybe [SuppressionListReason]
$sel:suppressedReasons:PutConfigurationSetSuppressionOptions' :: PutConfigurationSetSuppressionOptions
-> Maybe [SuppressionListReason]
suppressedReasons} -> Maybe [SuppressionListReason]
suppressedReasons) (\s :: PutConfigurationSetSuppressionOptions
s@PutConfigurationSetSuppressionOptions' {} Maybe [SuppressionListReason]
a -> PutConfigurationSetSuppressionOptions
s {$sel:suppressedReasons:PutConfigurationSetSuppressionOptions' :: Maybe [SuppressionListReason]
suppressedReasons = Maybe [SuppressionListReason]
a} :: PutConfigurationSetSuppressionOptions) ((Maybe [SuppressionListReason]
-> f (Maybe [SuppressionListReason]))
-> PutConfigurationSetSuppressionOptions
-> f PutConfigurationSetSuppressionOptions)
-> ((Maybe [SuppressionListReason]
-> f (Maybe [SuppressionListReason]))
-> Maybe [SuppressionListReason]
-> f (Maybe [SuppressionListReason]))
-> (Maybe [SuppressionListReason]
-> f (Maybe [SuppressionListReason]))
-> PutConfigurationSetSuppressionOptions
-> f PutConfigurationSetSuppressionOptions
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
putConfigurationSetSuppressionOptions_configurationSetName :: Lens.Lens' PutConfigurationSetSuppressionOptions Prelude.Text
putConfigurationSetSuppressionOptions_configurationSetName :: (Text -> f Text)
-> PutConfigurationSetSuppressionOptions
-> f PutConfigurationSetSuppressionOptions
putConfigurationSetSuppressionOptions_configurationSetName = (PutConfigurationSetSuppressionOptions -> Text)
-> (PutConfigurationSetSuppressionOptions
-> Text -> PutConfigurationSetSuppressionOptions)
-> Lens
PutConfigurationSetSuppressionOptions
PutConfigurationSetSuppressionOptions
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConfigurationSetSuppressionOptions' {Text
configurationSetName :: Text
$sel:configurationSetName:PutConfigurationSetSuppressionOptions' :: PutConfigurationSetSuppressionOptions -> Text
configurationSetName} -> Text
configurationSetName) (\s :: PutConfigurationSetSuppressionOptions
s@PutConfigurationSetSuppressionOptions' {} Text
a -> PutConfigurationSetSuppressionOptions
s {$sel:configurationSetName:PutConfigurationSetSuppressionOptions' :: Text
configurationSetName = Text
a} :: PutConfigurationSetSuppressionOptions)
instance
Core.AWSRequest
PutConfigurationSetSuppressionOptions
where
type
AWSResponse
PutConfigurationSetSuppressionOptions =
PutConfigurationSetSuppressionOptionsResponse
request :: PutConfigurationSetSuppressionOptions
-> Request PutConfigurationSetSuppressionOptions
request = Service
-> PutConfigurationSetSuppressionOptions
-> Request PutConfigurationSetSuppressionOptions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutConfigurationSetSuppressionOptions
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse PutConfigurationSetSuppressionOptions)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either
String (AWSResponse PutConfigurationSetSuppressionOptions))
-> Logger
-> Service
-> Proxy PutConfigurationSetSuppressionOptions
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse PutConfigurationSetSuppressionOptions)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutConfigurationSetSuppressionOptionsResponse
PutConfigurationSetSuppressionOptionsResponse'
(Int -> PutConfigurationSetSuppressionOptionsResponse)
-> Either String Int
-> Either String PutConfigurationSetSuppressionOptionsResponse
forall (f :: * -> *) a b. Functor 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
PutConfigurationSetSuppressionOptions
instance
Prelude.NFData
PutConfigurationSetSuppressionOptions
instance
Core.ToHeaders
PutConfigurationSetSuppressionOptions
where
toHeaders :: PutConfigurationSetSuppressionOptions -> ResponseHeaders
toHeaders =
ResponseHeaders
-> PutConfigurationSetSuppressionOptions -> 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.ToJSON
PutConfigurationSetSuppressionOptions
where
toJSON :: PutConfigurationSetSuppressionOptions -> Value
toJSON PutConfigurationSetSuppressionOptions' {Maybe [SuppressionListReason]
Text
configurationSetName :: Text
suppressedReasons :: Maybe [SuppressionListReason]
$sel:configurationSetName:PutConfigurationSetSuppressionOptions' :: PutConfigurationSetSuppressionOptions -> Text
$sel:suppressedReasons:PutConfigurationSetSuppressionOptions' :: PutConfigurationSetSuppressionOptions
-> Maybe [SuppressionListReason]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SuppressedReasons" Text -> [SuppressionListReason] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([SuppressionListReason] -> Pair)
-> Maybe [SuppressionListReason] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SuppressionListReason]
suppressedReasons
]
)
instance
Core.ToPath
PutConfigurationSetSuppressionOptions
where
toPath :: PutConfigurationSetSuppressionOptions -> ByteString
toPath PutConfigurationSetSuppressionOptions' {Maybe [SuppressionListReason]
Text
configurationSetName :: Text
suppressedReasons :: Maybe [SuppressionListReason]
$sel:configurationSetName:PutConfigurationSetSuppressionOptions' :: PutConfigurationSetSuppressionOptions -> Text
$sel:suppressedReasons:PutConfigurationSetSuppressionOptions' :: PutConfigurationSetSuppressionOptions
-> Maybe [SuppressionListReason]
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v2/email/configuration-sets/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
configurationSetName,
ByteString
"/suppression-options"
]
instance
Core.ToQuery
PutConfigurationSetSuppressionOptions
where
toQuery :: PutConfigurationSetSuppressionOptions -> QueryString
toQuery = QueryString -> PutConfigurationSetSuppressionOptions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutConfigurationSetSuppressionOptionsResponse = PutConfigurationSetSuppressionOptionsResponse'
{
PutConfigurationSetSuppressionOptionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutConfigurationSetSuppressionOptionsResponse
-> PutConfigurationSetSuppressionOptionsResponse -> Bool
(PutConfigurationSetSuppressionOptionsResponse
-> PutConfigurationSetSuppressionOptionsResponse -> Bool)
-> (PutConfigurationSetSuppressionOptionsResponse
-> PutConfigurationSetSuppressionOptionsResponse -> Bool)
-> Eq PutConfigurationSetSuppressionOptionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutConfigurationSetSuppressionOptionsResponse
-> PutConfigurationSetSuppressionOptionsResponse -> Bool
$c/= :: PutConfigurationSetSuppressionOptionsResponse
-> PutConfigurationSetSuppressionOptionsResponse -> Bool
== :: PutConfigurationSetSuppressionOptionsResponse
-> PutConfigurationSetSuppressionOptionsResponse -> Bool
$c== :: PutConfigurationSetSuppressionOptionsResponse
-> PutConfigurationSetSuppressionOptionsResponse -> Bool
Prelude.Eq, ReadPrec [PutConfigurationSetSuppressionOptionsResponse]
ReadPrec PutConfigurationSetSuppressionOptionsResponse
Int -> ReadS PutConfigurationSetSuppressionOptionsResponse
ReadS [PutConfigurationSetSuppressionOptionsResponse]
(Int -> ReadS PutConfigurationSetSuppressionOptionsResponse)
-> ReadS [PutConfigurationSetSuppressionOptionsResponse]
-> ReadPrec PutConfigurationSetSuppressionOptionsResponse
-> ReadPrec [PutConfigurationSetSuppressionOptionsResponse]
-> Read PutConfigurationSetSuppressionOptionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutConfigurationSetSuppressionOptionsResponse]
$creadListPrec :: ReadPrec [PutConfigurationSetSuppressionOptionsResponse]
readPrec :: ReadPrec PutConfigurationSetSuppressionOptionsResponse
$creadPrec :: ReadPrec PutConfigurationSetSuppressionOptionsResponse
readList :: ReadS [PutConfigurationSetSuppressionOptionsResponse]
$creadList :: ReadS [PutConfigurationSetSuppressionOptionsResponse]
readsPrec :: Int -> ReadS PutConfigurationSetSuppressionOptionsResponse
$creadsPrec :: Int -> ReadS PutConfigurationSetSuppressionOptionsResponse
Prelude.Read, Int -> PutConfigurationSetSuppressionOptionsResponse -> ShowS
[PutConfigurationSetSuppressionOptionsResponse] -> ShowS
PutConfigurationSetSuppressionOptionsResponse -> String
(Int -> PutConfigurationSetSuppressionOptionsResponse -> ShowS)
-> (PutConfigurationSetSuppressionOptionsResponse -> String)
-> ([PutConfigurationSetSuppressionOptionsResponse] -> ShowS)
-> Show PutConfigurationSetSuppressionOptionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutConfigurationSetSuppressionOptionsResponse] -> ShowS
$cshowList :: [PutConfigurationSetSuppressionOptionsResponse] -> ShowS
show :: PutConfigurationSetSuppressionOptionsResponse -> String
$cshow :: PutConfigurationSetSuppressionOptionsResponse -> String
showsPrec :: Int -> PutConfigurationSetSuppressionOptionsResponse -> ShowS
$cshowsPrec :: Int -> PutConfigurationSetSuppressionOptionsResponse -> ShowS
Prelude.Show, (forall x.
PutConfigurationSetSuppressionOptionsResponse
-> Rep PutConfigurationSetSuppressionOptionsResponse x)
-> (forall x.
Rep PutConfigurationSetSuppressionOptionsResponse x
-> PutConfigurationSetSuppressionOptionsResponse)
-> Generic PutConfigurationSetSuppressionOptionsResponse
forall x.
Rep PutConfigurationSetSuppressionOptionsResponse x
-> PutConfigurationSetSuppressionOptionsResponse
forall x.
PutConfigurationSetSuppressionOptionsResponse
-> Rep PutConfigurationSetSuppressionOptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutConfigurationSetSuppressionOptionsResponse x
-> PutConfigurationSetSuppressionOptionsResponse
$cfrom :: forall x.
PutConfigurationSetSuppressionOptionsResponse
-> Rep PutConfigurationSetSuppressionOptionsResponse x
Prelude.Generic)
newPutConfigurationSetSuppressionOptionsResponse ::
Prelude.Int ->
PutConfigurationSetSuppressionOptionsResponse
newPutConfigurationSetSuppressionOptionsResponse :: Int -> PutConfigurationSetSuppressionOptionsResponse
newPutConfigurationSetSuppressionOptionsResponse
Int
pHttpStatus_ =
PutConfigurationSetSuppressionOptionsResponse' :: Int -> PutConfigurationSetSuppressionOptionsResponse
PutConfigurationSetSuppressionOptionsResponse'
{ $sel:httpStatus:PutConfigurationSetSuppressionOptionsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putConfigurationSetSuppressionOptionsResponse_httpStatus :: Lens.Lens' PutConfigurationSetSuppressionOptionsResponse Prelude.Int
putConfigurationSetSuppressionOptionsResponse_httpStatus :: (Int -> f Int)
-> PutConfigurationSetSuppressionOptionsResponse
-> f PutConfigurationSetSuppressionOptionsResponse
putConfigurationSetSuppressionOptionsResponse_httpStatus = (PutConfigurationSetSuppressionOptionsResponse -> Int)
-> (PutConfigurationSetSuppressionOptionsResponse
-> Int -> PutConfigurationSetSuppressionOptionsResponse)
-> Lens
PutConfigurationSetSuppressionOptionsResponse
PutConfigurationSetSuppressionOptionsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConfigurationSetSuppressionOptionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutConfigurationSetSuppressionOptionsResponse' :: PutConfigurationSetSuppressionOptionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutConfigurationSetSuppressionOptionsResponse
s@PutConfigurationSetSuppressionOptionsResponse' {} Int
a -> PutConfigurationSetSuppressionOptionsResponse
s {$sel:httpStatus:PutConfigurationSetSuppressionOptionsResponse' :: Int
httpStatus = Int
a} :: PutConfigurationSetSuppressionOptionsResponse)
instance
Prelude.NFData
PutConfigurationSetSuppressionOptionsResponse