module Network.AWS.CloudFront.ListStreamingDistributions
(
listStreamingDistributions
, ListStreamingDistributions
, lsdMarker
, lsdMaxItems
, listStreamingDistributionsResponse
, ListStreamingDistributionsResponse
, lsdrsResponseStatus
, lsdrsStreamingDistributionList
) where
import Network.AWS.CloudFront.Types
import Network.AWS.CloudFront.Types.Product
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListStreamingDistributions = ListStreamingDistributions'
{ _lsdMarker :: !(Maybe Text)
, _lsdMaxItems :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listStreamingDistributions
:: ListStreamingDistributions
listStreamingDistributions =
ListStreamingDistributions'
{ _lsdMarker = Nothing
, _lsdMaxItems = Nothing
}
lsdMarker :: Lens' ListStreamingDistributions (Maybe Text)
lsdMarker = lens _lsdMarker (\ s a -> s{_lsdMarker = a});
lsdMaxItems :: Lens' ListStreamingDistributions (Maybe Text)
lsdMaxItems = lens _lsdMaxItems (\ s a -> s{_lsdMaxItems = a});
instance AWSPager ListStreamingDistributions where
page rq rs
| stop
(rs ^.
lsdrsStreamingDistributionList . sdlIsTruncated)
= Nothing
| isNothing
(rs ^?
lsdrsStreamingDistributionList .
sdlNextMarker . _Just)
= Nothing
| otherwise =
Just $ rq &
lsdMarker .~
rs ^?
lsdrsStreamingDistributionList .
sdlNextMarker . _Just
instance AWSRequest ListStreamingDistributions where
type Rs ListStreamingDistributions =
ListStreamingDistributionsResponse
request = get cloudFront
response
= receiveXML
(\ s h x ->
ListStreamingDistributionsResponse' <$>
(pure (fromEnum s)) <*> (parseXML x))
instance ToHeaders ListStreamingDistributions where
toHeaders = const mempty
instance ToPath ListStreamingDistributions where
toPath = const "/2015-04-17/streaming-distribution"
instance ToQuery ListStreamingDistributions where
toQuery ListStreamingDistributions'{..}
= mconcat
["Marker" =: _lsdMarker, "MaxItems" =: _lsdMaxItems]
data ListStreamingDistributionsResponse = ListStreamingDistributionsResponse'
{ _lsdrsResponseStatus :: !Int
, _lsdrsStreamingDistributionList :: !StreamingDistributionList
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listStreamingDistributionsResponse
:: Int
-> StreamingDistributionList
-> ListStreamingDistributionsResponse
listStreamingDistributionsResponse pResponseStatus_ pStreamingDistributionList_ =
ListStreamingDistributionsResponse'
{ _lsdrsResponseStatus = pResponseStatus_
, _lsdrsStreamingDistributionList = pStreamingDistributionList_
}
lsdrsResponseStatus :: Lens' ListStreamingDistributionsResponse Int
lsdrsResponseStatus = lens _lsdrsResponseStatus (\ s a -> s{_lsdrsResponseStatus = a});
lsdrsStreamingDistributionList :: Lens' ListStreamingDistributionsResponse StreamingDistributionList
lsdrsStreamingDistributionList = lens _lsdrsStreamingDistributionList (\ s a -> s{_lsdrsStreamingDistributionList = a});