{-# 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.IAM.DeleteRole
(
DeleteRole (..),
newDeleteRole,
deleteRole_roleName,
DeleteRoleResponse (..),
newDeleteRoleResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IAM.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteRole = DeleteRole'
{
DeleteRole -> Text
roleName :: Prelude.Text
}
deriving (DeleteRole -> DeleteRole -> Bool
(DeleteRole -> DeleteRole -> Bool)
-> (DeleteRole -> DeleteRole -> Bool) -> Eq DeleteRole
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRole -> DeleteRole -> Bool
$c/= :: DeleteRole -> DeleteRole -> Bool
== :: DeleteRole -> DeleteRole -> Bool
$c== :: DeleteRole -> DeleteRole -> Bool
Prelude.Eq, ReadPrec [DeleteRole]
ReadPrec DeleteRole
Int -> ReadS DeleteRole
ReadS [DeleteRole]
(Int -> ReadS DeleteRole)
-> ReadS [DeleteRole]
-> ReadPrec DeleteRole
-> ReadPrec [DeleteRole]
-> Read DeleteRole
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRole]
$creadListPrec :: ReadPrec [DeleteRole]
readPrec :: ReadPrec DeleteRole
$creadPrec :: ReadPrec DeleteRole
readList :: ReadS [DeleteRole]
$creadList :: ReadS [DeleteRole]
readsPrec :: Int -> ReadS DeleteRole
$creadsPrec :: Int -> ReadS DeleteRole
Prelude.Read, Int -> DeleteRole -> ShowS
[DeleteRole] -> ShowS
DeleteRole -> String
(Int -> DeleteRole -> ShowS)
-> (DeleteRole -> String)
-> ([DeleteRole] -> ShowS)
-> Show DeleteRole
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRole] -> ShowS
$cshowList :: [DeleteRole] -> ShowS
show :: DeleteRole -> String
$cshow :: DeleteRole -> String
showsPrec :: Int -> DeleteRole -> ShowS
$cshowsPrec :: Int -> DeleteRole -> ShowS
Prelude.Show, (forall x. DeleteRole -> Rep DeleteRole x)
-> (forall x. Rep DeleteRole x -> DeleteRole) -> Generic DeleteRole
forall x. Rep DeleteRole x -> DeleteRole
forall x. DeleteRole -> Rep DeleteRole x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRole x -> DeleteRole
$cfrom :: forall x. DeleteRole -> Rep DeleteRole x
Prelude.Generic)
newDeleteRole ::
Prelude.Text ->
DeleteRole
newDeleteRole :: Text -> DeleteRole
newDeleteRole Text
pRoleName_ =
DeleteRole' :: Text -> DeleteRole
DeleteRole' {$sel:roleName:DeleteRole' :: Text
roleName = Text
pRoleName_}
deleteRole_roleName :: Lens.Lens' DeleteRole Prelude.Text
deleteRole_roleName :: (Text -> f Text) -> DeleteRole -> f DeleteRole
deleteRole_roleName = (DeleteRole -> Text)
-> (DeleteRole -> Text -> DeleteRole)
-> Lens DeleteRole DeleteRole Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRole' {Text
roleName :: Text
$sel:roleName:DeleteRole' :: DeleteRole -> Text
roleName} -> Text
roleName) (\s :: DeleteRole
s@DeleteRole' {} Text
a -> DeleteRole
s {$sel:roleName:DeleteRole' :: Text
roleName = Text
a} :: DeleteRole)
instance Core.AWSRequest DeleteRole where
type AWSResponse DeleteRole = DeleteRoleResponse
request :: DeleteRole -> Request DeleteRole
request = Service -> DeleteRole -> Request DeleteRole
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteRole
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteRole)))
response = AWSResponse DeleteRole
-> Logger
-> Service
-> Proxy DeleteRole
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteRole)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteRole
DeleteRoleResponse
DeleteRoleResponse'
instance Prelude.Hashable DeleteRole
instance Prelude.NFData DeleteRole
instance Core.ToHeaders DeleteRole where
toHeaders :: DeleteRole -> [Header]
toHeaders = [Header] -> DeleteRole -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteRole where
toPath :: DeleteRole -> ByteString
toPath = ByteString -> DeleteRole -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteRole where
toQuery :: DeleteRole -> QueryString
toQuery DeleteRole' {Text
roleName :: Text
$sel:roleName:DeleteRole' :: DeleteRole -> 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
"DeleteRole" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"RoleName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
roleName
]
data DeleteRoleResponse = DeleteRoleResponse'
{
}
deriving (DeleteRoleResponse -> DeleteRoleResponse -> Bool
(DeleteRoleResponse -> DeleteRoleResponse -> Bool)
-> (DeleteRoleResponse -> DeleteRoleResponse -> Bool)
-> Eq DeleteRoleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRoleResponse -> DeleteRoleResponse -> Bool
$c/= :: DeleteRoleResponse -> DeleteRoleResponse -> Bool
== :: DeleteRoleResponse -> DeleteRoleResponse -> Bool
$c== :: DeleteRoleResponse -> DeleteRoleResponse -> Bool
Prelude.Eq, ReadPrec [DeleteRoleResponse]
ReadPrec DeleteRoleResponse
Int -> ReadS DeleteRoleResponse
ReadS [DeleteRoleResponse]
(Int -> ReadS DeleteRoleResponse)
-> ReadS [DeleteRoleResponse]
-> ReadPrec DeleteRoleResponse
-> ReadPrec [DeleteRoleResponse]
-> Read DeleteRoleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRoleResponse]
$creadListPrec :: ReadPrec [DeleteRoleResponse]
readPrec :: ReadPrec DeleteRoleResponse
$creadPrec :: ReadPrec DeleteRoleResponse
readList :: ReadS [DeleteRoleResponse]
$creadList :: ReadS [DeleteRoleResponse]
readsPrec :: Int -> ReadS DeleteRoleResponse
$creadsPrec :: Int -> ReadS DeleteRoleResponse
Prelude.Read, Int -> DeleteRoleResponse -> ShowS
[DeleteRoleResponse] -> ShowS
DeleteRoleResponse -> String
(Int -> DeleteRoleResponse -> ShowS)
-> (DeleteRoleResponse -> String)
-> ([DeleteRoleResponse] -> ShowS)
-> Show DeleteRoleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRoleResponse] -> ShowS
$cshowList :: [DeleteRoleResponse] -> ShowS
show :: DeleteRoleResponse -> String
$cshow :: DeleteRoleResponse -> String
showsPrec :: Int -> DeleteRoleResponse -> ShowS
$cshowsPrec :: Int -> DeleteRoleResponse -> ShowS
Prelude.Show, (forall x. DeleteRoleResponse -> Rep DeleteRoleResponse x)
-> (forall x. Rep DeleteRoleResponse x -> DeleteRoleResponse)
-> Generic DeleteRoleResponse
forall x. Rep DeleteRoleResponse x -> DeleteRoleResponse
forall x. DeleteRoleResponse -> Rep DeleteRoleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRoleResponse x -> DeleteRoleResponse
$cfrom :: forall x. DeleteRoleResponse -> Rep DeleteRoleResponse x
Prelude.Generic)
newDeleteRoleResponse ::
DeleteRoleResponse
newDeleteRoleResponse :: DeleteRoleResponse
newDeleteRoleResponse = DeleteRoleResponse
DeleteRoleResponse'
instance Prelude.NFData DeleteRoleResponse