{-# 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.StartUserImportJob
(
startUserImportJob
, StartUserImportJob
, suijUserPoolId
, suijJobId
, startUserImportJobResponse
, StartUserImportJobResponse
, suijrsUserImportJob
, suijrsResponseStatus
) 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 StartUserImportJob = StartUserImportJob'
{ _suijUserPoolId :: !Text
, _suijJobId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startUserImportJob
:: Text
-> Text
-> StartUserImportJob
startUserImportJob pUserPoolId_ pJobId_ =
StartUserImportJob' {_suijUserPoolId = pUserPoolId_, _suijJobId = pJobId_}
suijUserPoolId :: Lens' StartUserImportJob Text
suijUserPoolId = lens _suijUserPoolId (\ s a -> s{_suijUserPoolId = a})
suijJobId :: Lens' StartUserImportJob Text
suijJobId = lens _suijJobId (\ s a -> s{_suijJobId = a})
instance AWSRequest StartUserImportJob where
type Rs StartUserImportJob =
StartUserImportJobResponse
request = postJSON cognitoIdentityProvider
response
= receiveJSON
(\ s h x ->
StartUserImportJobResponse' <$>
(x .?> "UserImportJob") <*> (pure (fromEnum s)))
instance Hashable StartUserImportJob where
instance NFData StartUserImportJob where
instance ToHeaders StartUserImportJob where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityProviderService.StartUserImportJob"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StartUserImportJob where
toJSON StartUserImportJob'{..}
= object
(catMaybes
[Just ("UserPoolId" .= _suijUserPoolId),
Just ("JobId" .= _suijJobId)])
instance ToPath StartUserImportJob where
toPath = const "/"
instance ToQuery StartUserImportJob where
toQuery = const mempty
data StartUserImportJobResponse = StartUserImportJobResponse'
{ _suijrsUserImportJob :: !(Maybe UserImportJobType)
, _suijrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startUserImportJobResponse
:: Int
-> StartUserImportJobResponse
startUserImportJobResponse pResponseStatus_ =
StartUserImportJobResponse'
{_suijrsUserImportJob = Nothing, _suijrsResponseStatus = pResponseStatus_}
suijrsUserImportJob :: Lens' StartUserImportJobResponse (Maybe UserImportJobType)
suijrsUserImportJob = lens _suijrsUserImportJob (\ s a -> s{_suijrsUserImportJob = a})
suijrsResponseStatus :: Lens' StartUserImportJobResponse Int
suijrsResponseStatus = lens _suijrsResponseStatus (\ s a -> s{_suijrsResponseStatus = a})
instance NFData StartUserImportJobResponse where