{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $sel:emailAddress:GetSuppressedDestination' :: Text
emailAddress =
Text
pEmailAddress_
}
getSuppressedDestination_emailAddress :: Lens.Lens' GetSuppressedDestination Prelude.Text
getSuppressedDestination_emailAddress :: Lens' GetSuppressedDestination Text
getSuppressedDestination_emailAddress = 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 :: (Service -> Service)
-> GetSuppressedDestination -> Request GetSuppressedDestination
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetSuppressedDestination
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSuppressedDestination)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> SuppressedDestination -> GetSuppressedDestinationResponse
GetSuppressedDestinationResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"SuppressedDestination")
)
instance Prelude.Hashable GetSuppressedDestination where
hashWithSalt :: Int -> GetSuppressedDestination -> Int
hashWithSalt Int
_salt GetSuppressedDestination' {Text
emailAddress :: Text
$sel:emailAddress:GetSuppressedDestination' :: GetSuppressedDestination -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
emailAddress
instance Prelude.NFData GetSuppressedDestination where
rnf :: GetSuppressedDestination -> ()
rnf GetSuppressedDestination' {Text
emailAddress :: Text
$sel:emailAddress:GetSuppressedDestination' :: GetSuppressedDestination -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
emailAddress
instance Data.ToHeaders GetSuppressedDestination where
toHeaders :: GetSuppressedDestination -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath GetSuppressedDestination where
toPath :: GetSuppressedDestination -> ByteString
toPath GetSuppressedDestination' {Text
emailAddress :: Text
$sel:emailAddress:GetSuppressedDestination' :: GetSuppressedDestination -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v2/email/suppression/addresses/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
emailAddress
]
instance Data.ToQuery GetSuppressedDestination where
toQuery :: GetSuppressedDestination -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetSuppressedDestinationResponse = GetSuppressedDestinationResponse'
{
GetSuppressedDestinationResponse -> Int
httpStatus :: Prelude.Int,
GetSuppressedDestinationResponse -> SuppressedDestination
suppressedDestination :: SuppressedDestination
}
deriving (GetSuppressedDestinationResponse
-> GetSuppressedDestinationResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:GetSuppressedDestinationResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:suppressedDestination:GetSuppressedDestinationResponse' :: SuppressedDestination
suppressedDestination =
SuppressedDestination
pSuppressedDestination_
}
getSuppressedDestinationResponse_httpStatus :: Lens.Lens' GetSuppressedDestinationResponse Prelude.Int
getSuppressedDestinationResponse_httpStatus :: Lens' GetSuppressedDestinationResponse Int
getSuppressedDestinationResponse_httpStatus = 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 :: Lens' GetSuppressedDestinationResponse SuppressedDestination
getSuppressedDestinationResponse_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
where
rnf :: GetSuppressedDestinationResponse -> ()
rnf GetSuppressedDestinationResponse' {Int
SuppressedDestination
suppressedDestination :: SuppressedDestination
httpStatus :: Int
$sel:suppressedDestination:GetSuppressedDestinationResponse' :: GetSuppressedDestinationResponse -> SuppressedDestination
$sel:httpStatus:GetSuppressedDestinationResponse' :: GetSuppressedDestinationResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SuppressedDestination
suppressedDestination