{-# 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.SES.DeleteIdentityPolicy
(
DeleteIdentityPolicy (..),
newDeleteIdentityPolicy,
deleteIdentityPolicy_identity,
deleteIdentityPolicy_policyName,
DeleteIdentityPolicyResponse (..),
newDeleteIdentityPolicyResponse,
deleteIdentityPolicyResponse_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.SES.Types
data DeleteIdentityPolicy = DeleteIdentityPolicy'
{
DeleteIdentityPolicy -> Text
identity :: Prelude.Text,
DeleteIdentityPolicy -> Text
policyName :: Prelude.Text
}
deriving (DeleteIdentityPolicy -> DeleteIdentityPolicy -> Bool
(DeleteIdentityPolicy -> DeleteIdentityPolicy -> Bool)
-> (DeleteIdentityPolicy -> DeleteIdentityPolicy -> Bool)
-> Eq DeleteIdentityPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteIdentityPolicy -> DeleteIdentityPolicy -> Bool
$c/= :: DeleteIdentityPolicy -> DeleteIdentityPolicy -> Bool
== :: DeleteIdentityPolicy -> DeleteIdentityPolicy -> Bool
$c== :: DeleteIdentityPolicy -> DeleteIdentityPolicy -> Bool
Prelude.Eq, ReadPrec [DeleteIdentityPolicy]
ReadPrec DeleteIdentityPolicy
Int -> ReadS DeleteIdentityPolicy
ReadS [DeleteIdentityPolicy]
(Int -> ReadS DeleteIdentityPolicy)
-> ReadS [DeleteIdentityPolicy]
-> ReadPrec DeleteIdentityPolicy
-> ReadPrec [DeleteIdentityPolicy]
-> Read DeleteIdentityPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteIdentityPolicy]
$creadListPrec :: ReadPrec [DeleteIdentityPolicy]
readPrec :: ReadPrec DeleteIdentityPolicy
$creadPrec :: ReadPrec DeleteIdentityPolicy
readList :: ReadS [DeleteIdentityPolicy]
$creadList :: ReadS [DeleteIdentityPolicy]
readsPrec :: Int -> ReadS DeleteIdentityPolicy
$creadsPrec :: Int -> ReadS DeleteIdentityPolicy
Prelude.Read, Int -> DeleteIdentityPolicy -> ShowS
[DeleteIdentityPolicy] -> ShowS
DeleteIdentityPolicy -> String
(Int -> DeleteIdentityPolicy -> ShowS)
-> (DeleteIdentityPolicy -> String)
-> ([DeleteIdentityPolicy] -> ShowS)
-> Show DeleteIdentityPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteIdentityPolicy] -> ShowS
$cshowList :: [DeleteIdentityPolicy] -> ShowS
show :: DeleteIdentityPolicy -> String
$cshow :: DeleteIdentityPolicy -> String
showsPrec :: Int -> DeleteIdentityPolicy -> ShowS
$cshowsPrec :: Int -> DeleteIdentityPolicy -> ShowS
Prelude.Show, (forall x. DeleteIdentityPolicy -> Rep DeleteIdentityPolicy x)
-> (forall x. Rep DeleteIdentityPolicy x -> DeleteIdentityPolicy)
-> Generic DeleteIdentityPolicy
forall x. Rep DeleteIdentityPolicy x -> DeleteIdentityPolicy
forall x. DeleteIdentityPolicy -> Rep DeleteIdentityPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteIdentityPolicy x -> DeleteIdentityPolicy
$cfrom :: forall x. DeleteIdentityPolicy -> Rep DeleteIdentityPolicy x
Prelude.Generic)
newDeleteIdentityPolicy ::
Prelude.Text ->
Prelude.Text ->
DeleteIdentityPolicy
newDeleteIdentityPolicy :: Text -> Text -> DeleteIdentityPolicy
newDeleteIdentityPolicy Text
pIdentity_ Text
pPolicyName_ =
DeleteIdentityPolicy' :: Text -> Text -> DeleteIdentityPolicy
DeleteIdentityPolicy'
{ $sel:identity:DeleteIdentityPolicy' :: Text
identity = Text
pIdentity_,
$sel:policyName:DeleteIdentityPolicy' :: Text
policyName = Text
pPolicyName_
}
deleteIdentityPolicy_identity :: Lens.Lens' DeleteIdentityPolicy Prelude.Text
deleteIdentityPolicy_identity :: (Text -> f Text) -> DeleteIdentityPolicy -> f DeleteIdentityPolicy
deleteIdentityPolicy_identity = (DeleteIdentityPolicy -> Text)
-> (DeleteIdentityPolicy -> Text -> DeleteIdentityPolicy)
-> Lens DeleteIdentityPolicy DeleteIdentityPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteIdentityPolicy' {Text
identity :: Text
$sel:identity:DeleteIdentityPolicy' :: DeleteIdentityPolicy -> Text
identity} -> Text
identity) (\s :: DeleteIdentityPolicy
s@DeleteIdentityPolicy' {} Text
a -> DeleteIdentityPolicy
s {$sel:identity:DeleteIdentityPolicy' :: Text
identity = Text
a} :: DeleteIdentityPolicy)
deleteIdentityPolicy_policyName :: Lens.Lens' DeleteIdentityPolicy Prelude.Text
deleteIdentityPolicy_policyName :: (Text -> f Text) -> DeleteIdentityPolicy -> f DeleteIdentityPolicy
deleteIdentityPolicy_policyName = (DeleteIdentityPolicy -> Text)
-> (DeleteIdentityPolicy -> Text -> DeleteIdentityPolicy)
-> Lens DeleteIdentityPolicy DeleteIdentityPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteIdentityPolicy' {Text
policyName :: Text
$sel:policyName:DeleteIdentityPolicy' :: DeleteIdentityPolicy -> Text
policyName} -> Text
policyName) (\s :: DeleteIdentityPolicy
s@DeleteIdentityPolicy' {} Text
a -> DeleteIdentityPolicy
s {$sel:policyName:DeleteIdentityPolicy' :: Text
policyName = Text
a} :: DeleteIdentityPolicy)
instance Core.AWSRequest DeleteIdentityPolicy where
type
AWSResponse DeleteIdentityPolicy =
DeleteIdentityPolicyResponse
request :: DeleteIdentityPolicy -> Request DeleteIdentityPolicy
request = Service -> DeleteIdentityPolicy -> Request DeleteIdentityPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteIdentityPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteIdentityPolicy)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteIdentityPolicy))
-> Logger
-> Service
-> Proxy DeleteIdentityPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteIdentityPolicy)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DeleteIdentityPolicyResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> DeleteIdentityPolicyResponse
DeleteIdentityPolicyResponse'
(Int -> DeleteIdentityPolicyResponse)
-> Either String Int -> Either String DeleteIdentityPolicyResponse
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 DeleteIdentityPolicy
instance Prelude.NFData DeleteIdentityPolicy
instance Core.ToHeaders DeleteIdentityPolicy where
toHeaders :: DeleteIdentityPolicy -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteIdentityPolicy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteIdentityPolicy where
toPath :: DeleteIdentityPolicy -> ByteString
toPath = ByteString -> DeleteIdentityPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteIdentityPolicy where
toQuery :: DeleteIdentityPolicy -> QueryString
toQuery DeleteIdentityPolicy' {Text
policyName :: Text
identity :: Text
$sel:policyName:DeleteIdentityPolicy' :: DeleteIdentityPolicy -> Text
$sel:identity:DeleteIdentityPolicy' :: DeleteIdentityPolicy -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteIdentityPolicy" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"Identity" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
identity,
ByteString
"PolicyName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
policyName
]
data DeleteIdentityPolicyResponse = DeleteIdentityPolicyResponse'
{
DeleteIdentityPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteIdentityPolicyResponse
-> DeleteIdentityPolicyResponse -> Bool
(DeleteIdentityPolicyResponse
-> DeleteIdentityPolicyResponse -> Bool)
-> (DeleteIdentityPolicyResponse
-> DeleteIdentityPolicyResponse -> Bool)
-> Eq DeleteIdentityPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteIdentityPolicyResponse
-> DeleteIdentityPolicyResponse -> Bool
$c/= :: DeleteIdentityPolicyResponse
-> DeleteIdentityPolicyResponse -> Bool
== :: DeleteIdentityPolicyResponse
-> DeleteIdentityPolicyResponse -> Bool
$c== :: DeleteIdentityPolicyResponse
-> DeleteIdentityPolicyResponse -> Bool
Prelude.Eq, ReadPrec [DeleteIdentityPolicyResponse]
ReadPrec DeleteIdentityPolicyResponse
Int -> ReadS DeleteIdentityPolicyResponse
ReadS [DeleteIdentityPolicyResponse]
(Int -> ReadS DeleteIdentityPolicyResponse)
-> ReadS [DeleteIdentityPolicyResponse]
-> ReadPrec DeleteIdentityPolicyResponse
-> ReadPrec [DeleteIdentityPolicyResponse]
-> Read DeleteIdentityPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteIdentityPolicyResponse]
$creadListPrec :: ReadPrec [DeleteIdentityPolicyResponse]
readPrec :: ReadPrec DeleteIdentityPolicyResponse
$creadPrec :: ReadPrec DeleteIdentityPolicyResponse
readList :: ReadS [DeleteIdentityPolicyResponse]
$creadList :: ReadS [DeleteIdentityPolicyResponse]
readsPrec :: Int -> ReadS DeleteIdentityPolicyResponse
$creadsPrec :: Int -> ReadS DeleteIdentityPolicyResponse
Prelude.Read, Int -> DeleteIdentityPolicyResponse -> ShowS
[DeleteIdentityPolicyResponse] -> ShowS
DeleteIdentityPolicyResponse -> String
(Int -> DeleteIdentityPolicyResponse -> ShowS)
-> (DeleteIdentityPolicyResponse -> String)
-> ([DeleteIdentityPolicyResponse] -> ShowS)
-> Show DeleteIdentityPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteIdentityPolicyResponse] -> ShowS
$cshowList :: [DeleteIdentityPolicyResponse] -> ShowS
show :: DeleteIdentityPolicyResponse -> String
$cshow :: DeleteIdentityPolicyResponse -> String
showsPrec :: Int -> DeleteIdentityPolicyResponse -> ShowS
$cshowsPrec :: Int -> DeleteIdentityPolicyResponse -> ShowS
Prelude.Show, (forall x.
DeleteIdentityPolicyResponse -> Rep DeleteIdentityPolicyResponse x)
-> (forall x.
Rep DeleteIdentityPolicyResponse x -> DeleteIdentityPolicyResponse)
-> Generic DeleteIdentityPolicyResponse
forall x.
Rep DeleteIdentityPolicyResponse x -> DeleteIdentityPolicyResponse
forall x.
DeleteIdentityPolicyResponse -> Rep DeleteIdentityPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteIdentityPolicyResponse x -> DeleteIdentityPolicyResponse
$cfrom :: forall x.
DeleteIdentityPolicyResponse -> Rep DeleteIdentityPolicyResponse x
Prelude.Generic)
newDeleteIdentityPolicyResponse ::
Prelude.Int ->
DeleteIdentityPolicyResponse
newDeleteIdentityPolicyResponse :: Int -> DeleteIdentityPolicyResponse
newDeleteIdentityPolicyResponse Int
pHttpStatus_ =
DeleteIdentityPolicyResponse' :: Int -> DeleteIdentityPolicyResponse
DeleteIdentityPolicyResponse'
{ $sel:httpStatus:DeleteIdentityPolicyResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteIdentityPolicyResponse_httpStatus :: Lens.Lens' DeleteIdentityPolicyResponse Prelude.Int
deleteIdentityPolicyResponse_httpStatus :: (Int -> f Int)
-> DeleteIdentityPolicyResponse -> f DeleteIdentityPolicyResponse
deleteIdentityPolicyResponse_httpStatus = (DeleteIdentityPolicyResponse -> Int)
-> (DeleteIdentityPolicyResponse
-> Int -> DeleteIdentityPolicyResponse)
-> Lens
DeleteIdentityPolicyResponse DeleteIdentityPolicyResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteIdentityPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteIdentityPolicyResponse' :: DeleteIdentityPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteIdentityPolicyResponse
s@DeleteIdentityPolicyResponse' {} Int
a -> DeleteIdentityPolicyResponse
s {$sel:httpStatus:DeleteIdentityPolicyResponse' :: Int
httpStatus = Int
a} :: DeleteIdentityPolicyResponse)
instance Prelude.NFData DeleteIdentityPolicyResponse