{-# 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.UpdateUserPool
(
updateUserPool
, UpdateUserPool
, uupEmailVerificationMessage
, uupSmsAuthenticationMessage
, uupEmailVerificationSubject
, uupEmailConfiguration
, uupSmsVerificationMessage
, uupMFAConfiguration
, uupLambdaConfig
, uupSmsConfiguration
, uupDeviceConfiguration
, uupAutoVerifiedAttributes
, uupPolicies
, uupUserPoolId
, updateUserPoolResponse
, UpdateUserPoolResponse
, uuprsResponseStatus
) 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 UpdateUserPool = UpdateUserPool'
{ _uupEmailVerificationMessage :: !(Maybe Text)
, _uupSmsAuthenticationMessage :: !(Maybe Text)
, _uupEmailVerificationSubject :: !(Maybe Text)
, _uupEmailConfiguration :: !(Maybe EmailConfigurationType)
, _uupSmsVerificationMessage :: !(Maybe Text)
, _uupMFAConfiguration :: !(Maybe UserPoolMFAType)
, _uupLambdaConfig :: !(Maybe LambdaConfigType)
, _uupSmsConfiguration :: !(Maybe SmsConfigurationType)
, _uupDeviceConfiguration :: !(Maybe DeviceConfigurationType)
, _uupAutoVerifiedAttributes :: !(Maybe [VerifiedAttributeType])
, _uupPolicies :: !(Maybe UserPoolPolicyType)
, _uupUserPoolId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateUserPool
:: Text
-> UpdateUserPool
updateUserPool pUserPoolId_ =
UpdateUserPool'
{ _uupEmailVerificationMessage = Nothing
, _uupSmsAuthenticationMessage = Nothing
, _uupEmailVerificationSubject = Nothing
, _uupEmailConfiguration = Nothing
, _uupSmsVerificationMessage = Nothing
, _uupMFAConfiguration = Nothing
, _uupLambdaConfig = Nothing
, _uupSmsConfiguration = Nothing
, _uupDeviceConfiguration = Nothing
, _uupAutoVerifiedAttributes = Nothing
, _uupPolicies = Nothing
, _uupUserPoolId = pUserPoolId_
}
uupEmailVerificationMessage :: Lens' UpdateUserPool (Maybe Text)
uupEmailVerificationMessage = lens _uupEmailVerificationMessage (\ s a -> s{_uupEmailVerificationMessage = a});
uupSmsAuthenticationMessage :: Lens' UpdateUserPool (Maybe Text)
uupSmsAuthenticationMessage = lens _uupSmsAuthenticationMessage (\ s a -> s{_uupSmsAuthenticationMessage = a});
uupEmailVerificationSubject :: Lens' UpdateUserPool (Maybe Text)
uupEmailVerificationSubject = lens _uupEmailVerificationSubject (\ s a -> s{_uupEmailVerificationSubject = a});
uupEmailConfiguration :: Lens' UpdateUserPool (Maybe EmailConfigurationType)
uupEmailConfiguration = lens _uupEmailConfiguration (\ s a -> s{_uupEmailConfiguration = a});
uupSmsVerificationMessage :: Lens' UpdateUserPool (Maybe Text)
uupSmsVerificationMessage = lens _uupSmsVerificationMessage (\ s a -> s{_uupSmsVerificationMessage = a});
uupMFAConfiguration :: Lens' UpdateUserPool (Maybe UserPoolMFAType)
uupMFAConfiguration = lens _uupMFAConfiguration (\ s a -> s{_uupMFAConfiguration = a});
uupLambdaConfig :: Lens' UpdateUserPool (Maybe LambdaConfigType)
uupLambdaConfig = lens _uupLambdaConfig (\ s a -> s{_uupLambdaConfig = a});
uupSmsConfiguration :: Lens' UpdateUserPool (Maybe SmsConfigurationType)
uupSmsConfiguration = lens _uupSmsConfiguration (\ s a -> s{_uupSmsConfiguration = a});
uupDeviceConfiguration :: Lens' UpdateUserPool (Maybe DeviceConfigurationType)
uupDeviceConfiguration = lens _uupDeviceConfiguration (\ s a -> s{_uupDeviceConfiguration = a});
uupAutoVerifiedAttributes :: Lens' UpdateUserPool [VerifiedAttributeType]
uupAutoVerifiedAttributes = lens _uupAutoVerifiedAttributes (\ s a -> s{_uupAutoVerifiedAttributes = a}) . _Default . _Coerce;
uupPolicies :: Lens' UpdateUserPool (Maybe UserPoolPolicyType)
uupPolicies = lens _uupPolicies (\ s a -> s{_uupPolicies = a});
uupUserPoolId :: Lens' UpdateUserPool Text
uupUserPoolId = lens _uupUserPoolId (\ s a -> s{_uupUserPoolId = a});
instance AWSRequest UpdateUserPool where
type Rs UpdateUserPool = UpdateUserPoolResponse
request = postJSON cognitoIdentityProvider
response
= receiveEmpty
(\ s h x ->
UpdateUserPoolResponse' <$> (pure (fromEnum s)))
instance Hashable UpdateUserPool
instance NFData UpdateUserPool
instance ToHeaders UpdateUserPool where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityProviderService.UpdateUserPool"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateUserPool where
toJSON UpdateUserPool'{..}
= object
(catMaybes
[("EmailVerificationMessage" .=) <$>
_uupEmailVerificationMessage,
("SmsAuthenticationMessage" .=) <$>
_uupSmsAuthenticationMessage,
("EmailVerificationSubject" .=) <$>
_uupEmailVerificationSubject,
("EmailConfiguration" .=) <$> _uupEmailConfiguration,
("SmsVerificationMessage" .=) <$>
_uupSmsVerificationMessage,
("MfaConfiguration" .=) <$> _uupMFAConfiguration,
("LambdaConfig" .=) <$> _uupLambdaConfig,
("SmsConfiguration" .=) <$> _uupSmsConfiguration,
("DeviceConfiguration" .=) <$>
_uupDeviceConfiguration,
("AutoVerifiedAttributes" .=) <$>
_uupAutoVerifiedAttributes,
("Policies" .=) <$> _uupPolicies,
Just ("UserPoolId" .= _uupUserPoolId)])
instance ToPath UpdateUserPool where
toPath = const "/"
instance ToQuery UpdateUserPool where
toQuery = const mempty
newtype UpdateUserPoolResponse = UpdateUserPoolResponse'
{ _uuprsResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateUserPoolResponse
:: Int
-> UpdateUserPoolResponse
updateUserPoolResponse pResponseStatus_ =
UpdateUserPoolResponse'
{ _uuprsResponseStatus = pResponseStatus_
}
uuprsResponseStatus :: Lens' UpdateUserPoolResponse Int
uuprsResponseStatus = lens _uuprsResponseStatus (\ s a -> s{_uuprsResponseStatus = a});
instance NFData UpdateUserPoolResponse