{-# 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.GetUsagePlan
(
getUsagePlan
, GetUsagePlan
, gupUsagePlanId
, usagePlan
, UsagePlan
, upApiStages
, upName
, upId
, upThrottle
, upQuota
, upDescription
, upProductCode
) 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 GetUsagePlan = GetUsagePlan'
{ _gupUsagePlanId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getUsagePlan
:: Text
-> GetUsagePlan
getUsagePlan pUsagePlanId_ = GetUsagePlan' {_gupUsagePlanId = pUsagePlanId_}
gupUsagePlanId :: Lens' GetUsagePlan Text
gupUsagePlanId = lens _gupUsagePlanId (\ s a -> s{_gupUsagePlanId = a})
instance AWSRequest GetUsagePlan where
type Rs GetUsagePlan = UsagePlan
request = get apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable GetUsagePlan where
instance NFData GetUsagePlan where
instance ToHeaders GetUsagePlan where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToPath GetUsagePlan where
toPath GetUsagePlan'{..}
= mconcat ["/usageplans/", toBS _gupUsagePlanId]
instance ToQuery GetUsagePlan where
toQuery = const mempty