{-# 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.GetUserPoolMFAConfig
(
getUserPoolMFAConfig
, GetUserPoolMFAConfig
, gupmcUserPoolId
, getUserPoolMFAConfigResponse
, GetUserPoolMFAConfigResponse
, gupmcrsSmsMFAConfiguration
, gupmcrsSoftwareTokenMFAConfiguration
, gupmcrsMFAConfiguration
, gupmcrsResponseStatus
) 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
newtype GetUserPoolMFAConfig = GetUserPoolMFAConfig'
{ _gupmcUserPoolId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getUserPoolMFAConfig
:: Text
-> GetUserPoolMFAConfig
getUserPoolMFAConfig pUserPoolId_ =
GetUserPoolMFAConfig' {_gupmcUserPoolId = pUserPoolId_}
gupmcUserPoolId :: Lens' GetUserPoolMFAConfig Text
gupmcUserPoolId = lens _gupmcUserPoolId (\ s a -> s{_gupmcUserPoolId = a})
instance AWSRequest GetUserPoolMFAConfig where
type Rs GetUserPoolMFAConfig =
GetUserPoolMFAConfigResponse
request = postJSON cognitoIdentityProvider
response
= receiveJSON
(\ s h x ->
GetUserPoolMFAConfigResponse' <$>
(x .?> "SmsMfaConfiguration") <*>
(x .?> "SoftwareTokenMfaConfiguration")
<*> (x .?> "MfaConfiguration")
<*> (pure (fromEnum s)))
instance Hashable GetUserPoolMFAConfig where
instance NFData GetUserPoolMFAConfig where
instance ToHeaders GetUserPoolMFAConfig where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityProviderService.GetUserPoolMfaConfig"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetUserPoolMFAConfig where
toJSON GetUserPoolMFAConfig'{..}
= object
(catMaybes [Just ("UserPoolId" .= _gupmcUserPoolId)])
instance ToPath GetUserPoolMFAConfig where
toPath = const "/"
instance ToQuery GetUserPoolMFAConfig where
toQuery = const mempty
data GetUserPoolMFAConfigResponse = GetUserPoolMFAConfigResponse'
{ _gupmcrsSmsMFAConfiguration :: !(Maybe SmsMFAConfigType)
, _gupmcrsSoftwareTokenMFAConfiguration :: !(Maybe SoftwareTokenMFAConfigType)
, _gupmcrsMFAConfiguration :: !(Maybe UserPoolMFAType)
, _gupmcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getUserPoolMFAConfigResponse
:: Int
-> GetUserPoolMFAConfigResponse
getUserPoolMFAConfigResponse pResponseStatus_ =
GetUserPoolMFAConfigResponse'
{ _gupmcrsSmsMFAConfiguration = Nothing
, _gupmcrsSoftwareTokenMFAConfiguration = Nothing
, _gupmcrsMFAConfiguration = Nothing
, _gupmcrsResponseStatus = pResponseStatus_
}
gupmcrsSmsMFAConfiguration :: Lens' GetUserPoolMFAConfigResponse (Maybe SmsMFAConfigType)
gupmcrsSmsMFAConfiguration = lens _gupmcrsSmsMFAConfiguration (\ s a -> s{_gupmcrsSmsMFAConfiguration = a})
gupmcrsSoftwareTokenMFAConfiguration :: Lens' GetUserPoolMFAConfigResponse (Maybe SoftwareTokenMFAConfigType)
gupmcrsSoftwareTokenMFAConfiguration = lens _gupmcrsSoftwareTokenMFAConfiguration (\ s a -> s{_gupmcrsSoftwareTokenMFAConfiguration = a})
gupmcrsMFAConfiguration :: Lens' GetUserPoolMFAConfigResponse (Maybe UserPoolMFAType)
gupmcrsMFAConfiguration = lens _gupmcrsMFAConfiguration (\ s a -> s{_gupmcrsMFAConfiguration = a})
gupmcrsResponseStatus :: Lens' GetUserPoolMFAConfigResponse Int
gupmcrsResponseStatus = lens _gupmcrsResponseStatus (\ s a -> s{_gupmcrsResponseStatus = a})
instance NFData GetUserPoolMFAConfigResponse where