module Network.AWS.CloudFront.ListDistributions
(
listDistributions
, ListDistributions
, ldMarker
, ldMaxItems
, listDistributionsResponse
, ListDistributionsResponse
, ldrsResponseStatus
, ldrsDistributionList
) 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 ListDistributions = ListDistributions'
{ _ldMarker :: !(Maybe Text)
, _ldMaxItems :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listDistributions
:: ListDistributions
listDistributions =
ListDistributions'
{ _ldMarker = Nothing
, _ldMaxItems = Nothing
}
ldMarker :: Lens' ListDistributions (Maybe Text)
ldMarker = lens _ldMarker (\ s a -> s{_ldMarker = a});
ldMaxItems :: Lens' ListDistributions (Maybe Text)
ldMaxItems = lens _ldMaxItems (\ s a -> s{_ldMaxItems = a});
instance AWSRequest ListDistributions where
type Rs ListDistributions = ListDistributionsResponse
request = get cloudFront
response
= receiveXML
(\ s h x ->
ListDistributionsResponse' <$>
(pure (fromEnum s)) <*> (parseXML x))
instance ToHeaders ListDistributions where
toHeaders = const mempty
instance ToPath ListDistributions where
toPath = const "/2015-04-17/distribution"
instance ToQuery ListDistributions where
toQuery ListDistributions'{..}
= mconcat
["Marker" =: _ldMarker, "MaxItems" =: _ldMaxItems]
data ListDistributionsResponse = ListDistributionsResponse'
{ _ldrsResponseStatus :: !Int
, _ldrsDistributionList :: !DistributionList
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listDistributionsResponse
:: Int
-> DistributionList
-> ListDistributionsResponse
listDistributionsResponse pResponseStatus_ pDistributionList_ =
ListDistributionsResponse'
{ _ldrsResponseStatus = pResponseStatus_
, _ldrsDistributionList = pDistributionList_
}
ldrsResponseStatus :: Lens' ListDistributionsResponse Int
ldrsResponseStatus = lens _ldrsResponseStatus (\ s a -> s{_ldrsResponseStatus = a});
ldrsDistributionList :: Lens' ListDistributionsResponse DistributionList
ldrsDistributionList = lens _ldrsDistributionList (\ s a -> s{_ldrsDistributionList = a});