module Network.AWS.CloudFront.GetDistributionConfig
(
getDistributionConfig
, GetDistributionConfig
, gdcId
, getDistributionConfigResponse
, GetDistributionConfigResponse
, gdcrsETag
, gdcrsDistributionConfig
, gdcrsResponseStatus
) 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 GetDistributionConfig = GetDistributionConfig'
{ _gdcId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getDistributionConfig
:: Text
-> GetDistributionConfig
getDistributionConfig pId_ =
GetDistributionConfig'
{ _gdcId = pId_
}
gdcId :: Lens' GetDistributionConfig Text
gdcId = lens _gdcId (\ s a -> s{_gdcId = a});
instance AWSRequest GetDistributionConfig where
type Rs GetDistributionConfig =
GetDistributionConfigResponse
request = get cloudFront
response
= receiveXML
(\ s h x ->
GetDistributionConfigResponse' <$>
(h .#? "ETag") <*> (parseXML x) <*>
(pure (fromEnum s)))
instance Hashable GetDistributionConfig
instance ToHeaders GetDistributionConfig where
toHeaders = const mempty
instance ToPath GetDistributionConfig where
toPath GetDistributionConfig'{..}
= mconcat
["/2016-01-28/distribution/", toBS _gdcId, "/config"]
instance ToQuery GetDistributionConfig where
toQuery = const mempty
data GetDistributionConfigResponse = GetDistributionConfigResponse'
{ _gdcrsETag :: !(Maybe Text)
, _gdcrsDistributionConfig :: !(Maybe DistributionConfig)
, _gdcrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getDistributionConfigResponse
:: Int
-> GetDistributionConfigResponse
getDistributionConfigResponse pResponseStatus_ =
GetDistributionConfigResponse'
{ _gdcrsETag = Nothing
, _gdcrsDistributionConfig = Nothing
, _gdcrsResponseStatus = pResponseStatus_
}
gdcrsETag :: Lens' GetDistributionConfigResponse (Maybe Text)
gdcrsETag = lens _gdcrsETag (\ s a -> s{_gdcrsETag = a});
gdcrsDistributionConfig :: Lens' GetDistributionConfigResponse (Maybe DistributionConfig)
gdcrsDistributionConfig = lens _gdcrsDistributionConfig (\ s a -> s{_gdcrsDistributionConfig = a});
gdcrsResponseStatus :: Lens' GetDistributionConfigResponse Int
gdcrsResponseStatus = lens _gdcrsResponseStatus (\ s a -> s{_gdcrsResponseStatus = a});