{-# 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.MachineLearning.UpdateMLModel
(
updateMLModel
, UpdateMLModel
, umlmMLModelName
, umlmScoreThreshold
, umlmMLModelId
, updateMLModelResponse
, UpdateMLModelResponse
, umlmrsMLModelId
, umlmrsResponseStatus
) 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 UpdateMLModel = UpdateMLModel'
{ _umlmMLModelName :: !(Maybe Text)
, _umlmScoreThreshold :: !(Maybe Double)
, _umlmMLModelId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateMLModel
:: Text
-> UpdateMLModel
updateMLModel pMLModelId_ =
UpdateMLModel'
{ _umlmMLModelName = Nothing
, _umlmScoreThreshold = Nothing
, _umlmMLModelId = pMLModelId_
}
umlmMLModelName :: Lens' UpdateMLModel (Maybe Text)
umlmMLModelName = lens _umlmMLModelName (\ s a -> s{_umlmMLModelName = a});
umlmScoreThreshold :: Lens' UpdateMLModel (Maybe Double)
umlmScoreThreshold = lens _umlmScoreThreshold (\ s a -> s{_umlmScoreThreshold = a});
umlmMLModelId :: Lens' UpdateMLModel Text
umlmMLModelId = lens _umlmMLModelId (\ s a -> s{_umlmMLModelId = a});
instance AWSRequest UpdateMLModel where
type Rs UpdateMLModel = UpdateMLModelResponse
request = postJSON machineLearning
response
= receiveJSON
(\ s h x ->
UpdateMLModelResponse' <$>
(x .?> "MLModelId") <*> (pure (fromEnum s)))
instance Hashable UpdateMLModel
instance NFData UpdateMLModel
instance ToHeaders UpdateMLModel where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonML_20141212.UpdateMLModel" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateMLModel where
toJSON UpdateMLModel'{..}
= object
(catMaybes
[("MLModelName" .=) <$> _umlmMLModelName,
("ScoreThreshold" .=) <$> _umlmScoreThreshold,
Just ("MLModelId" .= _umlmMLModelId)])
instance ToPath UpdateMLModel where
toPath = const "/"
instance ToQuery UpdateMLModel where
toQuery = const mempty
data UpdateMLModelResponse = UpdateMLModelResponse'
{ _umlmrsMLModelId :: !(Maybe Text)
, _umlmrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateMLModelResponse
:: Int
-> UpdateMLModelResponse
updateMLModelResponse pResponseStatus_ =
UpdateMLModelResponse'
{ _umlmrsMLModelId = Nothing
, _umlmrsResponseStatus = pResponseStatus_
}
umlmrsMLModelId :: Lens' UpdateMLModelResponse (Maybe Text)
umlmrsMLModelId = lens _umlmrsMLModelId (\ s a -> s{_umlmrsMLModelId = a});
umlmrsResponseStatus :: Lens' UpdateMLModelResponse Int
umlmrsResponseStatus = lens _umlmrsResponseStatus (\ s a -> s{_umlmrsResponseStatus = a});
instance NFData UpdateMLModelResponse