module Network.AWS.IAM.CreateLoginProfile
(
CreateLoginProfile
, createLoginProfile
, clpPassword
, clpPasswordResetRequired
, clpUserName
, CreateLoginProfileResponse
, createLoginProfileResponse
, clprLoginProfile
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.IAM.Types
import qualified GHC.Exts
data CreateLoginProfile = CreateLoginProfile
{ _clpPassword :: Sensitive Text
, _clpPasswordResetRequired :: Maybe Bool
, _clpUserName :: Text
} deriving (Eq, Ord, Show)
createLoginProfile :: Text
-> Text
-> CreateLoginProfile
createLoginProfile p1 p2 = CreateLoginProfile
{ _clpUserName = p1
, _clpPassword = withIso _Sensitive (const id) p2
, _clpPasswordResetRequired = Nothing
}
clpPassword :: Lens' CreateLoginProfile Text
clpPassword = lens _clpPassword (\s a -> s { _clpPassword = a }) . _Sensitive
clpPasswordResetRequired :: Lens' CreateLoginProfile (Maybe Bool)
clpPasswordResetRequired =
lens _clpPasswordResetRequired
(\s a -> s { _clpPasswordResetRequired = a })
clpUserName :: Lens' CreateLoginProfile Text
clpUserName = lens _clpUserName (\s a -> s { _clpUserName = a })
newtype CreateLoginProfileResponse = CreateLoginProfileResponse
{ _clprLoginProfile :: LoginProfile
} deriving (Eq, Show)
createLoginProfileResponse :: LoginProfile
-> CreateLoginProfileResponse
createLoginProfileResponse p1 = CreateLoginProfileResponse
{ _clprLoginProfile = p1
}
clprLoginProfile :: Lens' CreateLoginProfileResponse LoginProfile
clprLoginProfile = lens _clprLoginProfile (\s a -> s { _clprLoginProfile = a })
instance ToPath CreateLoginProfile where
toPath = const "/"
instance ToQuery CreateLoginProfile where
toQuery CreateLoginProfile{..} = mconcat
[ "Password" =? _clpPassword
, "PasswordResetRequired" =? _clpPasswordResetRequired
, "UserName" =? _clpUserName
]
instance ToHeaders CreateLoginProfile
instance AWSRequest CreateLoginProfile where
type Sv CreateLoginProfile = IAM
type Rs CreateLoginProfile = CreateLoginProfileResponse
request = post "CreateLoginProfile"
response = xmlResponse
instance FromXML CreateLoginProfileResponse where
parseXML = withElement "CreateLoginProfileResult" $ \x -> CreateLoginProfileResponse
<$> x .@ "LoginProfile"