module Network.AWS.CloudFront.ListInvalidations
(
listInvalidations
, ListInvalidations
, liMaxItems
, liMarker
, liDistributionId
, listInvalidationsResponse
, ListInvalidationsResponse
, lirsStatus
, lirsInvalidationList
) 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 ListInvalidations = ListInvalidations'
{ _liMaxItems :: !(Maybe Text)
, _liMarker :: !(Maybe Text)
, _liDistributionId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listInvalidations
:: Text
-> ListInvalidations
listInvalidations pDistributionId_ =
ListInvalidations'
{ _liMaxItems = Nothing
, _liMarker = Nothing
, _liDistributionId = pDistributionId_
}
liMaxItems :: Lens' ListInvalidations (Maybe Text)
liMaxItems = lens _liMaxItems (\ s a -> s{_liMaxItems = a});
liMarker :: Lens' ListInvalidations (Maybe Text)
liMarker = lens _liMarker (\ s a -> s{_liMarker = a});
liDistributionId :: Lens' ListInvalidations Text
liDistributionId = lens _liDistributionId (\ s a -> s{_liDistributionId = a});
instance AWSRequest ListInvalidations where
type Rs ListInvalidations = ListInvalidationsResponse
request = get cloudFront
response
= receiveXML
(\ s h x ->
ListInvalidationsResponse' <$>
(pure (fromEnum s)) <*> (parseXML x))
instance ToHeaders ListInvalidations where
toHeaders = const mempty
instance ToPath ListInvalidations where
toPath ListInvalidations'{..}
= mconcat
["/2015-04-17/distribution/", toBS _liDistributionId,
"/invalidation"]
instance ToQuery ListInvalidations where
toQuery ListInvalidations'{..}
= mconcat
["MaxItems" =: _liMaxItems, "Marker" =: _liMarker]
data ListInvalidationsResponse = ListInvalidationsResponse'
{ _lirsStatus :: !Int
, _lirsInvalidationList :: !InvalidationList
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listInvalidationsResponse
:: Int
-> InvalidationList
-> ListInvalidationsResponse
listInvalidationsResponse pStatus_ pInvalidationList_ =
ListInvalidationsResponse'
{ _lirsStatus = pStatus_
, _lirsInvalidationList = pInvalidationList_
}
lirsStatus :: Lens' ListInvalidationsResponse Int
lirsStatus = lens _lirsStatus (\ s a -> s{_lirsStatus = a});
lirsInvalidationList :: Lens' ListInvalidationsResponse InvalidationList
lirsInvalidationList = lens _lirsInvalidationList (\ s a -> s{_lirsInvalidationList = a});