module Network.AWS.MachineLearning.GetMLModel
(
getMLModel
, GetMLModel
, gmlmVerbose
, gmlmMLModelId
, getMLModelResponse
, GetMLModelResponse
, gmlmrsTrainingParameters
, gmlmrsLastUpdatedAt
, gmlmrsCreatedAt
, gmlmrsScoreThresholdLastUpdatedAt
, gmlmrsRecipe
, gmlmrsInputDataLocationS3
, gmlmrsSizeInBytes
, gmlmrsMLModelId
, gmlmrsSchema
, gmlmrsScoreThreshold
, gmlmrsName
, gmlmrsCreatedByIAMUser
, gmlmrsLogURI
, gmlmrsEndpointInfo
, gmlmrsTrainingDataSourceId
, gmlmrsMessage
, gmlmrsMLModelType
, gmlmrsStatus
) where
import Network.AWS.MachineLearning.Types
import Network.AWS.MachineLearning.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data GetMLModel = GetMLModel'
{ _gmlmVerbose :: !(Maybe Bool)
, _gmlmMLModelId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getMLModel
:: Text
-> GetMLModel
getMLModel pMLModelId_ =
GetMLModel'
{ _gmlmVerbose = Nothing
, _gmlmMLModelId = pMLModelId_
}
gmlmVerbose :: Lens' GetMLModel (Maybe Bool)
gmlmVerbose = lens _gmlmVerbose (\ s a -> s{_gmlmVerbose = a});
gmlmMLModelId :: Lens' GetMLModel Text
gmlmMLModelId = lens _gmlmMLModelId (\ s a -> s{_gmlmMLModelId = a});
instance AWSRequest GetMLModel where
type Sv GetMLModel = MachineLearning
type Rs GetMLModel = GetMLModelResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
GetMLModelResponse' <$>
(x .?> "TrainingParameters" .!@ mempty) <*>
(x .?> "LastUpdatedAt")
<*> (x .?> "CreatedAt")
<*> (x .?> "ScoreThresholdLastUpdatedAt")
<*> (x .?> "Recipe")
<*> (x .?> "InputDataLocationS3")
<*> (x .?> "SizeInBytes")
<*> (x .?> "MLModelId")
<*> (x .?> "Schema")
<*> (x .?> "ScoreThreshold")
<*> (x .?> "Name")
<*> (x .?> "CreatedByIamUser")
<*> (x .?> "LogUri")
<*> (x .?> "EndpointInfo")
<*> (x .?> "TrainingDataSourceId")
<*> (x .?> "Message")
<*> (x .?> "MLModelType")
<*> (pure (fromEnum s)))
instance ToHeaders GetMLModel where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonML_20141212.GetMLModel" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetMLModel where
toJSON GetMLModel'{..}
= object
["Verbose" .= _gmlmVerbose,
"MLModelId" .= _gmlmMLModelId]
instance ToPath GetMLModel where
toPath = const "/"
instance ToQuery GetMLModel where
toQuery = const mempty
data GetMLModelResponse = GetMLModelResponse'
{ _gmlmrsTrainingParameters :: !(Maybe (Map Text Text))
, _gmlmrsLastUpdatedAt :: !(Maybe POSIX)
, _gmlmrsCreatedAt :: !(Maybe POSIX)
, _gmlmrsScoreThresholdLastUpdatedAt :: !(Maybe POSIX)
, _gmlmrsRecipe :: !(Maybe Text)
, _gmlmrsInputDataLocationS3 :: !(Maybe Text)
, _gmlmrsSizeInBytes :: !(Maybe Integer)
, _gmlmrsMLModelId :: !(Maybe Text)
, _gmlmrsSchema :: !(Maybe Text)
, _gmlmrsScoreThreshold :: !(Maybe Double)
, _gmlmrsName :: !(Maybe Text)
, _gmlmrsCreatedByIAMUser :: !(Maybe Text)
, _gmlmrsLogURI :: !(Maybe Text)
, _gmlmrsEndpointInfo :: !(Maybe RealtimeEndpointInfo)
, _gmlmrsTrainingDataSourceId :: !(Maybe Text)
, _gmlmrsMessage :: !(Maybe Text)
, _gmlmrsMLModelType :: !(Maybe MLModelType)
, _gmlmrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getMLModelResponse
:: Int
-> GetMLModelResponse
getMLModelResponse pStatus_ =
GetMLModelResponse'
{ _gmlmrsTrainingParameters = Nothing
, _gmlmrsLastUpdatedAt = Nothing
, _gmlmrsCreatedAt = Nothing
, _gmlmrsScoreThresholdLastUpdatedAt = Nothing
, _gmlmrsRecipe = Nothing
, _gmlmrsInputDataLocationS3 = Nothing
, _gmlmrsSizeInBytes = Nothing
, _gmlmrsMLModelId = Nothing
, _gmlmrsSchema = Nothing
, _gmlmrsScoreThreshold = Nothing
, _gmlmrsName = Nothing
, _gmlmrsCreatedByIAMUser = Nothing
, _gmlmrsLogURI = Nothing
, _gmlmrsEndpointInfo = Nothing
, _gmlmrsTrainingDataSourceId = Nothing
, _gmlmrsMessage = Nothing
, _gmlmrsMLModelType = Nothing
, _gmlmrsStatus = pStatus_
}
gmlmrsTrainingParameters :: Lens' GetMLModelResponse (HashMap Text Text)
gmlmrsTrainingParameters = lens _gmlmrsTrainingParameters (\ s a -> s{_gmlmrsTrainingParameters = a}) . _Default . _Map;
gmlmrsLastUpdatedAt :: Lens' GetMLModelResponse (Maybe UTCTime)
gmlmrsLastUpdatedAt = lens _gmlmrsLastUpdatedAt (\ s a -> s{_gmlmrsLastUpdatedAt = a}) . mapping _Time;
gmlmrsCreatedAt :: Lens' GetMLModelResponse (Maybe UTCTime)
gmlmrsCreatedAt = lens _gmlmrsCreatedAt (\ s a -> s{_gmlmrsCreatedAt = a}) . mapping _Time;
gmlmrsScoreThresholdLastUpdatedAt :: Lens' GetMLModelResponse (Maybe UTCTime)
gmlmrsScoreThresholdLastUpdatedAt = lens _gmlmrsScoreThresholdLastUpdatedAt (\ s a -> s{_gmlmrsScoreThresholdLastUpdatedAt = a}) . mapping _Time;
gmlmrsRecipe :: Lens' GetMLModelResponse (Maybe Text)
gmlmrsRecipe = lens _gmlmrsRecipe (\ s a -> s{_gmlmrsRecipe = a});
gmlmrsInputDataLocationS3 :: Lens' GetMLModelResponse (Maybe Text)
gmlmrsInputDataLocationS3 = lens _gmlmrsInputDataLocationS3 (\ s a -> s{_gmlmrsInputDataLocationS3 = a});
gmlmrsSizeInBytes :: Lens' GetMLModelResponse (Maybe Integer)
gmlmrsSizeInBytes = lens _gmlmrsSizeInBytes (\ s a -> s{_gmlmrsSizeInBytes = a});
gmlmrsMLModelId :: Lens' GetMLModelResponse (Maybe Text)
gmlmrsMLModelId = lens _gmlmrsMLModelId (\ s a -> s{_gmlmrsMLModelId = a});
gmlmrsSchema :: Lens' GetMLModelResponse (Maybe Text)
gmlmrsSchema = lens _gmlmrsSchema (\ s a -> s{_gmlmrsSchema = a});
gmlmrsScoreThreshold :: Lens' GetMLModelResponse (Maybe Double)
gmlmrsScoreThreshold = lens _gmlmrsScoreThreshold (\ s a -> s{_gmlmrsScoreThreshold = a});
gmlmrsName :: Lens' GetMLModelResponse (Maybe Text)
gmlmrsName = lens _gmlmrsName (\ s a -> s{_gmlmrsName = a});
gmlmrsCreatedByIAMUser :: Lens' GetMLModelResponse (Maybe Text)
gmlmrsCreatedByIAMUser = lens _gmlmrsCreatedByIAMUser (\ s a -> s{_gmlmrsCreatedByIAMUser = a});
gmlmrsLogURI :: Lens' GetMLModelResponse (Maybe Text)
gmlmrsLogURI = lens _gmlmrsLogURI (\ s a -> s{_gmlmrsLogURI = a});
gmlmrsEndpointInfo :: Lens' GetMLModelResponse (Maybe RealtimeEndpointInfo)
gmlmrsEndpointInfo = lens _gmlmrsEndpointInfo (\ s a -> s{_gmlmrsEndpointInfo = a});
gmlmrsTrainingDataSourceId :: Lens' GetMLModelResponse (Maybe Text)
gmlmrsTrainingDataSourceId = lens _gmlmrsTrainingDataSourceId (\ s a -> s{_gmlmrsTrainingDataSourceId = a});
gmlmrsMessage :: Lens' GetMLModelResponse (Maybe Text)
gmlmrsMessage = lens _gmlmrsMessage (\ s a -> s{_gmlmrsMessage = a});
gmlmrsMLModelType :: Lens' GetMLModelResponse (Maybe MLModelType)
gmlmrsMLModelType = lens _gmlmrsMLModelType (\ s a -> s{_gmlmrsMLModelType = a});
gmlmrsStatus :: Lens' GetMLModelResponse Int
gmlmrsStatus = lens _gmlmrsStatus (\ s a -> s{_gmlmrsStatus = a});