{-# 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.GetSuppressedDestination
(
GetSuppressedDestination (..),
newGetSuppressedDestination,
getSuppressedDestination_emailAddress,
GetSuppressedDestinationResponse (..),
newGetSuppressedDestinationResponse,
getSuppressedDestinationResponse_httpStatus,
getSuppressedDestinationResponse_suppressedDestination,
)
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 GetSuppressedDestination = GetSuppressedDestination'
{
GetSuppressedDestination -> Text
emailAddress :: Prelude.Text
}
deriving (GetSuppressedDestination -> GetSuppressedDestination -> Bool
(GetSuppressedDestination -> GetSuppressedDestination -> Bool)
-> (GetSuppressedDestination -> GetSuppressedDestination -> Bool)
-> Eq GetSuppressedDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSuppressedDestination -> GetSuppressedDestination -> Bool
$c/= :: GetSuppressedDestination -> GetSuppressedDestination -> Bool
== :: GetSuppressedDestination -> GetSuppressedDestination -> Bool
$c== :: GetSuppressedDestination -> GetSuppressedDestination -> Bool
Prelude.Eq, ReadPrec [GetSuppressedDestination]
ReadPrec GetSuppressedDestination
Int -> ReadS GetSuppressedDestination
ReadS [GetSuppressedDestination]
(Int -> ReadS GetSuppressedDestination)
-> ReadS [GetSuppressedDestination]
-> ReadPrec GetSuppressedDestination
-> ReadPrec [GetSuppressedDestination]
-> Read GetSuppressedDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSuppressedDestination]
$creadListPrec :: ReadPrec [GetSuppressedDestination]
readPrec :: ReadPrec GetSuppressedDestination
$creadPrec :: ReadPrec GetSuppressedDestination
readList :: ReadS [GetSuppressedDestination]
$creadList :: ReadS [GetSuppressedDestination]
readsPrec :: Int -> ReadS GetSuppressedDestination
$creadsPrec :: Int -> ReadS GetSuppressedDestination
Prelude.Read, Int -> GetSuppressedDestination -> ShowS
[GetSuppressedDestination] -> ShowS
GetSuppressedDestination -> String
(Int -> GetSuppressedDestination -> ShowS)
-> (GetSuppressedDestination -> String)
-> ([GetSuppressedDestination] -> ShowS)
-> Show GetSuppressedDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSuppressedDestination] -> ShowS
$cshowList :: [GetSuppressedDestination] -> ShowS
show :: GetSuppressedDestination -> String
$cshow :: GetSuppressedDestination -> String
showsPrec :: Int -> GetSuppressedDestination -> ShowS
$cshowsPrec :: Int -> GetSuppressedDestination -> ShowS
Prelude.Show, (forall x.
GetSuppressedDestination -> Rep GetSuppressedDestination x)
-> (forall x.
Rep GetSuppressedDestination x -> GetSuppressedDestination)
-> Generic GetSuppressedDestination
forall x.
Rep GetSuppressedDestination x -> GetSuppressedDestination
forall x.
GetSuppressedDestination -> Rep GetSuppressedDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSuppressedDestination x -> GetSuppressedDestination
$cfrom :: forall x.
GetSuppressedDestination -> Rep GetSuppressedDestination x
Prelude.Generic)
newGetSuppressedDestination ::
Prelude.Text ->
GetSuppressedDestination
newGetSuppressedDestination :: Text -> GetSuppressedDestination
newGetSuppressedDestination Text
pEmailAddress_ =
GetSuppressedDestination' :: Text -> GetSuppressedDestination
GetSuppressedDestination'
{ $sel:emailAddress:GetSuppressedDestination' :: Text
emailAddress =
Text
pEmailAddress_
}
getSuppressedDestination_emailAddress :: Lens.Lens' GetSuppressedDestination Prelude.Text
getSuppressedDestination_emailAddress :: (Text -> f Text)
-> GetSuppressedDestination -> f GetSuppressedDestination
getSuppressedDestination_emailAddress = (GetSuppressedDestination -> Text)
-> (GetSuppressedDestination -> Text -> GetSuppressedDestination)
-> Lens GetSuppressedDestination GetSuppressedDestination Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSuppressedDestination' {Text
emailAddress :: Text
$sel:emailAddress:GetSuppressedDestination' :: GetSuppressedDestination -> Text
emailAddress} -> Text
emailAddress) (\s :: GetSuppressedDestination
s@GetSuppressedDestination' {} Text
a -> GetSuppressedDestination
s {$sel:emailAddress:GetSuppressedDestination' :: Text
emailAddress = Text
a} :: GetSuppressedDestination)
instance Core.AWSRequest GetSuppressedDestination where
type
AWSResponse GetSuppressedDestination =
GetSuppressedDestinationResponse
request :: GetSuppressedDestination -> Request GetSuppressedDestination
request = Service
-> GetSuppressedDestination -> Request GetSuppressedDestination
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetSuppressedDestination
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSuppressedDestination)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetSuppressedDestination))
-> Logger
-> Service
-> Proxy GetSuppressedDestination
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSuppressedDestination)))
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 ->
Int -> SuppressedDestination -> GetSuppressedDestinationResponse
GetSuppressedDestinationResponse'
(Int -> SuppressedDestination -> GetSuppressedDestinationResponse)
-> Either String Int
-> Either
String (SuppressedDestination -> GetSuppressedDestinationResponse)
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))
Either
String (SuppressedDestination -> GetSuppressedDestinationResponse)
-> Either String SuppressedDestination
-> Either String GetSuppressedDestinationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String SuppressedDestination
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"SuppressedDestination")
)
instance Prelude.Hashable GetSuppressedDestination
instance Prelude.NFData GetSuppressedDestination
instance Core.ToHeaders GetSuppressedDestination where
toHeaders :: GetSuppressedDestination -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetSuppressedDestination -> 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 GetSuppressedDestination where
toPath :: GetSuppressedDestination -> ByteString
toPath GetSuppressedDestination' {Text
emailAddress :: Text
$sel:emailAddress:GetSuppressedDestination' :: GetSuppressedDestination -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v2/email/suppression/addresses/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
emailAddress
]
instance Core.ToQuery GetSuppressedDestination where
toQuery :: GetSuppressedDestination -> QueryString
toQuery = QueryString -> GetSuppressedDestination -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetSuppressedDestinationResponse = GetSuppressedDestinationResponse'
{
GetSuppressedDestinationResponse -> Int
httpStatus :: Prelude.Int,
GetSuppressedDestinationResponse -> SuppressedDestination
suppressedDestination :: SuppressedDestination
}
deriving (GetSuppressedDestinationResponse
-> GetSuppressedDestinationResponse -> Bool
(GetSuppressedDestinationResponse
-> GetSuppressedDestinationResponse -> Bool)
-> (GetSuppressedDestinationResponse
-> GetSuppressedDestinationResponse -> Bool)
-> Eq GetSuppressedDestinationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSuppressedDestinationResponse
-> GetSuppressedDestinationResponse -> Bool
$c/= :: GetSuppressedDestinationResponse
-> GetSuppressedDestinationResponse -> Bool
== :: GetSuppressedDestinationResponse
-> GetSuppressedDestinationResponse -> Bool
$c== :: GetSuppressedDestinationResponse
-> GetSuppressedDestinationResponse -> Bool
Prelude.Eq, ReadPrec [GetSuppressedDestinationResponse]
ReadPrec GetSuppressedDestinationResponse
Int -> ReadS GetSuppressedDestinationResponse
ReadS [GetSuppressedDestinationResponse]
(Int -> ReadS GetSuppressedDestinationResponse)
-> ReadS [GetSuppressedDestinationResponse]
-> ReadPrec GetSuppressedDestinationResponse
-> ReadPrec [GetSuppressedDestinationResponse]
-> Read GetSuppressedDestinationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSuppressedDestinationResponse]
$creadListPrec :: ReadPrec [GetSuppressedDestinationResponse]
readPrec :: ReadPrec GetSuppressedDestinationResponse
$creadPrec :: ReadPrec GetSuppressedDestinationResponse
readList :: ReadS [GetSuppressedDestinationResponse]
$creadList :: ReadS [GetSuppressedDestinationResponse]
readsPrec :: Int -> ReadS GetSuppressedDestinationResponse
$creadsPrec :: Int -> ReadS GetSuppressedDestinationResponse
Prelude.Read, Int -> GetSuppressedDestinationResponse -> ShowS
[GetSuppressedDestinationResponse] -> ShowS
GetSuppressedDestinationResponse -> String
(Int -> GetSuppressedDestinationResponse -> ShowS)
-> (GetSuppressedDestinationResponse -> String)
-> ([GetSuppressedDestinationResponse] -> ShowS)
-> Show GetSuppressedDestinationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSuppressedDestinationResponse] -> ShowS
$cshowList :: [GetSuppressedDestinationResponse] -> ShowS
show :: GetSuppressedDestinationResponse -> String
$cshow :: GetSuppressedDestinationResponse -> String
showsPrec :: Int -> GetSuppressedDestinationResponse -> ShowS
$cshowsPrec :: Int -> GetSuppressedDestinationResponse -> ShowS
Prelude.Show, (forall x.
GetSuppressedDestinationResponse
-> Rep GetSuppressedDestinationResponse x)
-> (forall x.
Rep GetSuppressedDestinationResponse x
-> GetSuppressedDestinationResponse)
-> Generic GetSuppressedDestinationResponse
forall x.
Rep GetSuppressedDestinationResponse x
-> GetSuppressedDestinationResponse
forall x.
GetSuppressedDestinationResponse
-> Rep GetSuppressedDestinationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSuppressedDestinationResponse x
-> GetSuppressedDestinationResponse
$cfrom :: forall x.
GetSuppressedDestinationResponse
-> Rep GetSuppressedDestinationResponse x
Prelude.Generic)
newGetSuppressedDestinationResponse ::
Prelude.Int ->
SuppressedDestination ->
GetSuppressedDestinationResponse
newGetSuppressedDestinationResponse :: Int -> SuppressedDestination -> GetSuppressedDestinationResponse
newGetSuppressedDestinationResponse
Int
pHttpStatus_
SuppressedDestination
pSuppressedDestination_ =
GetSuppressedDestinationResponse' :: Int -> SuppressedDestination -> GetSuppressedDestinationResponse
GetSuppressedDestinationResponse'
{ $sel:httpStatus:GetSuppressedDestinationResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:suppressedDestination:GetSuppressedDestinationResponse' :: SuppressedDestination
suppressedDestination =
SuppressedDestination
pSuppressedDestination_
}
getSuppressedDestinationResponse_httpStatus :: Lens.Lens' GetSuppressedDestinationResponse Prelude.Int
getSuppressedDestinationResponse_httpStatus :: (Int -> f Int)
-> GetSuppressedDestinationResponse
-> f GetSuppressedDestinationResponse
getSuppressedDestinationResponse_httpStatus = (GetSuppressedDestinationResponse -> Int)
-> (GetSuppressedDestinationResponse
-> Int -> GetSuppressedDestinationResponse)
-> Lens
GetSuppressedDestinationResponse
GetSuppressedDestinationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSuppressedDestinationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSuppressedDestinationResponse' :: GetSuppressedDestinationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSuppressedDestinationResponse
s@GetSuppressedDestinationResponse' {} Int
a -> GetSuppressedDestinationResponse
s {$sel:httpStatus:GetSuppressedDestinationResponse' :: Int
httpStatus = Int
a} :: GetSuppressedDestinationResponse)
getSuppressedDestinationResponse_suppressedDestination :: Lens.Lens' GetSuppressedDestinationResponse SuppressedDestination
getSuppressedDestinationResponse_suppressedDestination :: (SuppressedDestination -> f SuppressedDestination)
-> GetSuppressedDestinationResponse
-> f GetSuppressedDestinationResponse
getSuppressedDestinationResponse_suppressedDestination = (GetSuppressedDestinationResponse -> SuppressedDestination)
-> (GetSuppressedDestinationResponse
-> SuppressedDestination -> GetSuppressedDestinationResponse)
-> Lens
GetSuppressedDestinationResponse
GetSuppressedDestinationResponse
SuppressedDestination
SuppressedDestination
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSuppressedDestinationResponse' {SuppressedDestination
suppressedDestination :: SuppressedDestination
$sel:suppressedDestination:GetSuppressedDestinationResponse' :: GetSuppressedDestinationResponse -> SuppressedDestination
suppressedDestination} -> SuppressedDestination
suppressedDestination) (\s :: GetSuppressedDestinationResponse
s@GetSuppressedDestinationResponse' {} SuppressedDestination
a -> GetSuppressedDestinationResponse
s {$sel:suppressedDestination:GetSuppressedDestinationResponse' :: SuppressedDestination
suppressedDestination = SuppressedDestination
a} :: GetSuppressedDestinationResponse)
instance
Prelude.NFData
GetSuppressedDestinationResponse