{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.DirectoryService.EnableSSO
(
enableSSO
, EnableSSO
, esUserName
, esPassword
, esDirectoryId
, enableSSOResponse
, EnableSSOResponse
, esrsResponseStatus
) where
import Network.AWS.DirectoryService.Types
import Network.AWS.DirectoryService.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data EnableSSO = EnableSSO'
{ _esUserName :: !(Maybe Text)
, _esPassword :: !(Maybe (Sensitive Text))
, _esDirectoryId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
enableSSO
:: Text
-> EnableSSO
enableSSO pDirectoryId_ =
EnableSSO'
{ _esUserName = Nothing
, _esPassword = Nothing
, _esDirectoryId = pDirectoryId_
}
esUserName :: Lens' EnableSSO (Maybe Text)
esUserName = lens _esUserName (\ s a -> s{_esUserName = a});
esPassword :: Lens' EnableSSO (Maybe Text)
esPassword = lens _esPassword (\ s a -> s{_esPassword = a}) . mapping _Sensitive;
esDirectoryId :: Lens' EnableSSO Text
esDirectoryId = lens _esDirectoryId (\ s a -> s{_esDirectoryId = a});
instance AWSRequest EnableSSO where
type Rs EnableSSO = EnableSSOResponse
request = postJSON directoryService
response
= receiveEmpty
(\ s h x ->
EnableSSOResponse' <$> (pure (fromEnum s)))
instance Hashable EnableSSO
instance NFData EnableSSO
instance ToHeaders EnableSSO where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DirectoryService_20150416.EnableSso" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON EnableSSO where
toJSON EnableSSO'{..}
= object
(catMaybes
[("UserName" .=) <$> _esUserName,
("Password" .=) <$> _esPassword,
Just ("DirectoryId" .= _esDirectoryId)])
instance ToPath EnableSSO where
toPath = const "/"
instance ToQuery EnableSSO where
toQuery = const mempty
newtype EnableSSOResponse = EnableSSOResponse'
{ _esrsResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
enableSSOResponse
:: Int
-> EnableSSOResponse
enableSSOResponse pResponseStatus_ =
EnableSSOResponse'
{ _esrsResponseStatus = pResponseStatus_
}
esrsResponseStatus :: Lens' EnableSSOResponse Int
esrsResponseStatus = lens _esrsResponseStatus (\ s a -> s{_esrsResponseStatus = a});
instance NFData EnableSSOResponse