module Network.AWS.CloudFront.ListCloudFrontOriginAccessIdentities
(
listCloudFrontOriginAccessIdentities
, ListCloudFrontOriginAccessIdentities
, lcfoaiMarker
, lcfoaiMaxItems
, listCloudFrontOriginAccessIdentitiesResponse
, ListCloudFrontOriginAccessIdentitiesResponse
, lcfoairsResponseStatus
, lcfoairsCloudFrontOriginAccessIdentityList
) 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 ListCloudFrontOriginAccessIdentities = ListCloudFrontOriginAccessIdentities'
{ _lcfoaiMarker :: !(Maybe Text)
, _lcfoaiMaxItems :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listCloudFrontOriginAccessIdentities
:: ListCloudFrontOriginAccessIdentities
listCloudFrontOriginAccessIdentities =
ListCloudFrontOriginAccessIdentities'
{ _lcfoaiMarker = Nothing
, _lcfoaiMaxItems = Nothing
}
lcfoaiMarker :: Lens' ListCloudFrontOriginAccessIdentities (Maybe Text)
lcfoaiMarker = lens _lcfoaiMarker (\ s a -> s{_lcfoaiMarker = a});
lcfoaiMaxItems :: Lens' ListCloudFrontOriginAccessIdentities (Maybe Text)
lcfoaiMaxItems = lens _lcfoaiMaxItems (\ s a -> s{_lcfoaiMaxItems = a});
instance AWSPager
ListCloudFrontOriginAccessIdentities where
page rq rs
| stop
(rs ^.
lcfoairsCloudFrontOriginAccessIdentityList .
cfoailIsTruncated)
= Nothing
| isNothing
(rs ^?
lcfoairsCloudFrontOriginAccessIdentityList .
cfoailNextMarker . _Just)
= Nothing
| otherwise =
Just $ rq &
lcfoaiMarker .~
rs ^?
lcfoairsCloudFrontOriginAccessIdentityList .
cfoailNextMarker . _Just
instance AWSRequest
ListCloudFrontOriginAccessIdentities where
type Rs ListCloudFrontOriginAccessIdentities =
ListCloudFrontOriginAccessIdentitiesResponse
request = get cloudFront
response
= receiveXML
(\ s h x ->
ListCloudFrontOriginAccessIdentitiesResponse' <$>
(pure (fromEnum s)) <*> (parseXML x))
instance ToHeaders
ListCloudFrontOriginAccessIdentities where
toHeaders = const mempty
instance ToPath ListCloudFrontOriginAccessIdentities
where
toPath
= const
"/2015-07-27/origin-access-identity/cloudfront"
instance ToQuery ListCloudFrontOriginAccessIdentities
where
toQuery ListCloudFrontOriginAccessIdentities'{..}
= mconcat
["Marker" =: _lcfoaiMarker,
"MaxItems" =: _lcfoaiMaxItems]
data ListCloudFrontOriginAccessIdentitiesResponse = ListCloudFrontOriginAccessIdentitiesResponse'
{ _lcfoairsResponseStatus :: !Int
, _lcfoairsCloudFrontOriginAccessIdentityList :: !CloudFrontOriginAccessIdentityList
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listCloudFrontOriginAccessIdentitiesResponse
:: Int
-> CloudFrontOriginAccessIdentityList
-> ListCloudFrontOriginAccessIdentitiesResponse
listCloudFrontOriginAccessIdentitiesResponse pResponseStatus_ pCloudFrontOriginAccessIdentityList_ =
ListCloudFrontOriginAccessIdentitiesResponse'
{ _lcfoairsResponseStatus = pResponseStatus_
, _lcfoairsCloudFrontOriginAccessIdentityList = pCloudFrontOriginAccessIdentityList_
}
lcfoairsResponseStatus :: Lens' ListCloudFrontOriginAccessIdentitiesResponse Int
lcfoairsResponseStatus = lens _lcfoairsResponseStatus (\ s a -> s{_lcfoairsResponseStatus = a});
lcfoairsCloudFrontOriginAccessIdentityList :: Lens' ListCloudFrontOriginAccessIdentitiesResponse CloudFrontOriginAccessIdentityList
lcfoairsCloudFrontOriginAccessIdentityList = lens _lcfoairsCloudFrontOriginAccessIdentityList (\ s a -> s{_lcfoairsCloudFrontOriginAccessIdentityList = a});