{-# 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.GetAPIKey
(
getAPIKey
, GetAPIKey
, gakIncludeValue
, gakApiKey
, apiKey
, APIKey
, akEnabled
, akValue
, akCustomerId
, akCreatedDate
, akName
, akId
, akStageKeys
, akLastUpdatedDate
, akDescription
) 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 GetAPIKey = GetAPIKey'
{ _gakIncludeValue :: !(Maybe Bool)
, _gakApiKey :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getAPIKey
:: Text
-> GetAPIKey
getAPIKey pApiKey_ =
GetAPIKey' {_gakIncludeValue = Nothing, _gakApiKey = pApiKey_}
gakIncludeValue :: Lens' GetAPIKey (Maybe Bool)
gakIncludeValue = lens _gakIncludeValue (\ s a -> s{_gakIncludeValue = a})
gakApiKey :: Lens' GetAPIKey Text
gakApiKey = lens _gakApiKey (\ s a -> s{_gakApiKey = a})
instance AWSRequest GetAPIKey where
type Rs GetAPIKey = APIKey
request = get apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable GetAPIKey where
instance NFData GetAPIKey where
instance ToHeaders GetAPIKey where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToPath GetAPIKey where
toPath GetAPIKey'{..}
= mconcat ["/apikeys/", toBS _gakApiKey]
instance ToQuery GetAPIKey where
toQuery GetAPIKey'{..}
= mconcat ["includeValue" =: _gakIncludeValue]