{-# 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.DeleteMLModel
(
deleteMLModel
, DeleteMLModel
, dmlmMLModelId
, deleteMLModelResponse
, DeleteMLModelResponse
, dmlmrsMLModelId
, dmlmrsResponseStatus
) 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
newtype DeleteMLModel = DeleteMLModel'
{ _dmlmMLModelId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteMLModel
:: Text
-> DeleteMLModel
deleteMLModel pMLModelId_ = DeleteMLModel' {_dmlmMLModelId = pMLModelId_}
dmlmMLModelId :: Lens' DeleteMLModel Text
dmlmMLModelId = lens _dmlmMLModelId (\ s a -> s{_dmlmMLModelId = a})
instance AWSRequest DeleteMLModel where
type Rs DeleteMLModel = DeleteMLModelResponse
request = postJSON machineLearning
response
= receiveJSON
(\ s h x ->
DeleteMLModelResponse' <$>
(x .?> "MLModelId") <*> (pure (fromEnum s)))
instance Hashable DeleteMLModel where
instance NFData DeleteMLModel where
instance ToHeaders DeleteMLModel where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonML_20141212.DeleteMLModel" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteMLModel where
toJSON DeleteMLModel'{..}
= object
(catMaybes [Just ("MLModelId" .= _dmlmMLModelId)])
instance ToPath DeleteMLModel where
toPath = const "/"
instance ToQuery DeleteMLModel where
toQuery = const mempty
data DeleteMLModelResponse = DeleteMLModelResponse'
{ _dmlmrsMLModelId :: !(Maybe Text)
, _dmlmrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteMLModelResponse
:: Int
-> DeleteMLModelResponse
deleteMLModelResponse pResponseStatus_ =
DeleteMLModelResponse'
{_dmlmrsMLModelId = Nothing, _dmlmrsResponseStatus = pResponseStatus_}
dmlmrsMLModelId :: Lens' DeleteMLModelResponse (Maybe Text)
dmlmrsMLModelId = lens _dmlmrsMLModelId (\ s a -> s{_dmlmrsMLModelId = a})
dmlmrsResponseStatus :: Lens' DeleteMLModelResponse Int
dmlmrsResponseStatus = lens _dmlmrsResponseStatus (\ s a -> s{_dmlmrsResponseStatus = a})
instance NFData DeleteMLModelResponse where