{-# 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.GetRestAPI
(
getRestAPI
, GetRestAPI
, graRestAPIId
, restAPI
, RestAPI
, raMinimumCompressionSize
, raBinaryMediaTypes
, raWarnings
, raCreatedDate
, raName
, raVersion
, raApiKeySource
, raId
, raPolicy
, raEndpointConfiguration
, raDescription
) 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
newtype GetRestAPI = GetRestAPI'
{ _graRestAPIId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getRestAPI
:: Text
-> GetRestAPI
getRestAPI pRestAPIId_ = GetRestAPI' {_graRestAPIId = pRestAPIId_}
graRestAPIId :: Lens' GetRestAPI Text
graRestAPIId = lens _graRestAPIId (\ s a -> s{_graRestAPIId = a})
instance AWSRequest GetRestAPI where
type Rs GetRestAPI = RestAPI
request = get apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable GetRestAPI where
instance NFData GetRestAPI where
instance ToHeaders GetRestAPI where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToPath GetRestAPI where
toPath GetRestAPI'{..}
= mconcat ["/restapis/", toBS _graRestAPIId]
instance ToQuery GetRestAPI where
toQuery = const mempty