{-# 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.CognitoIdentityProvider.SetUserPoolMFAConfig
(
setUserPoolMFAConfig
, SetUserPoolMFAConfig
, supmcSmsMFAConfiguration
, supmcSoftwareTokenMFAConfiguration
, supmcMFAConfiguration
, supmcUserPoolId
, setUserPoolMFAConfigResponse
, SetUserPoolMFAConfigResponse
, supmcrsSmsMFAConfiguration
, supmcrsSoftwareTokenMFAConfiguration
, supmcrsMFAConfiguration
, supmcrsResponseStatus
) where
import Network.AWS.CognitoIdentityProvider.Types
import Network.AWS.CognitoIdentityProvider.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data SetUserPoolMFAConfig = SetUserPoolMFAConfig'
{ _supmcSmsMFAConfiguration :: !(Maybe SmsMFAConfigType)
, _supmcSoftwareTokenMFAConfiguration :: !(Maybe SoftwareTokenMFAConfigType)
, _supmcMFAConfiguration :: !(Maybe UserPoolMFAType)
, _supmcUserPoolId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
setUserPoolMFAConfig
:: Text
-> SetUserPoolMFAConfig
setUserPoolMFAConfig pUserPoolId_ =
SetUserPoolMFAConfig'
{ _supmcSmsMFAConfiguration = Nothing
, _supmcSoftwareTokenMFAConfiguration = Nothing
, _supmcMFAConfiguration = Nothing
, _supmcUserPoolId = pUserPoolId_
}
supmcSmsMFAConfiguration :: Lens' SetUserPoolMFAConfig (Maybe SmsMFAConfigType)
supmcSmsMFAConfiguration = lens _supmcSmsMFAConfiguration (\ s a -> s{_supmcSmsMFAConfiguration = a})
supmcSoftwareTokenMFAConfiguration :: Lens' SetUserPoolMFAConfig (Maybe SoftwareTokenMFAConfigType)
supmcSoftwareTokenMFAConfiguration = lens _supmcSoftwareTokenMFAConfiguration (\ s a -> s{_supmcSoftwareTokenMFAConfiguration = a})
supmcMFAConfiguration :: Lens' SetUserPoolMFAConfig (Maybe UserPoolMFAType)
supmcMFAConfiguration = lens _supmcMFAConfiguration (\ s a -> s{_supmcMFAConfiguration = a})
supmcUserPoolId :: Lens' SetUserPoolMFAConfig Text
supmcUserPoolId = lens _supmcUserPoolId (\ s a -> s{_supmcUserPoolId = a})
instance AWSRequest SetUserPoolMFAConfig where
type Rs SetUserPoolMFAConfig =
SetUserPoolMFAConfigResponse
request = postJSON cognitoIdentityProvider
response
= receiveJSON
(\ s h x ->
SetUserPoolMFAConfigResponse' <$>
(x .?> "SmsMfaConfiguration") <*>
(x .?> "SoftwareTokenMfaConfiguration")
<*> (x .?> "MfaConfiguration")
<*> (pure (fromEnum s)))
instance Hashable SetUserPoolMFAConfig where
instance NFData SetUserPoolMFAConfig where
instance ToHeaders SetUserPoolMFAConfig where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityProviderService.SetUserPoolMfaConfig"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON SetUserPoolMFAConfig where
toJSON SetUserPoolMFAConfig'{..}
= object
(catMaybes
[("SmsMfaConfiguration" .=) <$>
_supmcSmsMFAConfiguration,
("SoftwareTokenMfaConfiguration" .=) <$>
_supmcSoftwareTokenMFAConfiguration,
("MfaConfiguration" .=) <$> _supmcMFAConfiguration,
Just ("UserPoolId" .= _supmcUserPoolId)])
instance ToPath SetUserPoolMFAConfig where
toPath = const "/"
instance ToQuery SetUserPoolMFAConfig where
toQuery = const mempty
data SetUserPoolMFAConfigResponse = SetUserPoolMFAConfigResponse'
{ _supmcrsSmsMFAConfiguration :: !(Maybe SmsMFAConfigType)
, _supmcrsSoftwareTokenMFAConfiguration :: !(Maybe SoftwareTokenMFAConfigType)
, _supmcrsMFAConfiguration :: !(Maybe UserPoolMFAType)
, _supmcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
setUserPoolMFAConfigResponse
:: Int
-> SetUserPoolMFAConfigResponse
setUserPoolMFAConfigResponse pResponseStatus_ =
SetUserPoolMFAConfigResponse'
{ _supmcrsSmsMFAConfiguration = Nothing
, _supmcrsSoftwareTokenMFAConfiguration = Nothing
, _supmcrsMFAConfiguration = Nothing
, _supmcrsResponseStatus = pResponseStatus_
}
supmcrsSmsMFAConfiguration :: Lens' SetUserPoolMFAConfigResponse (Maybe SmsMFAConfigType)
supmcrsSmsMFAConfiguration = lens _supmcrsSmsMFAConfiguration (\ s a -> s{_supmcrsSmsMFAConfiguration = a})
supmcrsSoftwareTokenMFAConfiguration :: Lens' SetUserPoolMFAConfigResponse (Maybe SoftwareTokenMFAConfigType)
supmcrsSoftwareTokenMFAConfiguration = lens _supmcrsSoftwareTokenMFAConfiguration (\ s a -> s{_supmcrsSoftwareTokenMFAConfiguration = a})
supmcrsMFAConfiguration :: Lens' SetUserPoolMFAConfigResponse (Maybe UserPoolMFAType)
supmcrsMFAConfiguration = lens _supmcrsMFAConfiguration (\ s a -> s{_supmcrsMFAConfiguration = a})
supmcrsResponseStatus :: Lens' SetUserPoolMFAConfigResponse Int
supmcrsResponseStatus = lens _supmcrsResponseStatus (\ s a -> s{_supmcrsResponseStatus = a})
instance NFData SetUserPoolMFAConfigResponse where