{-# 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.Pinpoint.CreateExportJob
(
createExportJob
, CreateExportJob
, cejApplicationId
, cejExportJobRequest
, createExportJobResponse
, CreateExportJobResponse
, cejrsResponseStatus
, cejrsExportJobResponse
) where
import Network.AWS.Lens
import Network.AWS.Pinpoint.Types
import Network.AWS.Pinpoint.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CreateExportJob = CreateExportJob'
{ _cejApplicationId :: !Text
, _cejExportJobRequest :: !ExportJobRequest
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createExportJob
:: Text
-> ExportJobRequest
-> CreateExportJob
createExportJob pApplicationId_ pExportJobRequest_ =
CreateExportJob'
{ _cejApplicationId = pApplicationId_
, _cejExportJobRequest = pExportJobRequest_
}
cejApplicationId :: Lens' CreateExportJob Text
cejApplicationId = lens _cejApplicationId (\ s a -> s{_cejApplicationId = a})
cejExportJobRequest :: Lens' CreateExportJob ExportJobRequest
cejExportJobRequest = lens _cejExportJobRequest (\ s a -> s{_cejExportJobRequest = a})
instance AWSRequest CreateExportJob where
type Rs CreateExportJob = CreateExportJobResponse
request = postJSON pinpoint
response
= receiveJSON
(\ s h x ->
CreateExportJobResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable CreateExportJob where
instance NFData CreateExportJob where
instance ToHeaders CreateExportJob where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateExportJob where
toJSON CreateExportJob'{..}
= object
(catMaybes
[Just ("ExportJobRequest" .= _cejExportJobRequest)])
instance ToPath CreateExportJob where
toPath CreateExportJob'{..}
= mconcat
["/v1/apps/", toBS _cejApplicationId, "/jobs/export"]
instance ToQuery CreateExportJob where
toQuery = const mempty
data CreateExportJobResponse = CreateExportJobResponse'
{ _cejrsResponseStatus :: !Int
, _cejrsExportJobResponse :: !ExportJobResponse
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createExportJobResponse
:: Int
-> ExportJobResponse
-> CreateExportJobResponse
createExportJobResponse pResponseStatus_ pExportJobResponse_ =
CreateExportJobResponse'
{ _cejrsResponseStatus = pResponseStatus_
, _cejrsExportJobResponse = pExportJobResponse_
}
cejrsResponseStatus :: Lens' CreateExportJobResponse Int
cejrsResponseStatus = lens _cejrsResponseStatus (\ s a -> s{_cejrsResponseStatus = a})
cejrsExportJobResponse :: Lens' CreateExportJobResponse ExportJobResponse
cejrsExportJobResponse = lens _cejrsExportJobResponse (\ s a -> s{_cejrsExportJobResponse = a})
instance NFData CreateExportJobResponse where