{-# 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.DeleteServiceLinkedRole
(
DeleteServiceLinkedRole (..),
newDeleteServiceLinkedRole,
deleteServiceLinkedRole_roleName,
DeleteServiceLinkedRoleResponse (..),
newDeleteServiceLinkedRoleResponse,
deleteServiceLinkedRoleResponse_httpStatus,
deleteServiceLinkedRoleResponse_deletionTaskId,
)
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 DeleteServiceLinkedRole = DeleteServiceLinkedRole'
{
DeleteServiceLinkedRole -> Text
roleName :: Prelude.Text
}
deriving (DeleteServiceLinkedRole -> DeleteServiceLinkedRole -> Bool
(DeleteServiceLinkedRole -> DeleteServiceLinkedRole -> Bool)
-> (DeleteServiceLinkedRole -> DeleteServiceLinkedRole -> Bool)
-> Eq DeleteServiceLinkedRole
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteServiceLinkedRole -> DeleteServiceLinkedRole -> Bool
$c/= :: DeleteServiceLinkedRole -> DeleteServiceLinkedRole -> Bool
== :: DeleteServiceLinkedRole -> DeleteServiceLinkedRole -> Bool
$c== :: DeleteServiceLinkedRole -> DeleteServiceLinkedRole -> Bool
Prelude.Eq, ReadPrec [DeleteServiceLinkedRole]
ReadPrec DeleteServiceLinkedRole
Int -> ReadS DeleteServiceLinkedRole
ReadS [DeleteServiceLinkedRole]
(Int -> ReadS DeleteServiceLinkedRole)
-> ReadS [DeleteServiceLinkedRole]
-> ReadPrec DeleteServiceLinkedRole
-> ReadPrec [DeleteServiceLinkedRole]
-> Read DeleteServiceLinkedRole
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteServiceLinkedRole]
$creadListPrec :: ReadPrec [DeleteServiceLinkedRole]
readPrec :: ReadPrec DeleteServiceLinkedRole
$creadPrec :: ReadPrec DeleteServiceLinkedRole
readList :: ReadS [DeleteServiceLinkedRole]
$creadList :: ReadS [DeleteServiceLinkedRole]
readsPrec :: Int -> ReadS DeleteServiceLinkedRole
$creadsPrec :: Int -> ReadS DeleteServiceLinkedRole
Prelude.Read, Int -> DeleteServiceLinkedRole -> ShowS
[DeleteServiceLinkedRole] -> ShowS
DeleteServiceLinkedRole -> String
(Int -> DeleteServiceLinkedRole -> ShowS)
-> (DeleteServiceLinkedRole -> String)
-> ([DeleteServiceLinkedRole] -> ShowS)
-> Show DeleteServiceLinkedRole
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteServiceLinkedRole] -> ShowS
$cshowList :: [DeleteServiceLinkedRole] -> ShowS
show :: DeleteServiceLinkedRole -> String
$cshow :: DeleteServiceLinkedRole -> String
showsPrec :: Int -> DeleteServiceLinkedRole -> ShowS
$cshowsPrec :: Int -> DeleteServiceLinkedRole -> ShowS
Prelude.Show, (forall x.
DeleteServiceLinkedRole -> Rep DeleteServiceLinkedRole x)
-> (forall x.
Rep DeleteServiceLinkedRole x -> DeleteServiceLinkedRole)
-> Generic DeleteServiceLinkedRole
forall x. Rep DeleteServiceLinkedRole x -> DeleteServiceLinkedRole
forall x. DeleteServiceLinkedRole -> Rep DeleteServiceLinkedRole x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteServiceLinkedRole x -> DeleteServiceLinkedRole
$cfrom :: forall x. DeleteServiceLinkedRole -> Rep DeleteServiceLinkedRole x
Prelude.Generic)
newDeleteServiceLinkedRole ::
Prelude.Text ->
DeleteServiceLinkedRole
newDeleteServiceLinkedRole :: Text -> DeleteServiceLinkedRole
newDeleteServiceLinkedRole Text
pRoleName_ =
DeleteServiceLinkedRole' :: Text -> DeleteServiceLinkedRole
DeleteServiceLinkedRole' {$sel:roleName:DeleteServiceLinkedRole' :: Text
roleName = Text
pRoleName_}
deleteServiceLinkedRole_roleName :: Lens.Lens' DeleteServiceLinkedRole Prelude.Text
deleteServiceLinkedRole_roleName :: (Text -> f Text)
-> DeleteServiceLinkedRole -> f DeleteServiceLinkedRole
deleteServiceLinkedRole_roleName = (DeleteServiceLinkedRole -> Text)
-> (DeleteServiceLinkedRole -> Text -> DeleteServiceLinkedRole)
-> Lens DeleteServiceLinkedRole DeleteServiceLinkedRole Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteServiceLinkedRole' {Text
roleName :: Text
$sel:roleName:DeleteServiceLinkedRole' :: DeleteServiceLinkedRole -> Text
roleName} -> Text
roleName) (\s :: DeleteServiceLinkedRole
s@DeleteServiceLinkedRole' {} Text
a -> DeleteServiceLinkedRole
s {$sel:roleName:DeleteServiceLinkedRole' :: Text
roleName = Text
a} :: DeleteServiceLinkedRole)
instance Core.AWSRequest DeleteServiceLinkedRole where
type
AWSResponse DeleteServiceLinkedRole =
DeleteServiceLinkedRoleResponse
request :: DeleteServiceLinkedRole -> Request DeleteServiceLinkedRole
request = Service
-> DeleteServiceLinkedRole -> Request DeleteServiceLinkedRole
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteServiceLinkedRole
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteServiceLinkedRole)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteServiceLinkedRole))
-> Logger
-> Service
-> Proxy DeleteServiceLinkedRole
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteServiceLinkedRole)))
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
"DeleteServiceLinkedRoleResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> Text -> DeleteServiceLinkedRoleResponse
DeleteServiceLinkedRoleResponse'
(Int -> Text -> DeleteServiceLinkedRoleResponse)
-> Either String Int
-> Either String (Text -> DeleteServiceLinkedRoleResponse)
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))
Either String (Text -> DeleteServiceLinkedRoleResponse)
-> Either String Text
-> Either String DeleteServiceLinkedRoleResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"DeletionTaskId")
)
instance Prelude.Hashable DeleteServiceLinkedRole
instance Prelude.NFData DeleteServiceLinkedRole
instance Core.ToHeaders DeleteServiceLinkedRole where
toHeaders :: DeleteServiceLinkedRole -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteServiceLinkedRole -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteServiceLinkedRole where
toPath :: DeleteServiceLinkedRole -> ByteString
toPath = ByteString -> DeleteServiceLinkedRole -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteServiceLinkedRole where
toQuery :: DeleteServiceLinkedRole -> QueryString
toQuery DeleteServiceLinkedRole' {Text
roleName :: Text
$sel:roleName:DeleteServiceLinkedRole' :: DeleteServiceLinkedRole -> 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
"DeleteServiceLinkedRole" :: 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 DeleteServiceLinkedRoleResponse = DeleteServiceLinkedRoleResponse'
{
DeleteServiceLinkedRoleResponse -> Int
httpStatus :: Prelude.Int,
DeleteServiceLinkedRoleResponse -> Text
deletionTaskId :: Prelude.Text
}
deriving (DeleteServiceLinkedRoleResponse
-> DeleteServiceLinkedRoleResponse -> Bool
(DeleteServiceLinkedRoleResponse
-> DeleteServiceLinkedRoleResponse -> Bool)
-> (DeleteServiceLinkedRoleResponse
-> DeleteServiceLinkedRoleResponse -> Bool)
-> Eq DeleteServiceLinkedRoleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteServiceLinkedRoleResponse
-> DeleteServiceLinkedRoleResponse -> Bool
$c/= :: DeleteServiceLinkedRoleResponse
-> DeleteServiceLinkedRoleResponse -> Bool
== :: DeleteServiceLinkedRoleResponse
-> DeleteServiceLinkedRoleResponse -> Bool
$c== :: DeleteServiceLinkedRoleResponse
-> DeleteServiceLinkedRoleResponse -> Bool
Prelude.Eq, ReadPrec [DeleteServiceLinkedRoleResponse]
ReadPrec DeleteServiceLinkedRoleResponse
Int -> ReadS DeleteServiceLinkedRoleResponse
ReadS [DeleteServiceLinkedRoleResponse]
(Int -> ReadS DeleteServiceLinkedRoleResponse)
-> ReadS [DeleteServiceLinkedRoleResponse]
-> ReadPrec DeleteServiceLinkedRoleResponse
-> ReadPrec [DeleteServiceLinkedRoleResponse]
-> Read DeleteServiceLinkedRoleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteServiceLinkedRoleResponse]
$creadListPrec :: ReadPrec [DeleteServiceLinkedRoleResponse]
readPrec :: ReadPrec DeleteServiceLinkedRoleResponse
$creadPrec :: ReadPrec DeleteServiceLinkedRoleResponse
readList :: ReadS [DeleteServiceLinkedRoleResponse]
$creadList :: ReadS [DeleteServiceLinkedRoleResponse]
readsPrec :: Int -> ReadS DeleteServiceLinkedRoleResponse
$creadsPrec :: Int -> ReadS DeleteServiceLinkedRoleResponse
Prelude.Read, Int -> DeleteServiceLinkedRoleResponse -> ShowS
[DeleteServiceLinkedRoleResponse] -> ShowS
DeleteServiceLinkedRoleResponse -> String
(Int -> DeleteServiceLinkedRoleResponse -> ShowS)
-> (DeleteServiceLinkedRoleResponse -> String)
-> ([DeleteServiceLinkedRoleResponse] -> ShowS)
-> Show DeleteServiceLinkedRoleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteServiceLinkedRoleResponse] -> ShowS
$cshowList :: [DeleteServiceLinkedRoleResponse] -> ShowS
show :: DeleteServiceLinkedRoleResponse -> String
$cshow :: DeleteServiceLinkedRoleResponse -> String
showsPrec :: Int -> DeleteServiceLinkedRoleResponse -> ShowS
$cshowsPrec :: Int -> DeleteServiceLinkedRoleResponse -> ShowS
Prelude.Show, (forall x.
DeleteServiceLinkedRoleResponse
-> Rep DeleteServiceLinkedRoleResponse x)
-> (forall x.
Rep DeleteServiceLinkedRoleResponse x
-> DeleteServiceLinkedRoleResponse)
-> Generic DeleteServiceLinkedRoleResponse
forall x.
Rep DeleteServiceLinkedRoleResponse x
-> DeleteServiceLinkedRoleResponse
forall x.
DeleteServiceLinkedRoleResponse
-> Rep DeleteServiceLinkedRoleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteServiceLinkedRoleResponse x
-> DeleteServiceLinkedRoleResponse
$cfrom :: forall x.
DeleteServiceLinkedRoleResponse
-> Rep DeleteServiceLinkedRoleResponse x
Prelude.Generic)
newDeleteServiceLinkedRoleResponse ::
Prelude.Int ->
Prelude.Text ->
DeleteServiceLinkedRoleResponse
newDeleteServiceLinkedRoleResponse :: Int -> Text -> DeleteServiceLinkedRoleResponse
newDeleteServiceLinkedRoleResponse
Int
pHttpStatus_
Text
pDeletionTaskId_ =
DeleteServiceLinkedRoleResponse' :: Int -> Text -> DeleteServiceLinkedRoleResponse
DeleteServiceLinkedRoleResponse'
{ $sel:httpStatus:DeleteServiceLinkedRoleResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:deletionTaskId:DeleteServiceLinkedRoleResponse' :: Text
deletionTaskId = Text
pDeletionTaskId_
}
deleteServiceLinkedRoleResponse_httpStatus :: Lens.Lens' DeleteServiceLinkedRoleResponse Prelude.Int
deleteServiceLinkedRoleResponse_httpStatus :: (Int -> f Int)
-> DeleteServiceLinkedRoleResponse
-> f DeleteServiceLinkedRoleResponse
deleteServiceLinkedRoleResponse_httpStatus = (DeleteServiceLinkedRoleResponse -> Int)
-> (DeleteServiceLinkedRoleResponse
-> Int -> DeleteServiceLinkedRoleResponse)
-> Lens
DeleteServiceLinkedRoleResponse
DeleteServiceLinkedRoleResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteServiceLinkedRoleResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteServiceLinkedRoleResponse' :: DeleteServiceLinkedRoleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteServiceLinkedRoleResponse
s@DeleteServiceLinkedRoleResponse' {} Int
a -> DeleteServiceLinkedRoleResponse
s {$sel:httpStatus:DeleteServiceLinkedRoleResponse' :: Int
httpStatus = Int
a} :: DeleteServiceLinkedRoleResponse)
deleteServiceLinkedRoleResponse_deletionTaskId :: Lens.Lens' DeleteServiceLinkedRoleResponse Prelude.Text
deleteServiceLinkedRoleResponse_deletionTaskId :: (Text -> f Text)
-> DeleteServiceLinkedRoleResponse
-> f DeleteServiceLinkedRoleResponse
deleteServiceLinkedRoleResponse_deletionTaskId = (DeleteServiceLinkedRoleResponse -> Text)
-> (DeleteServiceLinkedRoleResponse
-> Text -> DeleteServiceLinkedRoleResponse)
-> Lens
DeleteServiceLinkedRoleResponse
DeleteServiceLinkedRoleResponse
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteServiceLinkedRoleResponse' {Text
deletionTaskId :: Text
$sel:deletionTaskId:DeleteServiceLinkedRoleResponse' :: DeleteServiceLinkedRoleResponse -> Text
deletionTaskId} -> Text
deletionTaskId) (\s :: DeleteServiceLinkedRoleResponse
s@DeleteServiceLinkedRoleResponse' {} Text
a -> DeleteServiceLinkedRoleResponse
s {$sel:deletionTaskId:DeleteServiceLinkedRoleResponse' :: Text
deletionTaskId = Text
a} :: DeleteServiceLinkedRoleResponse)
instance
Prelude.NFData
DeleteServiceLinkedRoleResponse