{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types
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
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]
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
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. 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'
{ $sel:userName:UpdateAccessKey' :: Maybe Text
userName = 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 :: Lens' UpdateAccessKey (Maybe Text)
updateAccessKey_userName = 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 :: Lens' UpdateAccessKey AccessKey
updateAccessKey_accessKeyId = 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 :: Lens' UpdateAccessKey StatusType
updateAccessKey_status = 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 :: (Service -> Service) -> UpdateAccessKey -> Request UpdateAccessKey
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateAccessKey
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateAccessKey)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull UpdateAccessKeyResponse
UpdateAccessKeyResponse'
instance Prelude.Hashable UpdateAccessKey where
hashWithSalt :: Int -> UpdateAccessKey -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AccessKey
accessKeyId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` StatusType
status
instance Prelude.NFData UpdateAccessKey where
rnf :: UpdateAccessKey -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AccessKey
accessKeyId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf StatusType
status
instance Data.ToHeaders UpdateAccessKey where
toHeaders :: UpdateAccessKey -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath UpdateAccessKey where
toPath :: UpdateAccessKey -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"UpdateAccessKey" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"UserName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
userName,
ByteString
"AccessKeyId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: AccessKey
accessKeyId,
ByteString
"Status" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: StatusType
status
]
data UpdateAccessKeyResponse = UpdateAccessKeyResponse'
{
}
deriving (UpdateAccessKeyResponse -> UpdateAccessKeyResponse -> Bool
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]
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
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. 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 where
rnf :: UpdateAccessKeyResponse -> ()
rnf UpdateAccessKeyResponse
_ = ()