module Network.AWS.MachineLearning.CreateBatchPrediction
(
createBatchPrediction
, CreateBatchPrediction
, cbpBatchPredictionName
, cbpBatchPredictionId
, cbpMLModelId
, cbpBatchPredictionDataSourceId
, cbpOutputURI
, createBatchPredictionResponse
, CreateBatchPredictionResponse
, cbprsBatchPredictionId
, cbprsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.MachineLearning.Types
import Network.AWS.MachineLearning.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CreateBatchPrediction = CreateBatchPrediction'
{ _cbpBatchPredictionName :: !(Maybe Text)
, _cbpBatchPredictionId :: !Text
, _cbpMLModelId :: !Text
, _cbpBatchPredictionDataSourceId :: !Text
, _cbpOutputURI :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createBatchPrediction
:: Text
-> Text
-> Text
-> Text
-> CreateBatchPrediction
createBatchPrediction pBatchPredictionId_ pMLModelId_ pBatchPredictionDataSourceId_ pOutputURI_ =
CreateBatchPrediction'
{ _cbpBatchPredictionName = Nothing
, _cbpBatchPredictionId = pBatchPredictionId_
, _cbpMLModelId = pMLModelId_
, _cbpBatchPredictionDataSourceId = pBatchPredictionDataSourceId_
, _cbpOutputURI = pOutputURI_
}
cbpBatchPredictionName :: Lens' CreateBatchPrediction (Maybe Text)
cbpBatchPredictionName = lens _cbpBatchPredictionName (\ s a -> s{_cbpBatchPredictionName = a});
cbpBatchPredictionId :: Lens' CreateBatchPrediction Text
cbpBatchPredictionId = lens _cbpBatchPredictionId (\ s a -> s{_cbpBatchPredictionId = a});
cbpMLModelId :: Lens' CreateBatchPrediction Text
cbpMLModelId = lens _cbpMLModelId (\ s a -> s{_cbpMLModelId = a});
cbpBatchPredictionDataSourceId :: Lens' CreateBatchPrediction Text
cbpBatchPredictionDataSourceId = lens _cbpBatchPredictionDataSourceId (\ s a -> s{_cbpBatchPredictionDataSourceId = a});
cbpOutputURI :: Lens' CreateBatchPrediction Text
cbpOutputURI = lens _cbpOutputURI (\ s a -> s{_cbpOutputURI = a});
instance AWSRequest CreateBatchPrediction where
type Rs CreateBatchPrediction =
CreateBatchPredictionResponse
request = postJSON machineLearning
response
= receiveJSON
(\ s h x ->
CreateBatchPredictionResponse' <$>
(x .?> "BatchPredictionId") <*> (pure (fromEnum s)))
instance Hashable CreateBatchPrediction
instance NFData CreateBatchPrediction
instance ToHeaders CreateBatchPrediction where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonML_20141212.CreateBatchPrediction" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateBatchPrediction where
toJSON CreateBatchPrediction'{..}
= object
(catMaybes
[("BatchPredictionName" .=) <$>
_cbpBatchPredictionName,
Just ("BatchPredictionId" .= _cbpBatchPredictionId),
Just ("MLModelId" .= _cbpMLModelId),
Just
("BatchPredictionDataSourceId" .=
_cbpBatchPredictionDataSourceId),
Just ("OutputUri" .= _cbpOutputURI)])
instance ToPath CreateBatchPrediction where
toPath = const "/"
instance ToQuery CreateBatchPrediction where
toQuery = const mempty
data CreateBatchPredictionResponse = CreateBatchPredictionResponse'
{ _cbprsBatchPredictionId :: !(Maybe Text)
, _cbprsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createBatchPredictionResponse
:: Int
-> CreateBatchPredictionResponse
createBatchPredictionResponse pResponseStatus_ =
CreateBatchPredictionResponse'
{ _cbprsBatchPredictionId = Nothing
, _cbprsResponseStatus = pResponseStatus_
}
cbprsBatchPredictionId :: Lens' CreateBatchPredictionResponse (Maybe Text)
cbprsBatchPredictionId = lens _cbprsBatchPredictionId (\ s a -> s{_cbprsBatchPredictionId = a});
cbprsResponseStatus :: Lens' CreateBatchPredictionResponse Int
cbprsResponseStatus = lens _cbprsResponseStatus (\ s a -> s{_cbprsResponseStatus = a});
instance NFData CreateBatchPredictionResponse