module Network.AWS.APIGateway.GetResource
(
getResource
, GetResource
, grRestAPIId
, grResourceId
, resource
, Resource
, rPathPart
, rPath
, rId
, rResourceMethods
, rParentId
) 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 GetResource = GetResource'
{ _grRestAPIId :: !Text
, _grResourceId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getResource
:: Text
-> Text
-> GetResource
getResource pRestAPIId_ pResourceId_ =
GetResource'
{ _grRestAPIId = pRestAPIId_
, _grResourceId = pResourceId_
}
grRestAPIId :: Lens' GetResource Text
grRestAPIId = lens _grRestAPIId (\ s a -> s{_grRestAPIId = a});
grResourceId :: Lens' GetResource Text
grResourceId = lens _grResourceId (\ s a -> s{_grResourceId = a});
instance AWSRequest GetResource where
type Rs GetResource = Resource
request = get apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable GetResource
instance ToHeaders GetResource where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToPath GetResource where
toPath GetResource'{..}
= mconcat
["/restapis/", toBS _grRestAPIId, "/resources/",
toBS _grResourceId]
instance ToQuery GetResource where
toQuery = const mempty