{-# 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.UpdateAuthEventFeedback
(
updateAuthEventFeedback
, UpdateAuthEventFeedback
, uaefUserPoolId
, uaefUsername
, uaefEventId
, uaefFeedbackToken
, uaefFeedbackValue
, updateAuthEventFeedbackResponse
, UpdateAuthEventFeedbackResponse
, uaefrsResponseStatus
) 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 UpdateAuthEventFeedback = UpdateAuthEventFeedback'
{ _uaefUserPoolId :: !Text
, _uaefUsername :: !(Sensitive Text)
, _uaefEventId :: !Text
, _uaefFeedbackToken :: !(Sensitive Text)
, _uaefFeedbackValue :: !FeedbackValueType
} deriving (Eq, Show, Data, Typeable, Generic)
updateAuthEventFeedback
:: Text
-> Text
-> Text
-> Text
-> FeedbackValueType
-> UpdateAuthEventFeedback
updateAuthEventFeedback pUserPoolId_ pUsername_ pEventId_ pFeedbackToken_ pFeedbackValue_ =
UpdateAuthEventFeedback'
{ _uaefUserPoolId = pUserPoolId_
, _uaefUsername = _Sensitive # pUsername_
, _uaefEventId = pEventId_
, _uaefFeedbackToken = _Sensitive # pFeedbackToken_
, _uaefFeedbackValue = pFeedbackValue_
}
uaefUserPoolId :: Lens' UpdateAuthEventFeedback Text
uaefUserPoolId = lens _uaefUserPoolId (\ s a -> s{_uaefUserPoolId = a})
uaefUsername :: Lens' UpdateAuthEventFeedback Text
uaefUsername = lens _uaefUsername (\ s a -> s{_uaefUsername = a}) . _Sensitive
uaefEventId :: Lens' UpdateAuthEventFeedback Text
uaefEventId = lens _uaefEventId (\ s a -> s{_uaefEventId = a})
uaefFeedbackToken :: Lens' UpdateAuthEventFeedback Text
uaefFeedbackToken = lens _uaefFeedbackToken (\ s a -> s{_uaefFeedbackToken = a}) . _Sensitive
uaefFeedbackValue :: Lens' UpdateAuthEventFeedback FeedbackValueType
uaefFeedbackValue = lens _uaefFeedbackValue (\ s a -> s{_uaefFeedbackValue = a})
instance AWSRequest UpdateAuthEventFeedback where
type Rs UpdateAuthEventFeedback =
UpdateAuthEventFeedbackResponse
request = postJSON cognitoIdentityProvider
response
= receiveEmpty
(\ s h x ->
UpdateAuthEventFeedbackResponse' <$>
(pure (fromEnum s)))
instance Hashable UpdateAuthEventFeedback where
instance NFData UpdateAuthEventFeedback where
instance ToHeaders UpdateAuthEventFeedback where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityProviderService.UpdateAuthEventFeedback"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateAuthEventFeedback where
toJSON UpdateAuthEventFeedback'{..}
= object
(catMaybes
[Just ("UserPoolId" .= _uaefUserPoolId),
Just ("Username" .= _uaefUsername),
Just ("EventId" .= _uaefEventId),
Just ("FeedbackToken" .= _uaefFeedbackToken),
Just ("FeedbackValue" .= _uaefFeedbackValue)])
instance ToPath UpdateAuthEventFeedback where
toPath = const "/"
instance ToQuery UpdateAuthEventFeedback where
toQuery = const mempty
newtype UpdateAuthEventFeedbackResponse = UpdateAuthEventFeedbackResponse'
{ _uaefrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateAuthEventFeedbackResponse
:: Int
-> UpdateAuthEventFeedbackResponse
updateAuthEventFeedbackResponse pResponseStatus_ =
UpdateAuthEventFeedbackResponse' {_uaefrsResponseStatus = pResponseStatus_}
uaefrsResponseStatus :: Lens' UpdateAuthEventFeedbackResponse Int
uaefrsResponseStatus = lens _uaefrsResponseStatus (\ s a -> s{_uaefrsResponseStatus = a})
instance NFData UpdateAuthEventFeedbackResponse where