module Network.AWS.MachineLearning.GetBatchPrediction
(
getBatchPrediction
, GetBatchPrediction
, gbpBatchPredictionId
, getBatchPredictionResponse
, GetBatchPredictionResponse
, gbprsStatus
, gbprsLastUpdatedAt
, gbprsCreatedAt
, gbprsInputDataLocationS3
, gbprsMLModelId
, gbprsBatchPredictionDataSourceId
, gbprsBatchPredictionId
, gbprsCreatedByIAMUser
, gbprsName
, gbprsLogURI
, gbprsMessage
, gbprsOutputURI
, gbprsResponseStatus
) where
import Network.AWS.MachineLearning.Types
import Network.AWS.MachineLearning.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetBatchPrediction = GetBatchPrediction'
{ _gbpBatchPredictionId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getBatchPrediction
:: Text
-> GetBatchPrediction
getBatchPrediction pBatchPredictionId_ =
GetBatchPrediction'
{ _gbpBatchPredictionId = pBatchPredictionId_
}
gbpBatchPredictionId :: Lens' GetBatchPrediction Text
gbpBatchPredictionId = lens _gbpBatchPredictionId (\ s a -> s{_gbpBatchPredictionId = a});
instance AWSRequest GetBatchPrediction where
type Rs GetBatchPrediction =
GetBatchPredictionResponse
request = postJSON machineLearning
response
= receiveJSON
(\ s h x ->
GetBatchPredictionResponse' <$>
(x .?> "Status") <*> (x .?> "LastUpdatedAt") <*>
(x .?> "CreatedAt")
<*> (x .?> "InputDataLocationS3")
<*> (x .?> "MLModelId")
<*> (x .?> "BatchPredictionDataSourceId")
<*> (x .?> "BatchPredictionId")
<*> (x .?> "CreatedByIamUser")
<*> (x .?> "Name")
<*> (x .?> "LogUri")
<*> (x .?> "Message")
<*> (x .?> "OutputUri")
<*> (pure (fromEnum s)))
instance ToHeaders GetBatchPrediction where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonML_20141212.GetBatchPrediction" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetBatchPrediction where
toJSON GetBatchPrediction'{..}
= object
(catMaybes
[Just
("BatchPredictionId" .= _gbpBatchPredictionId)])
instance ToPath GetBatchPrediction where
toPath = const "/"
instance ToQuery GetBatchPrediction where
toQuery = const mempty
data GetBatchPredictionResponse = GetBatchPredictionResponse'
{ _gbprsStatus :: !(Maybe EntityStatus)
, _gbprsLastUpdatedAt :: !(Maybe POSIX)
, _gbprsCreatedAt :: !(Maybe POSIX)
, _gbprsInputDataLocationS3 :: !(Maybe Text)
, _gbprsMLModelId :: !(Maybe Text)
, _gbprsBatchPredictionDataSourceId :: !(Maybe Text)
, _gbprsBatchPredictionId :: !(Maybe Text)
, _gbprsCreatedByIAMUser :: !(Maybe Text)
, _gbprsName :: !(Maybe Text)
, _gbprsLogURI :: !(Maybe Text)
, _gbprsMessage :: !(Maybe Text)
, _gbprsOutputURI :: !(Maybe Text)
, _gbprsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getBatchPredictionResponse
:: Int
-> GetBatchPredictionResponse
getBatchPredictionResponse pResponseStatus_ =
GetBatchPredictionResponse'
{ _gbprsStatus = Nothing
, _gbprsLastUpdatedAt = Nothing
, _gbprsCreatedAt = Nothing
, _gbprsInputDataLocationS3 = Nothing
, _gbprsMLModelId = Nothing
, _gbprsBatchPredictionDataSourceId = Nothing
, _gbprsBatchPredictionId = Nothing
, _gbprsCreatedByIAMUser = Nothing
, _gbprsName = Nothing
, _gbprsLogURI = Nothing
, _gbprsMessage = Nothing
, _gbprsOutputURI = Nothing
, _gbprsResponseStatus = pResponseStatus_
}
gbprsStatus :: Lens' GetBatchPredictionResponse (Maybe EntityStatus)
gbprsStatus = lens _gbprsStatus (\ s a -> s{_gbprsStatus = a});
gbprsLastUpdatedAt :: Lens' GetBatchPredictionResponse (Maybe UTCTime)
gbprsLastUpdatedAt = lens _gbprsLastUpdatedAt (\ s a -> s{_gbprsLastUpdatedAt = a}) . mapping _Time;
gbprsCreatedAt :: Lens' GetBatchPredictionResponse (Maybe UTCTime)
gbprsCreatedAt = lens _gbprsCreatedAt (\ s a -> s{_gbprsCreatedAt = a}) . mapping _Time;
gbprsInputDataLocationS3 :: Lens' GetBatchPredictionResponse (Maybe Text)
gbprsInputDataLocationS3 = lens _gbprsInputDataLocationS3 (\ s a -> s{_gbprsInputDataLocationS3 = a});
gbprsMLModelId :: Lens' GetBatchPredictionResponse (Maybe Text)
gbprsMLModelId = lens _gbprsMLModelId (\ s a -> s{_gbprsMLModelId = a});
gbprsBatchPredictionDataSourceId :: Lens' GetBatchPredictionResponse (Maybe Text)
gbprsBatchPredictionDataSourceId = lens _gbprsBatchPredictionDataSourceId (\ s a -> s{_gbprsBatchPredictionDataSourceId = a});
gbprsBatchPredictionId :: Lens' GetBatchPredictionResponse (Maybe Text)
gbprsBatchPredictionId = lens _gbprsBatchPredictionId (\ s a -> s{_gbprsBatchPredictionId = a});
gbprsCreatedByIAMUser :: Lens' GetBatchPredictionResponse (Maybe Text)
gbprsCreatedByIAMUser = lens _gbprsCreatedByIAMUser (\ s a -> s{_gbprsCreatedByIAMUser = a});
gbprsName :: Lens' GetBatchPredictionResponse (Maybe Text)
gbprsName = lens _gbprsName (\ s a -> s{_gbprsName = a});
gbprsLogURI :: Lens' GetBatchPredictionResponse (Maybe Text)
gbprsLogURI = lens _gbprsLogURI (\ s a -> s{_gbprsLogURI = a});
gbprsMessage :: Lens' GetBatchPredictionResponse (Maybe Text)
gbprsMessage = lens _gbprsMessage (\ s a -> s{_gbprsMessage = a});
gbprsOutputURI :: Lens' GetBatchPredictionResponse (Maybe Text)
gbprsOutputURI = lens _gbprsOutputURI (\ s a -> s{_gbprsOutputURI = a});
gbprsResponseStatus :: Lens' GetBatchPredictionResponse Int
gbprsResponseStatus = lens _gbprsResponseStatus (\ s a -> s{_gbprsResponseStatus = a});