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