{-# 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.DeleteAccessKey
(
DeleteAccessKey (..),
newDeleteAccessKey,
deleteAccessKey_userName,
deleteAccessKey_accessKeyId,
DeleteAccessKeyResponse (..),
newDeleteAccessKeyResponse,
)
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 DeleteAccessKey = DeleteAccessKey'
{
DeleteAccessKey -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
DeleteAccessKey -> AccessKey
accessKeyId :: Core.AccessKey
}
deriving (DeleteAccessKey -> DeleteAccessKey -> Bool
(DeleteAccessKey -> DeleteAccessKey -> Bool)
-> (DeleteAccessKey -> DeleteAccessKey -> Bool)
-> Eq DeleteAccessKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAccessKey -> DeleteAccessKey -> Bool
$c/= :: DeleteAccessKey -> DeleteAccessKey -> Bool
== :: DeleteAccessKey -> DeleteAccessKey -> Bool
$c== :: DeleteAccessKey -> DeleteAccessKey -> Bool
Prelude.Eq, ReadPrec [DeleteAccessKey]
ReadPrec DeleteAccessKey
Int -> ReadS DeleteAccessKey
ReadS [DeleteAccessKey]
(Int -> ReadS DeleteAccessKey)
-> ReadS [DeleteAccessKey]
-> ReadPrec DeleteAccessKey
-> ReadPrec [DeleteAccessKey]
-> Read DeleteAccessKey
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAccessKey]
$creadListPrec :: ReadPrec [DeleteAccessKey]
readPrec :: ReadPrec DeleteAccessKey
$creadPrec :: ReadPrec DeleteAccessKey
readList :: ReadS [DeleteAccessKey]
$creadList :: ReadS [DeleteAccessKey]
readsPrec :: Int -> ReadS DeleteAccessKey
$creadsPrec :: Int -> ReadS DeleteAccessKey
Prelude.Read, Int -> DeleteAccessKey -> ShowS
[DeleteAccessKey] -> ShowS
DeleteAccessKey -> String
(Int -> DeleteAccessKey -> ShowS)
-> (DeleteAccessKey -> String)
-> ([DeleteAccessKey] -> ShowS)
-> Show DeleteAccessKey
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAccessKey] -> ShowS
$cshowList :: [DeleteAccessKey] -> ShowS
show :: DeleteAccessKey -> String
$cshow :: DeleteAccessKey -> String
showsPrec :: Int -> DeleteAccessKey -> ShowS
$cshowsPrec :: Int -> DeleteAccessKey -> ShowS
Prelude.Show, (forall x. DeleteAccessKey -> Rep DeleteAccessKey x)
-> (forall x. Rep DeleteAccessKey x -> DeleteAccessKey)
-> Generic DeleteAccessKey
forall x. Rep DeleteAccessKey x -> DeleteAccessKey
forall x. DeleteAccessKey -> Rep DeleteAccessKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAccessKey x -> DeleteAccessKey
$cfrom :: forall x. DeleteAccessKey -> Rep DeleteAccessKey x
Prelude.Generic)
newDeleteAccessKey ::
Core.AccessKey ->
DeleteAccessKey
newDeleteAccessKey :: AccessKey -> DeleteAccessKey
newDeleteAccessKey AccessKey
pAccessKeyId_ =
DeleteAccessKey' :: Maybe Text -> AccessKey -> DeleteAccessKey
DeleteAccessKey'
{ $sel:userName:DeleteAccessKey' :: Maybe Text
userName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accessKeyId:DeleteAccessKey' :: AccessKey
accessKeyId = AccessKey
pAccessKeyId_
}
deleteAccessKey_userName :: Lens.Lens' DeleteAccessKey (Prelude.Maybe Prelude.Text)
deleteAccessKey_userName :: (Maybe Text -> f (Maybe Text))
-> DeleteAccessKey -> f DeleteAccessKey
deleteAccessKey_userName = (DeleteAccessKey -> Maybe Text)
-> (DeleteAccessKey -> Maybe Text -> DeleteAccessKey)
-> Lens DeleteAccessKey DeleteAccessKey (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccessKey' {Maybe Text
userName :: Maybe Text
$sel:userName:DeleteAccessKey' :: DeleteAccessKey -> Maybe Text
userName} -> Maybe Text
userName) (\s :: DeleteAccessKey
s@DeleteAccessKey' {} Maybe Text
a -> DeleteAccessKey
s {$sel:userName:DeleteAccessKey' :: Maybe Text
userName = Maybe Text
a} :: DeleteAccessKey)
deleteAccessKey_accessKeyId :: Lens.Lens' DeleteAccessKey Core.AccessKey
deleteAccessKey_accessKeyId :: (AccessKey -> f AccessKey) -> DeleteAccessKey -> f DeleteAccessKey
deleteAccessKey_accessKeyId = (DeleteAccessKey -> AccessKey)
-> (DeleteAccessKey -> AccessKey -> DeleteAccessKey)
-> Lens DeleteAccessKey DeleteAccessKey AccessKey AccessKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccessKey' {AccessKey
accessKeyId :: AccessKey
$sel:accessKeyId:DeleteAccessKey' :: DeleteAccessKey -> AccessKey
accessKeyId} -> AccessKey
accessKeyId) (\s :: DeleteAccessKey
s@DeleteAccessKey' {} AccessKey
a -> DeleteAccessKey
s {$sel:accessKeyId:DeleteAccessKey' :: AccessKey
accessKeyId = AccessKey
a} :: DeleteAccessKey)
instance Core.AWSRequest DeleteAccessKey where
type
AWSResponse DeleteAccessKey =
DeleteAccessKeyResponse
request :: DeleteAccessKey -> Request DeleteAccessKey
request = Service -> DeleteAccessKey -> Request DeleteAccessKey
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteAccessKey
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAccessKey)))
response =
AWSResponse DeleteAccessKey
-> Logger
-> Service
-> Proxy DeleteAccessKey
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAccessKey)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteAccessKey
DeleteAccessKeyResponse
DeleteAccessKeyResponse'
instance Prelude.Hashable DeleteAccessKey
instance Prelude.NFData DeleteAccessKey
instance Core.ToHeaders DeleteAccessKey where
toHeaders :: DeleteAccessKey -> [Header]
toHeaders = [Header] -> DeleteAccessKey -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteAccessKey where
toPath :: DeleteAccessKey -> ByteString
toPath = ByteString -> DeleteAccessKey -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteAccessKey where
toQuery :: DeleteAccessKey -> QueryString
toQuery DeleteAccessKey' {Maybe Text
AccessKey
accessKeyId :: AccessKey
userName :: Maybe Text
$sel:accessKeyId:DeleteAccessKey' :: DeleteAccessKey -> AccessKey
$sel:userName:DeleteAccessKey' :: DeleteAccessKey -> Maybe 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
"DeleteAccessKey" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"UserName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
userName,
ByteString
"AccessKeyId" ByteString -> AccessKey -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: AccessKey
accessKeyId
]
data DeleteAccessKeyResponse = DeleteAccessKeyResponse'
{
}
deriving (DeleteAccessKeyResponse -> DeleteAccessKeyResponse -> Bool
(DeleteAccessKeyResponse -> DeleteAccessKeyResponse -> Bool)
-> (DeleteAccessKeyResponse -> DeleteAccessKeyResponse -> Bool)
-> Eq DeleteAccessKeyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAccessKeyResponse -> DeleteAccessKeyResponse -> Bool
$c/= :: DeleteAccessKeyResponse -> DeleteAccessKeyResponse -> Bool
== :: DeleteAccessKeyResponse -> DeleteAccessKeyResponse -> Bool
$c== :: DeleteAccessKeyResponse -> DeleteAccessKeyResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAccessKeyResponse]
ReadPrec DeleteAccessKeyResponse
Int -> ReadS DeleteAccessKeyResponse
ReadS [DeleteAccessKeyResponse]
(Int -> ReadS DeleteAccessKeyResponse)
-> ReadS [DeleteAccessKeyResponse]
-> ReadPrec DeleteAccessKeyResponse
-> ReadPrec [DeleteAccessKeyResponse]
-> Read DeleteAccessKeyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAccessKeyResponse]
$creadListPrec :: ReadPrec [DeleteAccessKeyResponse]
readPrec :: ReadPrec DeleteAccessKeyResponse
$creadPrec :: ReadPrec DeleteAccessKeyResponse
readList :: ReadS [DeleteAccessKeyResponse]
$creadList :: ReadS [DeleteAccessKeyResponse]
readsPrec :: Int -> ReadS DeleteAccessKeyResponse
$creadsPrec :: Int -> ReadS DeleteAccessKeyResponse
Prelude.Read, Int -> DeleteAccessKeyResponse -> ShowS
[DeleteAccessKeyResponse] -> ShowS
DeleteAccessKeyResponse -> String
(Int -> DeleteAccessKeyResponse -> ShowS)
-> (DeleteAccessKeyResponse -> String)
-> ([DeleteAccessKeyResponse] -> ShowS)
-> Show DeleteAccessKeyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAccessKeyResponse] -> ShowS
$cshowList :: [DeleteAccessKeyResponse] -> ShowS
show :: DeleteAccessKeyResponse -> String
$cshow :: DeleteAccessKeyResponse -> String
showsPrec :: Int -> DeleteAccessKeyResponse -> ShowS
$cshowsPrec :: Int -> DeleteAccessKeyResponse -> ShowS
Prelude.Show, (forall x.
DeleteAccessKeyResponse -> Rep DeleteAccessKeyResponse x)
-> (forall x.
Rep DeleteAccessKeyResponse x -> DeleteAccessKeyResponse)
-> Generic DeleteAccessKeyResponse
forall x. Rep DeleteAccessKeyResponse x -> DeleteAccessKeyResponse
forall x. DeleteAccessKeyResponse -> Rep DeleteAccessKeyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAccessKeyResponse x -> DeleteAccessKeyResponse
$cfrom :: forall x. DeleteAccessKeyResponse -> Rep DeleteAccessKeyResponse x
Prelude.Generic)
newDeleteAccessKeyResponse ::
DeleteAccessKeyResponse
newDeleteAccessKeyResponse :: DeleteAccessKeyResponse
newDeleteAccessKeyResponse = DeleteAccessKeyResponse
DeleteAccessKeyResponse'
instance Prelude.NFData DeleteAccessKeyResponse