module Network.AWS.CloudFront.GetInvalidation
(
getInvalidation
, GetInvalidation
, giDistributionId
, giId
, getInvalidationResponse
, GetInvalidationResponse
, girsInvalidation
, girsResponseStatus
) where
import Network.AWS.CloudFront.Types
import Network.AWS.CloudFront.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data GetInvalidation = GetInvalidation'
{ _giDistributionId :: !Text
, _giId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getInvalidation
:: Text
-> Text
-> GetInvalidation
getInvalidation pDistributionId_ pId_ =
GetInvalidation'
{ _giDistributionId = pDistributionId_
, _giId = pId_
}
giDistributionId :: Lens' GetInvalidation Text
giDistributionId = lens _giDistributionId (\ s a -> s{_giDistributionId = a});
giId :: Lens' GetInvalidation Text
giId = lens _giId (\ s a -> s{_giId = a});
instance AWSRequest GetInvalidation where
type Rs GetInvalidation = GetInvalidationResponse
request = get cloudFront
response
= receiveXML
(\ s h x ->
GetInvalidationResponse' <$>
(parseXML x) <*> (pure (fromEnum s)))
instance ToHeaders GetInvalidation where
toHeaders = const mempty
instance ToPath GetInvalidation where
toPath GetInvalidation'{..}
= mconcat
["/2015-04-17/distribution/", toBS _giDistributionId,
"/invalidation/", toBS _giId]
instance ToQuery GetInvalidation where
toQuery = const mempty
data GetInvalidationResponse = GetInvalidationResponse'
{ _girsInvalidation :: !(Maybe Invalidation)
, _girsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getInvalidationResponse
:: Int
-> GetInvalidationResponse
getInvalidationResponse pResponseStatus_ =
GetInvalidationResponse'
{ _girsInvalidation = Nothing
, _girsResponseStatus = pResponseStatus_
}
girsInvalidation :: Lens' GetInvalidationResponse (Maybe Invalidation)
girsInvalidation = lens _girsInvalidation (\ s a -> s{_girsInvalidation = a});
girsResponseStatus :: Lens' GetInvalidationResponse Int
girsResponseStatus = lens _girsResponseStatus (\ s a -> s{_girsResponseStatus = a});