module Network.AWS.MachineLearning.CreateRealtimeEndpoint
(
CreateRealtimeEndpoint
, createRealtimeEndpoint
, creMLModelId
, CreateRealtimeEndpointResponse
, createRealtimeEndpointResponse
, crerMLModelId
, crerRealtimeEndpointInfo
) where
import Network.AWS.Data (Object)
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.MachineLearning.Types
import qualified GHC.Exts
newtype CreateRealtimeEndpoint = CreateRealtimeEndpoint
{ _creMLModelId :: Text
} deriving (Eq, Ord, Read, Show, Monoid, IsString)
createRealtimeEndpoint :: Text
-> CreateRealtimeEndpoint
createRealtimeEndpoint p1 = CreateRealtimeEndpoint
{ _creMLModelId = p1
}
creMLModelId :: Lens' CreateRealtimeEndpoint Text
creMLModelId = lens _creMLModelId (\s a -> s { _creMLModelId = a })
data CreateRealtimeEndpointResponse = CreateRealtimeEndpointResponse
{ _crerMLModelId :: Maybe Text
, _crerRealtimeEndpointInfo :: Maybe RealtimeEndpointInfo
} deriving (Eq, Read, Show)
createRealtimeEndpointResponse :: CreateRealtimeEndpointResponse
createRealtimeEndpointResponse = CreateRealtimeEndpointResponse
{ _crerMLModelId = Nothing
, _crerRealtimeEndpointInfo = Nothing
}
crerMLModelId :: Lens' CreateRealtimeEndpointResponse (Maybe Text)
crerMLModelId = lens _crerMLModelId (\s a -> s { _crerMLModelId = a })
crerRealtimeEndpointInfo :: Lens' CreateRealtimeEndpointResponse (Maybe RealtimeEndpointInfo)
crerRealtimeEndpointInfo =
lens _crerRealtimeEndpointInfo
(\s a -> s { _crerRealtimeEndpointInfo = a })
instance ToPath CreateRealtimeEndpoint where
toPath = const "/"
instance ToQuery CreateRealtimeEndpoint where
toQuery = const mempty
instance ToHeaders CreateRealtimeEndpoint
instance ToJSON CreateRealtimeEndpoint where
toJSON CreateRealtimeEndpoint{..} = object
[ "MLModelId" .= _creMLModelId
]
instance AWSRequest CreateRealtimeEndpoint where
type Sv CreateRealtimeEndpoint = MachineLearning
type Rs CreateRealtimeEndpoint = CreateRealtimeEndpointResponse
request = post "CreateRealtimeEndpoint"
response = jsonResponse
instance FromJSON CreateRealtimeEndpointResponse where
parseJSON = withObject "CreateRealtimeEndpointResponse" $ \o -> CreateRealtimeEndpointResponse
<$> o .:? "MLModelId"
<*> o .:? "RealtimeEndpointInfo"