{-# 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.GetAccessKeyLastUsed
(
GetAccessKeyLastUsed (..),
newGetAccessKeyLastUsed,
getAccessKeyLastUsed_accessKeyId,
GetAccessKeyLastUsedResponse (..),
newGetAccessKeyLastUsedResponse,
getAccessKeyLastUsedResponse_userName,
getAccessKeyLastUsedResponse_accessKeyLastUsed,
getAccessKeyLastUsedResponse_httpStatus,
)
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 GetAccessKeyLastUsed = GetAccessKeyLastUsed'
{
GetAccessKeyLastUsed -> AccessKey
accessKeyId :: Core.AccessKey
}
deriving (GetAccessKeyLastUsed -> GetAccessKeyLastUsed -> Bool
(GetAccessKeyLastUsed -> GetAccessKeyLastUsed -> Bool)
-> (GetAccessKeyLastUsed -> GetAccessKeyLastUsed -> Bool)
-> Eq GetAccessKeyLastUsed
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAccessKeyLastUsed -> GetAccessKeyLastUsed -> Bool
$c/= :: GetAccessKeyLastUsed -> GetAccessKeyLastUsed -> Bool
== :: GetAccessKeyLastUsed -> GetAccessKeyLastUsed -> Bool
$c== :: GetAccessKeyLastUsed -> GetAccessKeyLastUsed -> Bool
Prelude.Eq, ReadPrec [GetAccessKeyLastUsed]
ReadPrec GetAccessKeyLastUsed
Int -> ReadS GetAccessKeyLastUsed
ReadS [GetAccessKeyLastUsed]
(Int -> ReadS GetAccessKeyLastUsed)
-> ReadS [GetAccessKeyLastUsed]
-> ReadPrec GetAccessKeyLastUsed
-> ReadPrec [GetAccessKeyLastUsed]
-> Read GetAccessKeyLastUsed
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAccessKeyLastUsed]
$creadListPrec :: ReadPrec [GetAccessKeyLastUsed]
readPrec :: ReadPrec GetAccessKeyLastUsed
$creadPrec :: ReadPrec GetAccessKeyLastUsed
readList :: ReadS [GetAccessKeyLastUsed]
$creadList :: ReadS [GetAccessKeyLastUsed]
readsPrec :: Int -> ReadS GetAccessKeyLastUsed
$creadsPrec :: Int -> ReadS GetAccessKeyLastUsed
Prelude.Read, Int -> GetAccessKeyLastUsed -> ShowS
[GetAccessKeyLastUsed] -> ShowS
GetAccessKeyLastUsed -> String
(Int -> GetAccessKeyLastUsed -> ShowS)
-> (GetAccessKeyLastUsed -> String)
-> ([GetAccessKeyLastUsed] -> ShowS)
-> Show GetAccessKeyLastUsed
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAccessKeyLastUsed] -> ShowS
$cshowList :: [GetAccessKeyLastUsed] -> ShowS
show :: GetAccessKeyLastUsed -> String
$cshow :: GetAccessKeyLastUsed -> String
showsPrec :: Int -> GetAccessKeyLastUsed -> ShowS
$cshowsPrec :: Int -> GetAccessKeyLastUsed -> ShowS
Prelude.Show, (forall x. GetAccessKeyLastUsed -> Rep GetAccessKeyLastUsed x)
-> (forall x. Rep GetAccessKeyLastUsed x -> GetAccessKeyLastUsed)
-> Generic GetAccessKeyLastUsed
forall x. Rep GetAccessKeyLastUsed x -> GetAccessKeyLastUsed
forall x. GetAccessKeyLastUsed -> Rep GetAccessKeyLastUsed x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAccessKeyLastUsed x -> GetAccessKeyLastUsed
$cfrom :: forall x. GetAccessKeyLastUsed -> Rep GetAccessKeyLastUsed x
Prelude.Generic)
newGetAccessKeyLastUsed ::
Core.AccessKey ->
GetAccessKeyLastUsed
newGetAccessKeyLastUsed :: AccessKey -> GetAccessKeyLastUsed
newGetAccessKeyLastUsed AccessKey
pAccessKeyId_ =
GetAccessKeyLastUsed' :: AccessKey -> GetAccessKeyLastUsed
GetAccessKeyLastUsed' {$sel:accessKeyId:GetAccessKeyLastUsed' :: AccessKey
accessKeyId = AccessKey
pAccessKeyId_}
getAccessKeyLastUsed_accessKeyId :: Lens.Lens' GetAccessKeyLastUsed Core.AccessKey
getAccessKeyLastUsed_accessKeyId :: (AccessKey -> f AccessKey)
-> GetAccessKeyLastUsed -> f GetAccessKeyLastUsed
getAccessKeyLastUsed_accessKeyId = (GetAccessKeyLastUsed -> AccessKey)
-> (GetAccessKeyLastUsed -> AccessKey -> GetAccessKeyLastUsed)
-> Lens
GetAccessKeyLastUsed GetAccessKeyLastUsed AccessKey AccessKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccessKeyLastUsed' {AccessKey
accessKeyId :: AccessKey
$sel:accessKeyId:GetAccessKeyLastUsed' :: GetAccessKeyLastUsed -> AccessKey
accessKeyId} -> AccessKey
accessKeyId) (\s :: GetAccessKeyLastUsed
s@GetAccessKeyLastUsed' {} AccessKey
a -> GetAccessKeyLastUsed
s {$sel:accessKeyId:GetAccessKeyLastUsed' :: AccessKey
accessKeyId = AccessKey
a} :: GetAccessKeyLastUsed)
instance Core.AWSRequest GetAccessKeyLastUsed where
type
AWSResponse GetAccessKeyLastUsed =
GetAccessKeyLastUsedResponse
request :: GetAccessKeyLastUsed -> Request GetAccessKeyLastUsed
request = Service -> GetAccessKeyLastUsed -> Request GetAccessKeyLastUsed
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy GetAccessKeyLastUsed
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetAccessKeyLastUsed)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetAccessKeyLastUsed))
-> Logger
-> Service
-> Proxy GetAccessKeyLastUsed
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetAccessKeyLastUsed)))
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
"GetAccessKeyLastUsedResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text
-> Maybe AccessKeyLastUsed -> Int -> GetAccessKeyLastUsedResponse
GetAccessKeyLastUsedResponse'
(Maybe Text
-> Maybe AccessKeyLastUsed -> Int -> GetAccessKeyLastUsedResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe AccessKeyLastUsed -> Int -> GetAccessKeyLastUsedResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"UserName")
Either
String
(Maybe AccessKeyLastUsed -> Int -> GetAccessKeyLastUsedResponse)
-> Either String (Maybe AccessKeyLastUsed)
-> Either String (Int -> GetAccessKeyLastUsedResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe AccessKeyLastUsed)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AccessKeyLastUsed")
Either String (Int -> GetAccessKeyLastUsedResponse)
-> Either String Int -> Either String GetAccessKeyLastUsedResponse
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable GetAccessKeyLastUsed
instance Prelude.NFData GetAccessKeyLastUsed
instance Core.ToHeaders GetAccessKeyLastUsed where
toHeaders :: GetAccessKeyLastUsed -> ResponseHeaders
toHeaders = ResponseHeaders -> GetAccessKeyLastUsed -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetAccessKeyLastUsed where
toPath :: GetAccessKeyLastUsed -> ByteString
toPath = ByteString -> GetAccessKeyLastUsed -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetAccessKeyLastUsed where
toQuery :: GetAccessKeyLastUsed -> QueryString
toQuery GetAccessKeyLastUsed' {AccessKey
accessKeyId :: AccessKey
$sel:accessKeyId:GetAccessKeyLastUsed' :: GetAccessKeyLastUsed -> AccessKey
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"GetAccessKeyLastUsed" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"AccessKeyId" ByteString -> AccessKey -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: AccessKey
accessKeyId
]
data GetAccessKeyLastUsedResponse = GetAccessKeyLastUsedResponse'
{
GetAccessKeyLastUsedResponse -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
GetAccessKeyLastUsedResponse -> Maybe AccessKeyLastUsed
accessKeyLastUsed :: Prelude.Maybe AccessKeyLastUsed,
GetAccessKeyLastUsedResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetAccessKeyLastUsedResponse
-> GetAccessKeyLastUsedResponse -> Bool
(GetAccessKeyLastUsedResponse
-> GetAccessKeyLastUsedResponse -> Bool)
-> (GetAccessKeyLastUsedResponse
-> GetAccessKeyLastUsedResponse -> Bool)
-> Eq GetAccessKeyLastUsedResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAccessKeyLastUsedResponse
-> GetAccessKeyLastUsedResponse -> Bool
$c/= :: GetAccessKeyLastUsedResponse
-> GetAccessKeyLastUsedResponse -> Bool
== :: GetAccessKeyLastUsedResponse
-> GetAccessKeyLastUsedResponse -> Bool
$c== :: GetAccessKeyLastUsedResponse
-> GetAccessKeyLastUsedResponse -> Bool
Prelude.Eq, ReadPrec [GetAccessKeyLastUsedResponse]
ReadPrec GetAccessKeyLastUsedResponse
Int -> ReadS GetAccessKeyLastUsedResponse
ReadS [GetAccessKeyLastUsedResponse]
(Int -> ReadS GetAccessKeyLastUsedResponse)
-> ReadS [GetAccessKeyLastUsedResponse]
-> ReadPrec GetAccessKeyLastUsedResponse
-> ReadPrec [GetAccessKeyLastUsedResponse]
-> Read GetAccessKeyLastUsedResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAccessKeyLastUsedResponse]
$creadListPrec :: ReadPrec [GetAccessKeyLastUsedResponse]
readPrec :: ReadPrec GetAccessKeyLastUsedResponse
$creadPrec :: ReadPrec GetAccessKeyLastUsedResponse
readList :: ReadS [GetAccessKeyLastUsedResponse]
$creadList :: ReadS [GetAccessKeyLastUsedResponse]
readsPrec :: Int -> ReadS GetAccessKeyLastUsedResponse
$creadsPrec :: Int -> ReadS GetAccessKeyLastUsedResponse
Prelude.Read, Int -> GetAccessKeyLastUsedResponse -> ShowS
[GetAccessKeyLastUsedResponse] -> ShowS
GetAccessKeyLastUsedResponse -> String
(Int -> GetAccessKeyLastUsedResponse -> ShowS)
-> (GetAccessKeyLastUsedResponse -> String)
-> ([GetAccessKeyLastUsedResponse] -> ShowS)
-> Show GetAccessKeyLastUsedResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAccessKeyLastUsedResponse] -> ShowS
$cshowList :: [GetAccessKeyLastUsedResponse] -> ShowS
show :: GetAccessKeyLastUsedResponse -> String
$cshow :: GetAccessKeyLastUsedResponse -> String
showsPrec :: Int -> GetAccessKeyLastUsedResponse -> ShowS
$cshowsPrec :: Int -> GetAccessKeyLastUsedResponse -> ShowS
Prelude.Show, (forall x.
GetAccessKeyLastUsedResponse -> Rep GetAccessKeyLastUsedResponse x)
-> (forall x.
Rep GetAccessKeyLastUsedResponse x -> GetAccessKeyLastUsedResponse)
-> Generic GetAccessKeyLastUsedResponse
forall x.
Rep GetAccessKeyLastUsedResponse x -> GetAccessKeyLastUsedResponse
forall x.
GetAccessKeyLastUsedResponse -> Rep GetAccessKeyLastUsedResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAccessKeyLastUsedResponse x -> GetAccessKeyLastUsedResponse
$cfrom :: forall x.
GetAccessKeyLastUsedResponse -> Rep GetAccessKeyLastUsedResponse x
Prelude.Generic)
newGetAccessKeyLastUsedResponse ::
Prelude.Int ->
GetAccessKeyLastUsedResponse
newGetAccessKeyLastUsedResponse :: Int -> GetAccessKeyLastUsedResponse
newGetAccessKeyLastUsedResponse Int
pHttpStatus_ =
GetAccessKeyLastUsedResponse' :: Maybe Text
-> Maybe AccessKeyLastUsed -> Int -> GetAccessKeyLastUsedResponse
GetAccessKeyLastUsedResponse'
{ $sel:userName:GetAccessKeyLastUsedResponse' :: Maybe Text
userName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accessKeyLastUsed:GetAccessKeyLastUsedResponse' :: Maybe AccessKeyLastUsed
accessKeyLastUsed = Maybe AccessKeyLastUsed
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetAccessKeyLastUsedResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getAccessKeyLastUsedResponse_userName :: Lens.Lens' GetAccessKeyLastUsedResponse (Prelude.Maybe Prelude.Text)
getAccessKeyLastUsedResponse_userName :: (Maybe Text -> f (Maybe Text))
-> GetAccessKeyLastUsedResponse -> f GetAccessKeyLastUsedResponse
getAccessKeyLastUsedResponse_userName = (GetAccessKeyLastUsedResponse -> Maybe Text)
-> (GetAccessKeyLastUsedResponse
-> Maybe Text -> GetAccessKeyLastUsedResponse)
-> Lens
GetAccessKeyLastUsedResponse
GetAccessKeyLastUsedResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccessKeyLastUsedResponse' {Maybe Text
userName :: Maybe Text
$sel:userName:GetAccessKeyLastUsedResponse' :: GetAccessKeyLastUsedResponse -> Maybe Text
userName} -> Maybe Text
userName) (\s :: GetAccessKeyLastUsedResponse
s@GetAccessKeyLastUsedResponse' {} Maybe Text
a -> GetAccessKeyLastUsedResponse
s {$sel:userName:GetAccessKeyLastUsedResponse' :: Maybe Text
userName = Maybe Text
a} :: GetAccessKeyLastUsedResponse)
getAccessKeyLastUsedResponse_accessKeyLastUsed :: Lens.Lens' GetAccessKeyLastUsedResponse (Prelude.Maybe AccessKeyLastUsed)
getAccessKeyLastUsedResponse_accessKeyLastUsed :: (Maybe AccessKeyLastUsed -> f (Maybe AccessKeyLastUsed))
-> GetAccessKeyLastUsedResponse -> f GetAccessKeyLastUsedResponse
getAccessKeyLastUsedResponse_accessKeyLastUsed = (GetAccessKeyLastUsedResponse -> Maybe AccessKeyLastUsed)
-> (GetAccessKeyLastUsedResponse
-> Maybe AccessKeyLastUsed -> GetAccessKeyLastUsedResponse)
-> Lens
GetAccessKeyLastUsedResponse
GetAccessKeyLastUsedResponse
(Maybe AccessKeyLastUsed)
(Maybe AccessKeyLastUsed)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccessKeyLastUsedResponse' {Maybe AccessKeyLastUsed
accessKeyLastUsed :: Maybe AccessKeyLastUsed
$sel:accessKeyLastUsed:GetAccessKeyLastUsedResponse' :: GetAccessKeyLastUsedResponse -> Maybe AccessKeyLastUsed
accessKeyLastUsed} -> Maybe AccessKeyLastUsed
accessKeyLastUsed) (\s :: GetAccessKeyLastUsedResponse
s@GetAccessKeyLastUsedResponse' {} Maybe AccessKeyLastUsed
a -> GetAccessKeyLastUsedResponse
s {$sel:accessKeyLastUsed:GetAccessKeyLastUsedResponse' :: Maybe AccessKeyLastUsed
accessKeyLastUsed = Maybe AccessKeyLastUsed
a} :: GetAccessKeyLastUsedResponse)
getAccessKeyLastUsedResponse_httpStatus :: Lens.Lens' GetAccessKeyLastUsedResponse Prelude.Int
getAccessKeyLastUsedResponse_httpStatus :: (Int -> f Int)
-> GetAccessKeyLastUsedResponse -> f GetAccessKeyLastUsedResponse
getAccessKeyLastUsedResponse_httpStatus = (GetAccessKeyLastUsedResponse -> Int)
-> (GetAccessKeyLastUsedResponse
-> Int -> GetAccessKeyLastUsedResponse)
-> Lens
GetAccessKeyLastUsedResponse GetAccessKeyLastUsedResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccessKeyLastUsedResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAccessKeyLastUsedResponse' :: GetAccessKeyLastUsedResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAccessKeyLastUsedResponse
s@GetAccessKeyLastUsedResponse' {} Int
a -> GetAccessKeyLastUsedResponse
s {$sel:httpStatus:GetAccessKeyLastUsedResponse' :: Int
httpStatus = Int
a} :: GetAccessKeyLastUsedResponse)
instance Prelude.NFData GetAccessKeyLastUsedResponse