module Network.AWS.MachineLearning.DescribeBatchPredictions
(
describeBatchPredictions
, DescribeBatchPredictions
, dbpEQ
, dbpGE
, dbpPrefix
, dbpGT
, dbpNE
, dbpNextToken
, dbpSortOrder
, dbpLimit
, dbpLT
, dbpFilterVariable
, dbpLE
, describeBatchPredictionsResponse
, DescribeBatchPredictionsResponse
, drsResults
, drsNextToken
, drsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.MachineLearning.Types
import Network.AWS.MachineLearning.Types.Product
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DescribeBatchPredictions = DescribeBatchPredictions'
{ _dbpEQ :: !(Maybe Text)
, _dbpGE :: !(Maybe Text)
, _dbpPrefix :: !(Maybe Text)
, _dbpGT :: !(Maybe Text)
, _dbpNE :: !(Maybe Text)
, _dbpNextToken :: !(Maybe Text)
, _dbpSortOrder :: !(Maybe SortOrder)
, _dbpLimit :: !(Maybe Nat)
, _dbpLT :: !(Maybe Text)
, _dbpFilterVariable :: !(Maybe BatchPredictionFilterVariable)
, _dbpLE :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeBatchPredictions
:: DescribeBatchPredictions
describeBatchPredictions =
DescribeBatchPredictions'
{ _dbpEQ = Nothing
, _dbpGE = Nothing
, _dbpPrefix = Nothing
, _dbpGT = Nothing
, _dbpNE = Nothing
, _dbpNextToken = Nothing
, _dbpSortOrder = Nothing
, _dbpLimit = Nothing
, _dbpLT = Nothing
, _dbpFilterVariable = Nothing
, _dbpLE = Nothing
}
dbpEQ :: Lens' DescribeBatchPredictions (Maybe Text)
dbpEQ = lens _dbpEQ (\ s a -> s{_dbpEQ = a});
dbpGE :: Lens' DescribeBatchPredictions (Maybe Text)
dbpGE = lens _dbpGE (\ s a -> s{_dbpGE = a});
dbpPrefix :: Lens' DescribeBatchPredictions (Maybe Text)
dbpPrefix = lens _dbpPrefix (\ s a -> s{_dbpPrefix = a});
dbpGT :: Lens' DescribeBatchPredictions (Maybe Text)
dbpGT = lens _dbpGT (\ s a -> s{_dbpGT = a});
dbpNE :: Lens' DescribeBatchPredictions (Maybe Text)
dbpNE = lens _dbpNE (\ s a -> s{_dbpNE = a});
dbpNextToken :: Lens' DescribeBatchPredictions (Maybe Text)
dbpNextToken = lens _dbpNextToken (\ s a -> s{_dbpNextToken = a});
dbpSortOrder :: Lens' DescribeBatchPredictions (Maybe SortOrder)
dbpSortOrder = lens _dbpSortOrder (\ s a -> s{_dbpSortOrder = a});
dbpLimit :: Lens' DescribeBatchPredictions (Maybe Natural)
dbpLimit = lens _dbpLimit (\ s a -> s{_dbpLimit = a}) . mapping _Nat;
dbpLT :: Lens' DescribeBatchPredictions (Maybe Text)
dbpLT = lens _dbpLT (\ s a -> s{_dbpLT = a});
dbpFilterVariable :: Lens' DescribeBatchPredictions (Maybe BatchPredictionFilterVariable)
dbpFilterVariable = lens _dbpFilterVariable (\ s a -> s{_dbpFilterVariable = a});
dbpLE :: Lens' DescribeBatchPredictions (Maybe Text)
dbpLE = lens _dbpLE (\ s a -> s{_dbpLE = a});
instance AWSPager DescribeBatchPredictions where
page rq rs
| stop (rs ^. drsNextToken) = Nothing
| stop (rs ^. drsResults) = Nothing
| otherwise =
Just $ rq & dbpNextToken .~ rs ^. drsNextToken
instance AWSRequest DescribeBatchPredictions where
type Rs DescribeBatchPredictions =
DescribeBatchPredictionsResponse
request = postJSON machineLearning
response
= receiveJSON
(\ s h x ->
DescribeBatchPredictionsResponse' <$>
(x .?> "Results" .!@ mempty) <*> (x .?> "NextToken")
<*> (pure (fromEnum s)))
instance Hashable DescribeBatchPredictions
instance NFData DescribeBatchPredictions
instance ToHeaders DescribeBatchPredictions where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonML_20141212.DescribeBatchPredictions" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeBatchPredictions where
toJSON DescribeBatchPredictions'{..}
= object
(catMaybes
[("EQ" .=) <$> _dbpEQ, ("GE" .=) <$> _dbpGE,
("Prefix" .=) <$> _dbpPrefix, ("GT" .=) <$> _dbpGT,
("NE" .=) <$> _dbpNE,
("NextToken" .=) <$> _dbpNextToken,
("SortOrder" .=) <$> _dbpSortOrder,
("Limit" .=) <$> _dbpLimit, ("LT" .=) <$> _dbpLT,
("FilterVariable" .=) <$> _dbpFilterVariable,
("LE" .=) <$> _dbpLE])
instance ToPath DescribeBatchPredictions where
toPath = const "/"
instance ToQuery DescribeBatchPredictions where
toQuery = const mempty
data DescribeBatchPredictionsResponse = DescribeBatchPredictionsResponse'
{ _drsResults :: !(Maybe [BatchPrediction])
, _drsNextToken :: !(Maybe Text)
, _drsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeBatchPredictionsResponse
:: Int
-> DescribeBatchPredictionsResponse
describeBatchPredictionsResponse pResponseStatus_ =
DescribeBatchPredictionsResponse'
{ _drsResults = Nothing
, _drsNextToken = Nothing
, _drsResponseStatus = pResponseStatus_
}
drsResults :: Lens' DescribeBatchPredictionsResponse [BatchPrediction]
drsResults = lens _drsResults (\ s a -> s{_drsResults = a}) . _Default . _Coerce;
drsNextToken :: Lens' DescribeBatchPredictionsResponse (Maybe Text)
drsNextToken = lens _drsNextToken (\ s a -> s{_drsNextToken = a});
drsResponseStatus :: Lens' DescribeBatchPredictionsResponse Int
drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a});
instance NFData DescribeBatchPredictionsResponse