{-# 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.CloudFront.GetPublicKeyConfig
(
getPublicKeyConfig
, GetPublicKeyConfig
, gpkcId
, getPublicKeyConfigResponse
, GetPublicKeyConfigResponse
, gpkcrsETag
, gpkcrsPublicKeyConfig
, gpkcrsResponseStatus
) where
import Network.AWS.CloudFront.Types
import Network.AWS.CloudFront.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetPublicKeyConfig = GetPublicKeyConfig'
{ _gpkcId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getPublicKeyConfig
:: Text
-> GetPublicKeyConfig
getPublicKeyConfig pId_ = GetPublicKeyConfig' {_gpkcId = pId_}
gpkcId :: Lens' GetPublicKeyConfig Text
gpkcId = lens _gpkcId (\ s a -> s{_gpkcId = a})
instance AWSRequest GetPublicKeyConfig where
type Rs GetPublicKeyConfig =
GetPublicKeyConfigResponse
request = get cloudFront
response
= receiveXML
(\ s h x ->
GetPublicKeyConfigResponse' <$>
(h .#? "ETag") <*> (parseXML x) <*>
(pure (fromEnum s)))
instance Hashable GetPublicKeyConfig where
instance NFData GetPublicKeyConfig where
instance ToHeaders GetPublicKeyConfig where
toHeaders = const mempty
instance ToPath GetPublicKeyConfig where
toPath GetPublicKeyConfig'{..}
= mconcat
["/2017-10-30/public-key/", toBS _gpkcId, "/config"]
instance ToQuery GetPublicKeyConfig where
toQuery = const mempty
data GetPublicKeyConfigResponse = GetPublicKeyConfigResponse'
{ _gpkcrsETag :: !(Maybe Text)
, _gpkcrsPublicKeyConfig :: !(Maybe PublicKeyConfig)
, _gpkcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getPublicKeyConfigResponse
:: Int
-> GetPublicKeyConfigResponse
getPublicKeyConfigResponse pResponseStatus_ =
GetPublicKeyConfigResponse'
{ _gpkcrsETag = Nothing
, _gpkcrsPublicKeyConfig = Nothing
, _gpkcrsResponseStatus = pResponseStatus_
}
gpkcrsETag :: Lens' GetPublicKeyConfigResponse (Maybe Text)
gpkcrsETag = lens _gpkcrsETag (\ s a -> s{_gpkcrsETag = a})
gpkcrsPublicKeyConfig :: Lens' GetPublicKeyConfigResponse (Maybe PublicKeyConfig)
gpkcrsPublicKeyConfig = lens _gpkcrsPublicKeyConfig (\ s a -> s{_gpkcrsPublicKeyConfig = a})
gpkcrsResponseStatus :: Lens' GetPublicKeyConfigResponse Int
gpkcrsResponseStatus = lens _gpkcrsResponseStatus (\ s a -> s{_gpkcrsResponseStatus = a})
instance NFData GetPublicKeyConfigResponse where