{-# 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
, uupUserPoolTags
, uupVerificationMessageTemplate
, uupEmailVerificationMessage
, uupSmsAuthenticationMessage
, uupUserPoolAddOns
, uupEmailVerificationSubject
, uupEmailConfiguration
, uupSmsVerificationMessage
, uupMFAConfiguration
, uupLambdaConfig
, uupSmsConfiguration
, uupAdminCreateUserConfig
, 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'
{ _uupUserPoolTags :: !(Maybe (Map Text Text))
, _uupVerificationMessageTemplate :: !(Maybe VerificationMessageTemplateType)
, _uupEmailVerificationMessage :: !(Maybe Text)
, _uupSmsAuthenticationMessage :: !(Maybe Text)
, _uupUserPoolAddOns :: !(Maybe UserPoolAddOnsType)
, _uupEmailVerificationSubject :: !(Maybe Text)
, _uupEmailConfiguration :: !(Maybe EmailConfigurationType)
, _uupSmsVerificationMessage :: !(Maybe Text)
, _uupMFAConfiguration :: !(Maybe UserPoolMFAType)
, _uupLambdaConfig :: !(Maybe LambdaConfigType)
, _uupSmsConfiguration :: !(Maybe SmsConfigurationType)
, _uupAdminCreateUserConfig :: !(Maybe AdminCreateUserConfigType)
, _uupDeviceConfiguration :: !(Maybe DeviceConfigurationType)
, _uupAutoVerifiedAttributes :: !(Maybe [VerifiedAttributeType])
, _uupPolicies :: !(Maybe UserPoolPolicyType)
, _uupUserPoolId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateUserPool
:: Text
-> UpdateUserPool
updateUserPool pUserPoolId_ =
UpdateUserPool'
{ _uupUserPoolTags = Nothing
, _uupVerificationMessageTemplate = Nothing
, _uupEmailVerificationMessage = Nothing
, _uupSmsAuthenticationMessage = Nothing
, _uupUserPoolAddOns = Nothing
, _uupEmailVerificationSubject = Nothing
, _uupEmailConfiguration = Nothing
, _uupSmsVerificationMessage = Nothing
, _uupMFAConfiguration = Nothing
, _uupLambdaConfig = Nothing
, _uupSmsConfiguration = Nothing
, _uupAdminCreateUserConfig = Nothing
, _uupDeviceConfiguration = Nothing
, _uupAutoVerifiedAttributes = Nothing
, _uupPolicies = Nothing
, _uupUserPoolId = pUserPoolId_
}
uupUserPoolTags :: Lens' UpdateUserPool (HashMap Text Text)
uupUserPoolTags = lens _uupUserPoolTags (\ s a -> s{_uupUserPoolTags = a}) . _Default . _Map
uupVerificationMessageTemplate :: Lens' UpdateUserPool (Maybe VerificationMessageTemplateType)
uupVerificationMessageTemplate = lens _uupVerificationMessageTemplate (\ s a -> s{_uupVerificationMessageTemplate = a})
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})
uupUserPoolAddOns :: Lens' UpdateUserPool (Maybe UserPoolAddOnsType)
uupUserPoolAddOns = lens _uupUserPoolAddOns (\ s a -> s{_uupUserPoolAddOns = 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})
uupAdminCreateUserConfig :: Lens' UpdateUserPool (Maybe AdminCreateUserConfigType)
uupAdminCreateUserConfig = lens _uupAdminCreateUserConfig (\ s a -> s{_uupAdminCreateUserConfig = 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 where
instance NFData UpdateUserPool where
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
[("UserPoolTags" .=) <$> _uupUserPoolTags,
("VerificationMessageTemplate" .=) <$>
_uupVerificationMessageTemplate,
("EmailVerificationMessage" .=) <$>
_uupEmailVerificationMessage,
("SmsAuthenticationMessage" .=) <$>
_uupSmsAuthenticationMessage,
("UserPoolAddOns" .=) <$> _uupUserPoolAddOns,
("EmailVerificationSubject" .=) <$>
_uupEmailVerificationSubject,
("EmailConfiguration" .=) <$> _uupEmailConfiguration,
("SmsVerificationMessage" .=) <$>
_uupSmsVerificationMessage,
("MfaConfiguration" .=) <$> _uupMFAConfiguration,
("LambdaConfig" .=) <$> _uupLambdaConfig,
("SmsConfiguration" .=) <$> _uupSmsConfiguration,
("AdminCreateUserConfig" .=) <$>
_uupAdminCreateUserConfig,
("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 where