{-# 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.STS.GetAccessKeyInfo
(
GetAccessKeyInfo (..),
newGetAccessKeyInfo,
getAccessKeyInfo_accessKeyId,
GetAccessKeyInfoResponse (..),
newGetAccessKeyInfoResponse,
getAccessKeyInfoResponse_account,
getAccessKeyInfoResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.STS.Types
data GetAccessKeyInfo = GetAccessKeyInfo'
{
GetAccessKeyInfo -> AccessKey
accessKeyId :: Core.AccessKey
}
deriving (GetAccessKeyInfo -> GetAccessKeyInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAccessKeyInfo -> GetAccessKeyInfo -> Bool
$c/= :: GetAccessKeyInfo -> GetAccessKeyInfo -> Bool
== :: GetAccessKeyInfo -> GetAccessKeyInfo -> Bool
$c== :: GetAccessKeyInfo -> GetAccessKeyInfo -> Bool
Prelude.Eq, ReadPrec [GetAccessKeyInfo]
ReadPrec GetAccessKeyInfo
Int -> ReadS GetAccessKeyInfo
ReadS [GetAccessKeyInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAccessKeyInfo]
$creadListPrec :: ReadPrec [GetAccessKeyInfo]
readPrec :: ReadPrec GetAccessKeyInfo
$creadPrec :: ReadPrec GetAccessKeyInfo
readList :: ReadS [GetAccessKeyInfo]
$creadList :: ReadS [GetAccessKeyInfo]
readsPrec :: Int -> ReadS GetAccessKeyInfo
$creadsPrec :: Int -> ReadS GetAccessKeyInfo
Prelude.Read, Int -> GetAccessKeyInfo -> ShowS
[GetAccessKeyInfo] -> ShowS
GetAccessKeyInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAccessKeyInfo] -> ShowS
$cshowList :: [GetAccessKeyInfo] -> ShowS
show :: GetAccessKeyInfo -> String
$cshow :: GetAccessKeyInfo -> String
showsPrec :: Int -> GetAccessKeyInfo -> ShowS
$cshowsPrec :: Int -> GetAccessKeyInfo -> ShowS
Prelude.Show, forall x. Rep GetAccessKeyInfo x -> GetAccessKeyInfo
forall x. GetAccessKeyInfo -> Rep GetAccessKeyInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAccessKeyInfo x -> GetAccessKeyInfo
$cfrom :: forall x. GetAccessKeyInfo -> Rep GetAccessKeyInfo x
Prelude.Generic)
newGetAccessKeyInfo ::
Core.AccessKey ->
GetAccessKeyInfo
newGetAccessKeyInfo :: AccessKey -> GetAccessKeyInfo
newGetAccessKeyInfo AccessKey
pAccessKeyId_ =
GetAccessKeyInfo' {$sel:accessKeyId:GetAccessKeyInfo' :: AccessKey
accessKeyId = AccessKey
pAccessKeyId_}
getAccessKeyInfo_accessKeyId :: Lens.Lens' GetAccessKeyInfo Core.AccessKey
getAccessKeyInfo_accessKeyId :: Lens' GetAccessKeyInfo AccessKey
getAccessKeyInfo_accessKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccessKeyInfo' {AccessKey
accessKeyId :: AccessKey
$sel:accessKeyId:GetAccessKeyInfo' :: GetAccessKeyInfo -> AccessKey
accessKeyId} -> AccessKey
accessKeyId) (\s :: GetAccessKeyInfo
s@GetAccessKeyInfo' {} AccessKey
a -> GetAccessKeyInfo
s {$sel:accessKeyId:GetAccessKeyInfo' :: AccessKey
accessKeyId = AccessKey
a} :: GetAccessKeyInfo)
instance Core.AWSRequest GetAccessKeyInfo where
type
AWSResponse GetAccessKeyInfo =
GetAccessKeyInfoResponse
request :: (Service -> Service)
-> GetAccessKeyInfo -> Request GetAccessKeyInfo
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 GetAccessKeyInfo
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAccessKeyInfo)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"GetAccessKeyInfoResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text -> Int -> GetAccessKeyInfoResponse
GetAccessKeyInfoResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Account")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetAccessKeyInfo where
hashWithSalt :: Int -> GetAccessKeyInfo -> Int
hashWithSalt Int
_salt GetAccessKeyInfo' {AccessKey
accessKeyId :: AccessKey
$sel:accessKeyId:GetAccessKeyInfo' :: GetAccessKeyInfo -> AccessKey
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AccessKey
accessKeyId
instance Prelude.NFData GetAccessKeyInfo where
rnf :: GetAccessKeyInfo -> ()
rnf GetAccessKeyInfo' {AccessKey
accessKeyId :: AccessKey
$sel:accessKeyId:GetAccessKeyInfo' :: GetAccessKeyInfo -> AccessKey
..} = forall a. NFData a => a -> ()
Prelude.rnf AccessKey
accessKeyId
instance Data.ToHeaders GetAccessKeyInfo where
toHeaders :: GetAccessKeyInfo -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath GetAccessKeyInfo where
toPath :: GetAccessKeyInfo -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetAccessKeyInfo where
toQuery :: GetAccessKeyInfo -> QueryString
toQuery GetAccessKeyInfo' {AccessKey
accessKeyId :: AccessKey
$sel:accessKeyId:GetAccessKeyInfo' :: GetAccessKeyInfo -> AccessKey
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"GetAccessKeyInfo" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2011-06-15" :: Prelude.ByteString),
ByteString
"AccessKeyId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: AccessKey
accessKeyId
]
data GetAccessKeyInfoResponse = GetAccessKeyInfoResponse'
{
GetAccessKeyInfoResponse -> Maybe Text
account :: Prelude.Maybe Prelude.Text,
GetAccessKeyInfoResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetAccessKeyInfoResponse -> GetAccessKeyInfoResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAccessKeyInfoResponse -> GetAccessKeyInfoResponse -> Bool
$c/= :: GetAccessKeyInfoResponse -> GetAccessKeyInfoResponse -> Bool
== :: GetAccessKeyInfoResponse -> GetAccessKeyInfoResponse -> Bool
$c== :: GetAccessKeyInfoResponse -> GetAccessKeyInfoResponse -> Bool
Prelude.Eq, ReadPrec [GetAccessKeyInfoResponse]
ReadPrec GetAccessKeyInfoResponse
Int -> ReadS GetAccessKeyInfoResponse
ReadS [GetAccessKeyInfoResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAccessKeyInfoResponse]
$creadListPrec :: ReadPrec [GetAccessKeyInfoResponse]
readPrec :: ReadPrec GetAccessKeyInfoResponse
$creadPrec :: ReadPrec GetAccessKeyInfoResponse
readList :: ReadS [GetAccessKeyInfoResponse]
$creadList :: ReadS [GetAccessKeyInfoResponse]
readsPrec :: Int -> ReadS GetAccessKeyInfoResponse
$creadsPrec :: Int -> ReadS GetAccessKeyInfoResponse
Prelude.Read, Int -> GetAccessKeyInfoResponse -> ShowS
[GetAccessKeyInfoResponse] -> ShowS
GetAccessKeyInfoResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAccessKeyInfoResponse] -> ShowS
$cshowList :: [GetAccessKeyInfoResponse] -> ShowS
show :: GetAccessKeyInfoResponse -> String
$cshow :: GetAccessKeyInfoResponse -> String
showsPrec :: Int -> GetAccessKeyInfoResponse -> ShowS
$cshowsPrec :: Int -> GetAccessKeyInfoResponse -> ShowS
Prelude.Show, forall x.
Rep GetAccessKeyInfoResponse x -> GetAccessKeyInfoResponse
forall x.
GetAccessKeyInfoResponse -> Rep GetAccessKeyInfoResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAccessKeyInfoResponse x -> GetAccessKeyInfoResponse
$cfrom :: forall x.
GetAccessKeyInfoResponse -> Rep GetAccessKeyInfoResponse x
Prelude.Generic)
newGetAccessKeyInfoResponse ::
Prelude.Int ->
GetAccessKeyInfoResponse
newGetAccessKeyInfoResponse :: Int -> GetAccessKeyInfoResponse
newGetAccessKeyInfoResponse Int
pHttpStatus_ =
GetAccessKeyInfoResponse'
{ $sel:account:GetAccessKeyInfoResponse' :: Maybe Text
account =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetAccessKeyInfoResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getAccessKeyInfoResponse_account :: Lens.Lens' GetAccessKeyInfoResponse (Prelude.Maybe Prelude.Text)
getAccessKeyInfoResponse_account :: Lens' GetAccessKeyInfoResponse (Maybe Text)
getAccessKeyInfoResponse_account = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccessKeyInfoResponse' {Maybe Text
account :: Maybe Text
$sel:account:GetAccessKeyInfoResponse' :: GetAccessKeyInfoResponse -> Maybe Text
account} -> Maybe Text
account) (\s :: GetAccessKeyInfoResponse
s@GetAccessKeyInfoResponse' {} Maybe Text
a -> GetAccessKeyInfoResponse
s {$sel:account:GetAccessKeyInfoResponse' :: Maybe Text
account = Maybe Text
a} :: GetAccessKeyInfoResponse)
getAccessKeyInfoResponse_httpStatus :: Lens.Lens' GetAccessKeyInfoResponse Prelude.Int
getAccessKeyInfoResponse_httpStatus :: Lens' GetAccessKeyInfoResponse Int
getAccessKeyInfoResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccessKeyInfoResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAccessKeyInfoResponse' :: GetAccessKeyInfoResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAccessKeyInfoResponse
s@GetAccessKeyInfoResponse' {} Int
a -> GetAccessKeyInfoResponse
s {$sel:httpStatus:GetAccessKeyInfoResponse' :: Int
httpStatus = Int
a} :: GetAccessKeyInfoResponse)
instance Prelude.NFData GetAccessKeyInfoResponse where
rnf :: GetAccessKeyInfoResponse -> ()
rnf GetAccessKeyInfoResponse' {Int
Maybe Text
httpStatus :: Int
account :: Maybe Text
$sel:httpStatus:GetAccessKeyInfoResponse' :: GetAccessKeyInfoResponse -> Int
$sel:account:GetAccessKeyInfoResponse' :: GetAccessKeyInfoResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
account
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus