{-# 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.GetLoginProfile
(
GetLoginProfile (..),
newGetLoginProfile,
getLoginProfile_userName,
GetLoginProfileResponse (..),
newGetLoginProfileResponse,
getLoginProfileResponse_httpStatus,
getLoginProfileResponse_loginProfile,
)
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 GetLoginProfile = GetLoginProfile'
{
GetLoginProfile -> Text
userName :: Prelude.Text
}
deriving (GetLoginProfile -> GetLoginProfile -> Bool
(GetLoginProfile -> GetLoginProfile -> Bool)
-> (GetLoginProfile -> GetLoginProfile -> Bool)
-> Eq GetLoginProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLoginProfile -> GetLoginProfile -> Bool
$c/= :: GetLoginProfile -> GetLoginProfile -> Bool
== :: GetLoginProfile -> GetLoginProfile -> Bool
$c== :: GetLoginProfile -> GetLoginProfile -> Bool
Prelude.Eq, ReadPrec [GetLoginProfile]
ReadPrec GetLoginProfile
Int -> ReadS GetLoginProfile
ReadS [GetLoginProfile]
(Int -> ReadS GetLoginProfile)
-> ReadS [GetLoginProfile]
-> ReadPrec GetLoginProfile
-> ReadPrec [GetLoginProfile]
-> Read GetLoginProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLoginProfile]
$creadListPrec :: ReadPrec [GetLoginProfile]
readPrec :: ReadPrec GetLoginProfile
$creadPrec :: ReadPrec GetLoginProfile
readList :: ReadS [GetLoginProfile]
$creadList :: ReadS [GetLoginProfile]
readsPrec :: Int -> ReadS GetLoginProfile
$creadsPrec :: Int -> ReadS GetLoginProfile
Prelude.Read, Int -> GetLoginProfile -> ShowS
[GetLoginProfile] -> ShowS
GetLoginProfile -> String
(Int -> GetLoginProfile -> ShowS)
-> (GetLoginProfile -> String)
-> ([GetLoginProfile] -> ShowS)
-> Show GetLoginProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLoginProfile] -> ShowS
$cshowList :: [GetLoginProfile] -> ShowS
show :: GetLoginProfile -> String
$cshow :: GetLoginProfile -> String
showsPrec :: Int -> GetLoginProfile -> ShowS
$cshowsPrec :: Int -> GetLoginProfile -> ShowS
Prelude.Show, (forall x. GetLoginProfile -> Rep GetLoginProfile x)
-> (forall x. Rep GetLoginProfile x -> GetLoginProfile)
-> Generic GetLoginProfile
forall x. Rep GetLoginProfile x -> GetLoginProfile
forall x. GetLoginProfile -> Rep GetLoginProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetLoginProfile x -> GetLoginProfile
$cfrom :: forall x. GetLoginProfile -> Rep GetLoginProfile x
Prelude.Generic)
newGetLoginProfile ::
Prelude.Text ->
GetLoginProfile
newGetLoginProfile :: Text -> GetLoginProfile
newGetLoginProfile Text
pUserName_ =
GetLoginProfile' :: Text -> GetLoginProfile
GetLoginProfile' {$sel:userName:GetLoginProfile' :: Text
userName = Text
pUserName_}
getLoginProfile_userName :: Lens.Lens' GetLoginProfile Prelude.Text
getLoginProfile_userName :: (Text -> f Text) -> GetLoginProfile -> f GetLoginProfile
getLoginProfile_userName = (GetLoginProfile -> Text)
-> (GetLoginProfile -> Text -> GetLoginProfile)
-> Lens GetLoginProfile GetLoginProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoginProfile' {Text
userName :: Text
$sel:userName:GetLoginProfile' :: GetLoginProfile -> Text
userName} -> Text
userName) (\s :: GetLoginProfile
s@GetLoginProfile' {} Text
a -> GetLoginProfile
s {$sel:userName:GetLoginProfile' :: Text
userName = Text
a} :: GetLoginProfile)
instance Core.AWSRequest GetLoginProfile where
type
AWSResponse GetLoginProfile =
GetLoginProfileResponse
request :: GetLoginProfile -> Request GetLoginProfile
request = Service -> GetLoginProfile -> Request GetLoginProfile
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy GetLoginProfile
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetLoginProfile)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetLoginProfile))
-> Logger
-> Service
-> Proxy GetLoginProfile
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetLoginProfile)))
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
"GetLoginProfileResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> LoginProfile -> GetLoginProfileResponse
GetLoginProfileResponse'
(Int -> LoginProfile -> GetLoginProfileResponse)
-> Either String Int
-> Either String (LoginProfile -> GetLoginProfileResponse)
forall (f :: * -> *) a b. Functor 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))
Either String (LoginProfile -> GetLoginProfileResponse)
-> Either String LoginProfile
-> Either String GetLoginProfileResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String LoginProfile
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"LoginProfile")
)
instance Prelude.Hashable GetLoginProfile
instance Prelude.NFData GetLoginProfile
instance Core.ToHeaders GetLoginProfile where
toHeaders :: GetLoginProfile -> ResponseHeaders
toHeaders = ResponseHeaders -> GetLoginProfile -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetLoginProfile where
toPath :: GetLoginProfile -> ByteString
toPath = ByteString -> GetLoginProfile -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetLoginProfile where
toQuery :: GetLoginProfile -> QueryString
toQuery GetLoginProfile' {Text
userName :: Text
$sel:userName:GetLoginProfile' :: GetLoginProfile -> 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
"GetLoginProfile" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"UserName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
userName
]
data GetLoginProfileResponse = GetLoginProfileResponse'
{
GetLoginProfileResponse -> Int
httpStatus :: Prelude.Int,
GetLoginProfileResponse -> LoginProfile
loginProfile :: LoginProfile
}
deriving (GetLoginProfileResponse -> GetLoginProfileResponse -> Bool
(GetLoginProfileResponse -> GetLoginProfileResponse -> Bool)
-> (GetLoginProfileResponse -> GetLoginProfileResponse -> Bool)
-> Eq GetLoginProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLoginProfileResponse -> GetLoginProfileResponse -> Bool
$c/= :: GetLoginProfileResponse -> GetLoginProfileResponse -> Bool
== :: GetLoginProfileResponse -> GetLoginProfileResponse -> Bool
$c== :: GetLoginProfileResponse -> GetLoginProfileResponse -> Bool
Prelude.Eq, ReadPrec [GetLoginProfileResponse]
ReadPrec GetLoginProfileResponse
Int -> ReadS GetLoginProfileResponse
ReadS [GetLoginProfileResponse]
(Int -> ReadS GetLoginProfileResponse)
-> ReadS [GetLoginProfileResponse]
-> ReadPrec GetLoginProfileResponse
-> ReadPrec [GetLoginProfileResponse]
-> Read GetLoginProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLoginProfileResponse]
$creadListPrec :: ReadPrec [GetLoginProfileResponse]
readPrec :: ReadPrec GetLoginProfileResponse
$creadPrec :: ReadPrec GetLoginProfileResponse
readList :: ReadS [GetLoginProfileResponse]
$creadList :: ReadS [GetLoginProfileResponse]
readsPrec :: Int -> ReadS GetLoginProfileResponse
$creadsPrec :: Int -> ReadS GetLoginProfileResponse
Prelude.Read, Int -> GetLoginProfileResponse -> ShowS
[GetLoginProfileResponse] -> ShowS
GetLoginProfileResponse -> String
(Int -> GetLoginProfileResponse -> ShowS)
-> (GetLoginProfileResponse -> String)
-> ([GetLoginProfileResponse] -> ShowS)
-> Show GetLoginProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLoginProfileResponse] -> ShowS
$cshowList :: [GetLoginProfileResponse] -> ShowS
show :: GetLoginProfileResponse -> String
$cshow :: GetLoginProfileResponse -> String
showsPrec :: Int -> GetLoginProfileResponse -> ShowS
$cshowsPrec :: Int -> GetLoginProfileResponse -> ShowS
Prelude.Show, (forall x.
GetLoginProfileResponse -> Rep GetLoginProfileResponse x)
-> (forall x.
Rep GetLoginProfileResponse x -> GetLoginProfileResponse)
-> Generic GetLoginProfileResponse
forall x. Rep GetLoginProfileResponse x -> GetLoginProfileResponse
forall x. GetLoginProfileResponse -> Rep GetLoginProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetLoginProfileResponse x -> GetLoginProfileResponse
$cfrom :: forall x. GetLoginProfileResponse -> Rep GetLoginProfileResponse x
Prelude.Generic)
newGetLoginProfileResponse ::
Prelude.Int ->
LoginProfile ->
GetLoginProfileResponse
newGetLoginProfileResponse :: Int -> LoginProfile -> GetLoginProfileResponse
newGetLoginProfileResponse
Int
pHttpStatus_
LoginProfile
pLoginProfile_ =
GetLoginProfileResponse' :: Int -> LoginProfile -> GetLoginProfileResponse
GetLoginProfileResponse'
{ $sel:httpStatus:GetLoginProfileResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:loginProfile:GetLoginProfileResponse' :: LoginProfile
loginProfile = LoginProfile
pLoginProfile_
}
getLoginProfileResponse_httpStatus :: Lens.Lens' GetLoginProfileResponse Prelude.Int
getLoginProfileResponse_httpStatus :: (Int -> f Int)
-> GetLoginProfileResponse -> f GetLoginProfileResponse
getLoginProfileResponse_httpStatus = (GetLoginProfileResponse -> Int)
-> (GetLoginProfileResponse -> Int -> GetLoginProfileResponse)
-> Lens GetLoginProfileResponse GetLoginProfileResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoginProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetLoginProfileResponse' :: GetLoginProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetLoginProfileResponse
s@GetLoginProfileResponse' {} Int
a -> GetLoginProfileResponse
s {$sel:httpStatus:GetLoginProfileResponse' :: Int
httpStatus = Int
a} :: GetLoginProfileResponse)
getLoginProfileResponse_loginProfile :: Lens.Lens' GetLoginProfileResponse LoginProfile
getLoginProfileResponse_loginProfile :: (LoginProfile -> f LoginProfile)
-> GetLoginProfileResponse -> f GetLoginProfileResponse
getLoginProfileResponse_loginProfile = (GetLoginProfileResponse -> LoginProfile)
-> (GetLoginProfileResponse
-> LoginProfile -> GetLoginProfileResponse)
-> Lens
GetLoginProfileResponse
GetLoginProfileResponse
LoginProfile
LoginProfile
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoginProfileResponse' {LoginProfile
loginProfile :: LoginProfile
$sel:loginProfile:GetLoginProfileResponse' :: GetLoginProfileResponse -> LoginProfile
loginProfile} -> LoginProfile
loginProfile) (\s :: GetLoginProfileResponse
s@GetLoginProfileResponse' {} LoginProfile
a -> GetLoginProfileResponse
s {$sel:loginProfile:GetLoginProfileResponse' :: LoginProfile
loginProfile = LoginProfile
a} :: GetLoginProfileResponse)
instance Prelude.NFData GetLoginProfileResponse