module Network.AWS.CognitoIdentityProvider.ResendConfirmationCode
(
resendConfirmationCode
, ResendConfirmationCode
, rccSecretHash
, rccClientId
, rccUsername
, resendConfirmationCodeResponse
, ResendConfirmationCodeResponse
, rccrsCodeDeliveryDetails
, rccrsResponseStatus
) 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 ResendConfirmationCode = ResendConfirmationCode'
{ _rccSecretHash :: !(Maybe (Sensitive Text))
, _rccClientId :: !(Sensitive Text)
, _rccUsername :: !(Sensitive Text)
} deriving (Eq, Show, Data, Typeable, Generic)
resendConfirmationCode
:: Text
-> Text
-> ResendConfirmationCode
resendConfirmationCode pClientId_ pUsername_ =
ResendConfirmationCode'
{ _rccSecretHash = Nothing
, _rccClientId = _Sensitive # pClientId_
, _rccUsername = _Sensitive # pUsername_
}
rccSecretHash :: Lens' ResendConfirmationCode (Maybe Text)
rccSecretHash = lens _rccSecretHash (\ s a -> s{_rccSecretHash = a}) . mapping _Sensitive;
rccClientId :: Lens' ResendConfirmationCode Text
rccClientId = lens _rccClientId (\ s a -> s{_rccClientId = a}) . _Sensitive;
rccUsername :: Lens' ResendConfirmationCode Text
rccUsername = lens _rccUsername (\ s a -> s{_rccUsername = a}) . _Sensitive;
instance AWSRequest ResendConfirmationCode where
type Rs ResendConfirmationCode =
ResendConfirmationCodeResponse
request = postJSON cognitoIdentityProvider
response
= receiveJSON
(\ s h x ->
ResendConfirmationCodeResponse' <$>
(x .?> "CodeDeliveryDetails") <*>
(pure (fromEnum s)))
instance Hashable ResendConfirmationCode where
instance NFData ResendConfirmationCode where
instance ToHeaders ResendConfirmationCode where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityProviderService.ResendConfirmationCode"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ResendConfirmationCode where
toJSON ResendConfirmationCode'{..}
= object
(catMaybes
[("SecretHash" .=) <$> _rccSecretHash,
Just ("ClientId" .= _rccClientId),
Just ("Username" .= _rccUsername)])
instance ToPath ResendConfirmationCode where
toPath = const "/"
instance ToQuery ResendConfirmationCode where
toQuery = const mempty
data ResendConfirmationCodeResponse = ResendConfirmationCodeResponse'
{ _rccrsCodeDeliveryDetails :: !(Maybe CodeDeliveryDetailsType)
, _rccrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
resendConfirmationCodeResponse
:: Int
-> ResendConfirmationCodeResponse
resendConfirmationCodeResponse pResponseStatus_ =
ResendConfirmationCodeResponse'
{_rccrsCodeDeliveryDetails = Nothing, _rccrsResponseStatus = pResponseStatus_}
rccrsCodeDeliveryDetails :: Lens' ResendConfirmationCodeResponse (Maybe CodeDeliveryDetailsType)
rccrsCodeDeliveryDetails = lens _rccrsCodeDeliveryDetails (\ s a -> s{_rccrsCodeDeliveryDetails = a});
rccrsResponseStatus :: Lens' ResendConfirmationCodeResponse Int
rccrsResponseStatus = lens _rccrsResponseStatus (\ s a -> s{_rccrsResponseStatus = a});
instance NFData ResendConfirmationCodeResponse where