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