{-# 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.StopUserImportJob
(
stopUserImportJob
, StopUserImportJob
, sUserPoolId
, sJobId
, stopUserImportJobResponse
, StopUserImportJobResponse
, srsUserImportJob
, srsResponseStatus
) 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 StopUserImportJob = StopUserImportJob'
{ _sUserPoolId :: !Text
, _sJobId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
stopUserImportJob
:: Text
-> Text
-> StopUserImportJob
stopUserImportJob pUserPoolId_ pJobId_ =
StopUserImportJob'
{ _sUserPoolId = pUserPoolId_
, _sJobId = pJobId_
}
sUserPoolId :: Lens' StopUserImportJob Text
sUserPoolId = lens _sUserPoolId (\ s a -> s{_sUserPoolId = a});
sJobId :: Lens' StopUserImportJob Text
sJobId = lens _sJobId (\ s a -> s{_sJobId = a});
instance AWSRequest StopUserImportJob where
type Rs StopUserImportJob = StopUserImportJobResponse
request = postJSON cognitoIdentityProvider
response
= receiveJSON
(\ s h x ->
StopUserImportJobResponse' <$>
(x .?> "UserImportJob") <*> (pure (fromEnum s)))
instance Hashable StopUserImportJob
instance NFData StopUserImportJob
instance ToHeaders StopUserImportJob where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityProviderService.StopUserImportJob"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StopUserImportJob where
toJSON StopUserImportJob'{..}
= object
(catMaybes
[Just ("UserPoolId" .= _sUserPoolId),
Just ("JobId" .= _sJobId)])
instance ToPath StopUserImportJob where
toPath = const "/"
instance ToQuery StopUserImportJob where
toQuery = const mempty
data StopUserImportJobResponse = StopUserImportJobResponse'
{ _srsUserImportJob :: !(Maybe UserImportJobType)
, _srsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
stopUserImportJobResponse
:: Int
-> StopUserImportJobResponse
stopUserImportJobResponse pResponseStatus_ =
StopUserImportJobResponse'
{ _srsUserImportJob = Nothing
, _srsResponseStatus = pResponseStatus_
}
srsUserImportJob :: Lens' StopUserImportJobResponse (Maybe UserImportJobType)
srsUserImportJob = lens _srsUserImportJob (\ s a -> s{_srsUserImportJob = a});
srsResponseStatus :: Lens' StopUserImportJobResponse Int
srsResponseStatus = lens _srsResponseStatus (\ s a -> s{_srsResponseStatus = a});
instance NFData StopUserImportJobResponse