{-# 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.PinpointEmail.DeleteEmailIdentity
(
DeleteEmailIdentity (..),
newDeleteEmailIdentity,
deleteEmailIdentity_emailIdentity,
DeleteEmailIdentityResponse (..),
newDeleteEmailIdentityResponse,
deleteEmailIdentityResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.PinpointEmail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteEmailIdentity = DeleteEmailIdentity'
{
DeleteEmailIdentity -> Text
emailIdentity :: Prelude.Text
}
deriving (DeleteEmailIdentity -> DeleteEmailIdentity -> Bool
(DeleteEmailIdentity -> DeleteEmailIdentity -> Bool)
-> (DeleteEmailIdentity -> DeleteEmailIdentity -> Bool)
-> Eq DeleteEmailIdentity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteEmailIdentity -> DeleteEmailIdentity -> Bool
$c/= :: DeleteEmailIdentity -> DeleteEmailIdentity -> Bool
== :: DeleteEmailIdentity -> DeleteEmailIdentity -> Bool
$c== :: DeleteEmailIdentity -> DeleteEmailIdentity -> Bool
Prelude.Eq, ReadPrec [DeleteEmailIdentity]
ReadPrec DeleteEmailIdentity
Int -> ReadS DeleteEmailIdentity
ReadS [DeleteEmailIdentity]
(Int -> ReadS DeleteEmailIdentity)
-> ReadS [DeleteEmailIdentity]
-> ReadPrec DeleteEmailIdentity
-> ReadPrec [DeleteEmailIdentity]
-> Read DeleteEmailIdentity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteEmailIdentity]
$creadListPrec :: ReadPrec [DeleteEmailIdentity]
readPrec :: ReadPrec DeleteEmailIdentity
$creadPrec :: ReadPrec DeleteEmailIdentity
readList :: ReadS [DeleteEmailIdentity]
$creadList :: ReadS [DeleteEmailIdentity]
readsPrec :: Int -> ReadS DeleteEmailIdentity
$creadsPrec :: Int -> ReadS DeleteEmailIdentity
Prelude.Read, Int -> DeleteEmailIdentity -> ShowS
[DeleteEmailIdentity] -> ShowS
DeleteEmailIdentity -> String
(Int -> DeleteEmailIdentity -> ShowS)
-> (DeleteEmailIdentity -> String)
-> ([DeleteEmailIdentity] -> ShowS)
-> Show DeleteEmailIdentity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteEmailIdentity] -> ShowS
$cshowList :: [DeleteEmailIdentity] -> ShowS
show :: DeleteEmailIdentity -> String
$cshow :: DeleteEmailIdentity -> String
showsPrec :: Int -> DeleteEmailIdentity -> ShowS
$cshowsPrec :: Int -> DeleteEmailIdentity -> ShowS
Prelude.Show, (forall x. DeleteEmailIdentity -> Rep DeleteEmailIdentity x)
-> (forall x. Rep DeleteEmailIdentity x -> DeleteEmailIdentity)
-> Generic DeleteEmailIdentity
forall x. Rep DeleteEmailIdentity x -> DeleteEmailIdentity
forall x. DeleteEmailIdentity -> Rep DeleteEmailIdentity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteEmailIdentity x -> DeleteEmailIdentity
$cfrom :: forall x. DeleteEmailIdentity -> Rep DeleteEmailIdentity x
Prelude.Generic)
newDeleteEmailIdentity ::
Prelude.Text ->
DeleteEmailIdentity
newDeleteEmailIdentity :: Text -> DeleteEmailIdentity
newDeleteEmailIdentity Text
pEmailIdentity_ =
DeleteEmailIdentity' :: Text -> DeleteEmailIdentity
DeleteEmailIdentity'
{ $sel:emailIdentity:DeleteEmailIdentity' :: Text
emailIdentity =
Text
pEmailIdentity_
}
deleteEmailIdentity_emailIdentity :: Lens.Lens' DeleteEmailIdentity Prelude.Text
deleteEmailIdentity_emailIdentity :: (Text -> f Text) -> DeleteEmailIdentity -> f DeleteEmailIdentity
deleteEmailIdentity_emailIdentity = (DeleteEmailIdentity -> Text)
-> (DeleteEmailIdentity -> Text -> DeleteEmailIdentity)
-> Lens DeleteEmailIdentity DeleteEmailIdentity Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEmailIdentity' {Text
emailIdentity :: Text
$sel:emailIdentity:DeleteEmailIdentity' :: DeleteEmailIdentity -> Text
emailIdentity} -> Text
emailIdentity) (\s :: DeleteEmailIdentity
s@DeleteEmailIdentity' {} Text
a -> DeleteEmailIdentity
s {$sel:emailIdentity:DeleteEmailIdentity' :: Text
emailIdentity = Text
a} :: DeleteEmailIdentity)
instance Core.AWSRequest DeleteEmailIdentity where
type
AWSResponse DeleteEmailIdentity =
DeleteEmailIdentityResponse
request :: DeleteEmailIdentity -> Request DeleteEmailIdentity
request = Service -> DeleteEmailIdentity -> Request DeleteEmailIdentity
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteEmailIdentity
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteEmailIdentity)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteEmailIdentity))
-> Logger
-> Service
-> Proxy DeleteEmailIdentity
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteEmailIdentity)))
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 -> DeleteEmailIdentityResponse
DeleteEmailIdentityResponse'
(Int -> DeleteEmailIdentityResponse)
-> Either String Int -> Either String DeleteEmailIdentityResponse
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 DeleteEmailIdentity
instance Prelude.NFData DeleteEmailIdentity
instance Core.ToHeaders DeleteEmailIdentity where
toHeaders :: DeleteEmailIdentity -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteEmailIdentity -> 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 DeleteEmailIdentity where
toPath :: DeleteEmailIdentity -> ByteString
toPath DeleteEmailIdentity' {Text
emailIdentity :: Text
$sel:emailIdentity:DeleteEmailIdentity' :: DeleteEmailIdentity -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v1/email/identities/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
emailIdentity]
instance Core.ToQuery DeleteEmailIdentity where
toQuery :: DeleteEmailIdentity -> QueryString
toQuery = QueryString -> DeleteEmailIdentity -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteEmailIdentityResponse = DeleteEmailIdentityResponse'
{
DeleteEmailIdentityResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteEmailIdentityResponse -> DeleteEmailIdentityResponse -> Bool
(DeleteEmailIdentityResponse
-> DeleteEmailIdentityResponse -> Bool)
-> (DeleteEmailIdentityResponse
-> DeleteEmailIdentityResponse -> Bool)
-> Eq DeleteEmailIdentityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteEmailIdentityResponse -> DeleteEmailIdentityResponse -> Bool
$c/= :: DeleteEmailIdentityResponse -> DeleteEmailIdentityResponse -> Bool
== :: DeleteEmailIdentityResponse -> DeleteEmailIdentityResponse -> Bool
$c== :: DeleteEmailIdentityResponse -> DeleteEmailIdentityResponse -> Bool
Prelude.Eq, ReadPrec [DeleteEmailIdentityResponse]
ReadPrec DeleteEmailIdentityResponse
Int -> ReadS DeleteEmailIdentityResponse
ReadS [DeleteEmailIdentityResponse]
(Int -> ReadS DeleteEmailIdentityResponse)
-> ReadS [DeleteEmailIdentityResponse]
-> ReadPrec DeleteEmailIdentityResponse
-> ReadPrec [DeleteEmailIdentityResponse]
-> Read DeleteEmailIdentityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteEmailIdentityResponse]
$creadListPrec :: ReadPrec [DeleteEmailIdentityResponse]
readPrec :: ReadPrec DeleteEmailIdentityResponse
$creadPrec :: ReadPrec DeleteEmailIdentityResponse
readList :: ReadS [DeleteEmailIdentityResponse]
$creadList :: ReadS [DeleteEmailIdentityResponse]
readsPrec :: Int -> ReadS DeleteEmailIdentityResponse
$creadsPrec :: Int -> ReadS DeleteEmailIdentityResponse
Prelude.Read, Int -> DeleteEmailIdentityResponse -> ShowS
[DeleteEmailIdentityResponse] -> ShowS
DeleteEmailIdentityResponse -> String
(Int -> DeleteEmailIdentityResponse -> ShowS)
-> (DeleteEmailIdentityResponse -> String)
-> ([DeleteEmailIdentityResponse] -> ShowS)
-> Show DeleteEmailIdentityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteEmailIdentityResponse] -> ShowS
$cshowList :: [DeleteEmailIdentityResponse] -> ShowS
show :: DeleteEmailIdentityResponse -> String
$cshow :: DeleteEmailIdentityResponse -> String
showsPrec :: Int -> DeleteEmailIdentityResponse -> ShowS
$cshowsPrec :: Int -> DeleteEmailIdentityResponse -> ShowS
Prelude.Show, (forall x.
DeleteEmailIdentityResponse -> Rep DeleteEmailIdentityResponse x)
-> (forall x.
Rep DeleteEmailIdentityResponse x -> DeleteEmailIdentityResponse)
-> Generic DeleteEmailIdentityResponse
forall x.
Rep DeleteEmailIdentityResponse x -> DeleteEmailIdentityResponse
forall x.
DeleteEmailIdentityResponse -> Rep DeleteEmailIdentityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteEmailIdentityResponse x -> DeleteEmailIdentityResponse
$cfrom :: forall x.
DeleteEmailIdentityResponse -> Rep DeleteEmailIdentityResponse x
Prelude.Generic)
newDeleteEmailIdentityResponse ::
Prelude.Int ->
DeleteEmailIdentityResponse
newDeleteEmailIdentityResponse :: Int -> DeleteEmailIdentityResponse
newDeleteEmailIdentityResponse Int
pHttpStatus_ =
DeleteEmailIdentityResponse' :: Int -> DeleteEmailIdentityResponse
DeleteEmailIdentityResponse'
{ $sel:httpStatus:DeleteEmailIdentityResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteEmailIdentityResponse_httpStatus :: Lens.Lens' DeleteEmailIdentityResponse Prelude.Int
deleteEmailIdentityResponse_httpStatus :: (Int -> f Int)
-> DeleteEmailIdentityResponse -> f DeleteEmailIdentityResponse
deleteEmailIdentityResponse_httpStatus = (DeleteEmailIdentityResponse -> Int)
-> (DeleteEmailIdentityResponse
-> Int -> DeleteEmailIdentityResponse)
-> Lens
DeleteEmailIdentityResponse DeleteEmailIdentityResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEmailIdentityResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteEmailIdentityResponse' :: DeleteEmailIdentityResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteEmailIdentityResponse
s@DeleteEmailIdentityResponse' {} Int
a -> DeleteEmailIdentityResponse
s {$sel:httpStatus:DeleteEmailIdentityResponse' :: Int
httpStatus = Int
a} :: DeleteEmailIdentityResponse)
instance Prelude.NFData DeleteEmailIdentityResponse