{-# 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.AdminUpdateUserAttributes
(
adminUpdateUserAttributes
, AdminUpdateUserAttributes
, auuaUserPoolId
, auuaUsername
, auuaUserAttributes
, adminUpdateUserAttributesResponse
, AdminUpdateUserAttributesResponse
, auuarsResponseStatus
) 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 AdminUpdateUserAttributes = AdminUpdateUserAttributes'
{ _auuaUserPoolId :: !Text
, _auuaUsername :: !(Sensitive Text)
, _auuaUserAttributes :: ![AttributeType]
} deriving (Eq, Show, Data, Typeable, Generic)
adminUpdateUserAttributes
:: Text
-> Text
-> AdminUpdateUserAttributes
adminUpdateUserAttributes pUserPoolId_ pUsername_ =
AdminUpdateUserAttributes'
{ _auuaUserPoolId = pUserPoolId_
, _auuaUsername = _Sensitive # pUsername_
, _auuaUserAttributes = mempty
}
auuaUserPoolId :: Lens' AdminUpdateUserAttributes Text
auuaUserPoolId = lens _auuaUserPoolId (\ s a -> s{_auuaUserPoolId = a})
auuaUsername :: Lens' AdminUpdateUserAttributes Text
auuaUsername = lens _auuaUsername (\ s a -> s{_auuaUsername = a}) . _Sensitive
auuaUserAttributes :: Lens' AdminUpdateUserAttributes [AttributeType]
auuaUserAttributes = lens _auuaUserAttributes (\ s a -> s{_auuaUserAttributes = a}) . _Coerce
instance AWSRequest AdminUpdateUserAttributes where
type Rs AdminUpdateUserAttributes =
AdminUpdateUserAttributesResponse
request = postJSON cognitoIdentityProvider
response
= receiveEmpty
(\ s h x ->
AdminUpdateUserAttributesResponse' <$>
(pure (fromEnum s)))
instance Hashable AdminUpdateUserAttributes where
instance NFData AdminUpdateUserAttributes where
instance ToHeaders AdminUpdateUserAttributes where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityProviderService.AdminUpdateUserAttributes"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AdminUpdateUserAttributes where
toJSON AdminUpdateUserAttributes'{..}
= object
(catMaybes
[Just ("UserPoolId" .= _auuaUserPoolId),
Just ("Username" .= _auuaUsername),
Just ("UserAttributes" .= _auuaUserAttributes)])
instance ToPath AdminUpdateUserAttributes where
toPath = const "/"
instance ToQuery AdminUpdateUserAttributes where
toQuery = const mempty
newtype AdminUpdateUserAttributesResponse = AdminUpdateUserAttributesResponse'
{ _auuarsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
adminUpdateUserAttributesResponse
:: Int
-> AdminUpdateUserAttributesResponse
adminUpdateUserAttributesResponse pResponseStatus_ =
AdminUpdateUserAttributesResponse' {_auuarsResponseStatus = pResponseStatus_}
auuarsResponseStatus :: Lens' AdminUpdateUserAttributesResponse Int
auuarsResponseStatus = lens _auuarsResponseStatus (\ s a -> s{_auuarsResponseStatus = a})
instance NFData AdminUpdateUserAttributesResponse
where