{-# 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.APIGateway.GetModelTemplate
(
getModelTemplate
, GetModelTemplate
, gmtRestAPIId
, gmtModelName
, getModelTemplateResponse
, GetModelTemplateResponse
, gmtrsValue
, gmtrsResponseStatus
) where
import Network.AWS.APIGateway.Types
import Network.AWS.APIGateway.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data GetModelTemplate = GetModelTemplate'
{ _gmtRestAPIId :: !Text
, _gmtModelName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getModelTemplate
:: Text
-> Text
-> GetModelTemplate
getModelTemplate pRestAPIId_ pModelName_ =
GetModelTemplate'
{ _gmtRestAPIId = pRestAPIId_
, _gmtModelName = pModelName_
}
gmtRestAPIId :: Lens' GetModelTemplate Text
gmtRestAPIId = lens _gmtRestAPIId (\ s a -> s{_gmtRestAPIId = a});
gmtModelName :: Lens' GetModelTemplate Text
gmtModelName = lens _gmtModelName (\ s a -> s{_gmtModelName = a});
instance AWSRequest GetModelTemplate where
type Rs GetModelTemplate = GetModelTemplateResponse
request = get apiGateway
response
= receiveJSON
(\ s h x ->
GetModelTemplateResponse' <$>
(x .?> "value") <*> (pure (fromEnum s)))
instance Hashable GetModelTemplate
instance NFData GetModelTemplate
instance ToHeaders GetModelTemplate where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToPath GetModelTemplate where
toPath GetModelTemplate'{..}
= mconcat
["/restapis/", toBS _gmtRestAPIId, "/models/",
toBS _gmtModelName, "/default_template"]
instance ToQuery GetModelTemplate where
toQuery = const mempty
data GetModelTemplateResponse = GetModelTemplateResponse'
{ _gmtrsValue :: !(Maybe Text)
, _gmtrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getModelTemplateResponse
:: Int
-> GetModelTemplateResponse
getModelTemplateResponse pResponseStatus_ =
GetModelTemplateResponse'
{ _gmtrsValue = Nothing
, _gmtrsResponseStatus = pResponseStatus_
}
gmtrsValue :: Lens' GetModelTemplateResponse (Maybe Text)
gmtrsValue = lens _gmtrsValue (\ s a -> s{_gmtrsValue = a});
gmtrsResponseStatus :: Lens' GetModelTemplateResponse Int
gmtrsResponseStatus = lens _gmtrsResponseStatus (\ s a -> s{_gmtrsResponseStatus = a});
instance NFData GetModelTemplateResponse