{-# 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.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 DeleteEmailIdentityPolicy = DeleteEmailIdentityPolicy'
{
DeleteEmailIdentityPolicy -> Text
emailIdentity :: Prelude.Text,
DeleteEmailIdentityPolicy -> Text
policyName :: Prelude.Text
}
deriving (DeleteEmailIdentityPolicy -> DeleteEmailIdentityPolicy -> Bool
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]
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
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.
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'
{ $sel:emailIdentity:DeleteEmailIdentityPolicy' :: Text
emailIdentity =
Text
pEmailIdentity_,
$sel:policyName:DeleteEmailIdentityPolicy' :: Text
policyName = Text
pPolicyName_
}
deleteEmailIdentityPolicy_emailIdentity :: Lens.Lens' DeleteEmailIdentityPolicy Prelude.Text
deleteEmailIdentityPolicy_emailIdentity :: Lens' DeleteEmailIdentityPolicy Text
deleteEmailIdentityPolicy_emailIdentity = 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 :: Lens' DeleteEmailIdentityPolicy Text
deleteEmailIdentityPolicy_policyName = 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 :: (Service -> Service)
-> DeleteEmailIdentityPolicy -> Request DeleteEmailIdentityPolicy
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteEmailIdentityPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteEmailIdentityPolicy)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteEmailIdentityPolicyResponse
DeleteEmailIdentityPolicyResponse'
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))
)
instance Prelude.Hashable DeleteEmailIdentityPolicy where
hashWithSalt :: Int -> DeleteEmailIdentityPolicy -> Int
hashWithSalt Int
_salt DeleteEmailIdentityPolicy' {Text
policyName :: Text
emailIdentity :: Text
$sel:policyName:DeleteEmailIdentityPolicy' :: DeleteEmailIdentityPolicy -> Text
$sel:emailIdentity:DeleteEmailIdentityPolicy' :: DeleteEmailIdentityPolicy -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
emailIdentity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
policyName
instance Prelude.NFData DeleteEmailIdentityPolicy where
rnf :: DeleteEmailIdentityPolicy -> ()
rnf DeleteEmailIdentityPolicy' {Text
policyName :: Text
emailIdentity :: Text
$sel:policyName:DeleteEmailIdentityPolicy' :: DeleteEmailIdentityPolicy -> Text
$sel:emailIdentity:DeleteEmailIdentityPolicy' :: DeleteEmailIdentityPolicy -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
emailIdentity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
policyName
instance Data.ToHeaders DeleteEmailIdentityPolicy where
toHeaders :: DeleteEmailIdentityPolicy -> 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 DeleteEmailIdentityPolicy where
toPath :: DeleteEmailIdentityPolicy -> ByteString
toPath DeleteEmailIdentityPolicy' {Text
policyName :: Text
emailIdentity :: Text
$sel:policyName:DeleteEmailIdentityPolicy' :: DeleteEmailIdentityPolicy -> Text
$sel:emailIdentity:DeleteEmailIdentityPolicy' :: DeleteEmailIdentityPolicy -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v2/email/identities/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
emailIdentity,
ByteString
"/policies/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
policyName
]
instance Data.ToQuery DeleteEmailIdentityPolicy where
toQuery :: DeleteEmailIdentityPolicy -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteEmailIdentityPolicyResponse = DeleteEmailIdentityPolicyResponse'
{
DeleteEmailIdentityPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteEmailIdentityPolicyResponse
-> DeleteEmailIdentityPolicyResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:DeleteEmailIdentityPolicyResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteEmailIdentityPolicyResponse_httpStatus :: Lens.Lens' DeleteEmailIdentityPolicyResponse Prelude.Int
deleteEmailIdentityPolicyResponse_httpStatus :: Lens' DeleteEmailIdentityPolicyResponse Int
deleteEmailIdentityPolicyResponse_httpStatus = 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
where
rnf :: DeleteEmailIdentityPolicyResponse -> ()
rnf DeleteEmailIdentityPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteEmailIdentityPolicyResponse' :: DeleteEmailIdentityPolicyResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus