{-# 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.CreateLoginProfile
(
CreateLoginProfile (..),
newCreateLoginProfile,
createLoginProfile_passwordResetRequired,
createLoginProfile_userName,
createLoginProfile_password,
CreateLoginProfileResponse (..),
newCreateLoginProfileResponse,
createLoginProfileResponse_httpStatus,
createLoginProfileResponse_loginProfile,
)
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 CreateLoginProfile = CreateLoginProfile'
{
CreateLoginProfile -> Maybe Bool
passwordResetRequired :: Prelude.Maybe Prelude.Bool,
CreateLoginProfile -> Text
userName :: Prelude.Text,
CreateLoginProfile -> Sensitive Text
password :: Data.Sensitive Prelude.Text
}
deriving (CreateLoginProfile -> CreateLoginProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLoginProfile -> CreateLoginProfile -> Bool
$c/= :: CreateLoginProfile -> CreateLoginProfile -> Bool
== :: CreateLoginProfile -> CreateLoginProfile -> Bool
$c== :: CreateLoginProfile -> CreateLoginProfile -> Bool
Prelude.Eq, Int -> CreateLoginProfile -> ShowS
[CreateLoginProfile] -> ShowS
CreateLoginProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLoginProfile] -> ShowS
$cshowList :: [CreateLoginProfile] -> ShowS
show :: CreateLoginProfile -> String
$cshow :: CreateLoginProfile -> String
showsPrec :: Int -> CreateLoginProfile -> ShowS
$cshowsPrec :: Int -> CreateLoginProfile -> ShowS
Prelude.Show, forall x. Rep CreateLoginProfile x -> CreateLoginProfile
forall x. CreateLoginProfile -> Rep CreateLoginProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateLoginProfile x -> CreateLoginProfile
$cfrom :: forall x. CreateLoginProfile -> Rep CreateLoginProfile x
Prelude.Generic)
newCreateLoginProfile ::
Prelude.Text ->
Prelude.Text ->
CreateLoginProfile
newCreateLoginProfile :: Text -> Text -> CreateLoginProfile
newCreateLoginProfile Text
pUserName_ Text
pPassword_ =
CreateLoginProfile'
{ $sel:passwordResetRequired:CreateLoginProfile' :: Maybe Bool
passwordResetRequired =
forall a. Maybe a
Prelude.Nothing,
$sel:userName:CreateLoginProfile' :: Text
userName = Text
pUserName_,
$sel:password:CreateLoginProfile' :: Sensitive Text
password = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pPassword_
}
createLoginProfile_passwordResetRequired :: Lens.Lens' CreateLoginProfile (Prelude.Maybe Prelude.Bool)
createLoginProfile_passwordResetRequired :: Lens' CreateLoginProfile (Maybe Bool)
createLoginProfile_passwordResetRequired = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoginProfile' {Maybe Bool
passwordResetRequired :: Maybe Bool
$sel:passwordResetRequired:CreateLoginProfile' :: CreateLoginProfile -> Maybe Bool
passwordResetRequired} -> Maybe Bool
passwordResetRequired) (\s :: CreateLoginProfile
s@CreateLoginProfile' {} Maybe Bool
a -> CreateLoginProfile
s {$sel:passwordResetRequired:CreateLoginProfile' :: Maybe Bool
passwordResetRequired = Maybe Bool
a} :: CreateLoginProfile)
createLoginProfile_userName :: Lens.Lens' CreateLoginProfile Prelude.Text
createLoginProfile_userName :: Lens' CreateLoginProfile Text
createLoginProfile_userName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoginProfile' {Text
userName :: Text
$sel:userName:CreateLoginProfile' :: CreateLoginProfile -> Text
userName} -> Text
userName) (\s :: CreateLoginProfile
s@CreateLoginProfile' {} Text
a -> CreateLoginProfile
s {$sel:userName:CreateLoginProfile' :: Text
userName = Text
a} :: CreateLoginProfile)
createLoginProfile_password :: Lens.Lens' CreateLoginProfile Prelude.Text
createLoginProfile_password :: Lens' CreateLoginProfile Text
createLoginProfile_password = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoginProfile' {Sensitive Text
password :: Sensitive Text
$sel:password:CreateLoginProfile' :: CreateLoginProfile -> Sensitive Text
password} -> Sensitive Text
password) (\s :: CreateLoginProfile
s@CreateLoginProfile' {} Sensitive Text
a -> CreateLoginProfile
s {$sel:password:CreateLoginProfile' :: Sensitive Text
password = Sensitive Text
a} :: CreateLoginProfile) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Core.AWSRequest CreateLoginProfile where
type
AWSResponse CreateLoginProfile =
CreateLoginProfileResponse
request :: (Service -> Service)
-> CreateLoginProfile -> Request CreateLoginProfile
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 CreateLoginProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateLoginProfile)))
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
"CreateLoginProfileResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> LoginProfile -> CreateLoginProfileResponse
CreateLoginProfileResponse'
forall (f :: * -> *) a b. Functor 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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"LoginProfile")
)
instance Prelude.Hashable CreateLoginProfile where
hashWithSalt :: Int -> CreateLoginProfile -> Int
hashWithSalt Int
_salt CreateLoginProfile' {Maybe Bool
Text
Sensitive Text
password :: Sensitive Text
userName :: Text
passwordResetRequired :: Maybe Bool
$sel:password:CreateLoginProfile' :: CreateLoginProfile -> Sensitive Text
$sel:userName:CreateLoginProfile' :: CreateLoginProfile -> Text
$sel:passwordResetRequired:CreateLoginProfile' :: CreateLoginProfile -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
passwordResetRequired
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
userName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
password
instance Prelude.NFData CreateLoginProfile where
rnf :: CreateLoginProfile -> ()
rnf CreateLoginProfile' {Maybe Bool
Text
Sensitive Text
password :: Sensitive Text
userName :: Text
passwordResetRequired :: Maybe Bool
$sel:password:CreateLoginProfile' :: CreateLoginProfile -> Sensitive Text
$sel:userName:CreateLoginProfile' :: CreateLoginProfile -> Text
$sel:passwordResetRequired:CreateLoginProfile' :: CreateLoginProfile -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
passwordResetRequired
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
userName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
password
instance Data.ToHeaders CreateLoginProfile where
toHeaders :: CreateLoginProfile -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath CreateLoginProfile where
toPath :: CreateLoginProfile -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateLoginProfile where
toQuery :: CreateLoginProfile -> QueryString
toQuery CreateLoginProfile' {Maybe Bool
Text
Sensitive Text
password :: Sensitive Text
userName :: Text
passwordResetRequired :: Maybe Bool
$sel:password:CreateLoginProfile' :: CreateLoginProfile -> Sensitive Text
$sel:userName:CreateLoginProfile' :: CreateLoginProfile -> Text
$sel:passwordResetRequired:CreateLoginProfile' :: CreateLoginProfile -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateLoginProfile" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"PasswordResetRequired"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
passwordResetRequired,
ByteString
"UserName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
userName,
ByteString
"Password" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Sensitive Text
password
]
data CreateLoginProfileResponse = CreateLoginProfileResponse'
{
CreateLoginProfileResponse -> Int
httpStatus :: Prelude.Int,
CreateLoginProfileResponse -> LoginProfile
loginProfile :: LoginProfile
}
deriving (CreateLoginProfileResponse -> CreateLoginProfileResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLoginProfileResponse -> CreateLoginProfileResponse -> Bool
$c/= :: CreateLoginProfileResponse -> CreateLoginProfileResponse -> Bool
== :: CreateLoginProfileResponse -> CreateLoginProfileResponse -> Bool
$c== :: CreateLoginProfileResponse -> CreateLoginProfileResponse -> Bool
Prelude.Eq, ReadPrec [CreateLoginProfileResponse]
ReadPrec CreateLoginProfileResponse
Int -> ReadS CreateLoginProfileResponse
ReadS [CreateLoginProfileResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLoginProfileResponse]
$creadListPrec :: ReadPrec [CreateLoginProfileResponse]
readPrec :: ReadPrec CreateLoginProfileResponse
$creadPrec :: ReadPrec CreateLoginProfileResponse
readList :: ReadS [CreateLoginProfileResponse]
$creadList :: ReadS [CreateLoginProfileResponse]
readsPrec :: Int -> ReadS CreateLoginProfileResponse
$creadsPrec :: Int -> ReadS CreateLoginProfileResponse
Prelude.Read, Int -> CreateLoginProfileResponse -> ShowS
[CreateLoginProfileResponse] -> ShowS
CreateLoginProfileResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLoginProfileResponse] -> ShowS
$cshowList :: [CreateLoginProfileResponse] -> ShowS
show :: CreateLoginProfileResponse -> String
$cshow :: CreateLoginProfileResponse -> String
showsPrec :: Int -> CreateLoginProfileResponse -> ShowS
$cshowsPrec :: Int -> CreateLoginProfileResponse -> ShowS
Prelude.Show, forall x.
Rep CreateLoginProfileResponse x -> CreateLoginProfileResponse
forall x.
CreateLoginProfileResponse -> Rep CreateLoginProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLoginProfileResponse x -> CreateLoginProfileResponse
$cfrom :: forall x.
CreateLoginProfileResponse -> Rep CreateLoginProfileResponse x
Prelude.Generic)
newCreateLoginProfileResponse ::
Prelude.Int ->
LoginProfile ->
CreateLoginProfileResponse
newCreateLoginProfileResponse :: Int -> LoginProfile -> CreateLoginProfileResponse
newCreateLoginProfileResponse
Int
pHttpStatus_
LoginProfile
pLoginProfile_ =
CreateLoginProfileResponse'
{ $sel:httpStatus:CreateLoginProfileResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:loginProfile:CreateLoginProfileResponse' :: LoginProfile
loginProfile = LoginProfile
pLoginProfile_
}
createLoginProfileResponse_httpStatus :: Lens.Lens' CreateLoginProfileResponse Prelude.Int
createLoginProfileResponse_httpStatus :: Lens' CreateLoginProfileResponse Int
createLoginProfileResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoginProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateLoginProfileResponse' :: CreateLoginProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateLoginProfileResponse
s@CreateLoginProfileResponse' {} Int
a -> CreateLoginProfileResponse
s {$sel:httpStatus:CreateLoginProfileResponse' :: Int
httpStatus = Int
a} :: CreateLoginProfileResponse)
createLoginProfileResponse_loginProfile :: Lens.Lens' CreateLoginProfileResponse LoginProfile
createLoginProfileResponse_loginProfile :: Lens' CreateLoginProfileResponse LoginProfile
createLoginProfileResponse_loginProfile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoginProfileResponse' {LoginProfile
loginProfile :: LoginProfile
$sel:loginProfile:CreateLoginProfileResponse' :: CreateLoginProfileResponse -> LoginProfile
loginProfile} -> LoginProfile
loginProfile) (\s :: CreateLoginProfileResponse
s@CreateLoginProfileResponse' {} LoginProfile
a -> CreateLoginProfileResponse
s {$sel:loginProfile:CreateLoginProfileResponse' :: LoginProfile
loginProfile = LoginProfile
a} :: CreateLoginProfileResponse)
instance Prelude.NFData CreateLoginProfileResponse where
rnf :: CreateLoginProfileResponse -> ()
rnf CreateLoginProfileResponse' {Int
LoginProfile
loginProfile :: LoginProfile
httpStatus :: Int
$sel:loginProfile:CreateLoginProfileResponse' :: CreateLoginProfileResponse -> LoginProfile
$sel:httpStatus:CreateLoginProfileResponse' :: CreateLoginProfileResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf LoginProfile
loginProfile