module Network.AWS.APIGateway.GetModel
(
getModel
, GetModel
, ggFlatten
, ggRestAPIId
, ggModelName
, model
, Model
, mSchema
, mName
, mId
, mDescription
, mContentType
) 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 GetModel = GetModel'
{ _ggFlatten :: !(Maybe Bool)
, _ggRestAPIId :: !Text
, _ggModelName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getModel
:: Text
-> Text
-> GetModel
getModel pRestAPIId_ pModelName_ =
GetModel'
{ _ggFlatten = Nothing
, _ggRestAPIId = pRestAPIId_
, _ggModelName = pModelName_
}
ggFlatten :: Lens' GetModel (Maybe Bool)
ggFlatten = lens _ggFlatten (\ s a -> s{_ggFlatten = a});
ggRestAPIId :: Lens' GetModel Text
ggRestAPIId = lens _ggRestAPIId (\ s a -> s{_ggRestAPIId = a});
ggModelName :: Lens' GetModel Text
ggModelName = lens _ggModelName (\ s a -> s{_ggModelName = a});
instance AWSRequest GetModel where
type Rs GetModel = Model
request = get apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable GetModel
instance ToHeaders GetModel where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToPath GetModel where
toPath GetModel'{..}
= mconcat
["/restapis/", toBS _ggRestAPIId, "/models/",
toBS _ggModelName]
instance ToQuery GetModel where
toQuery GetModel'{..}
= mconcat ["flatten" =: _ggFlatten]