module Network.AWS.CloudFront.ListCloudFrontOriginAccessIdentities
(
ListCloudFrontOriginAccessIdentities
, listCloudFrontOriginAccessIdentities
, lcfoaiMarker
, lcfoaiMaxItems
, ListCloudFrontOriginAccessIdentitiesResponse
, listCloudFrontOriginAccessIdentitiesResponse
, lcfoairCloudFrontOriginAccessIdentityList
) where
import Network.AWS.Prelude
import Network.AWS.Request.RestXML
import Network.AWS.CloudFront.Types
import qualified GHC.Exts
data ListCloudFrontOriginAccessIdentities = ListCloudFrontOriginAccessIdentities
{ _lcfoaiMarker :: Maybe Text
, _lcfoaiMaxItems :: Maybe Text
} deriving (Eq, Ord, Read, Show)
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 })
newtype ListCloudFrontOriginAccessIdentitiesResponse = ListCloudFrontOriginAccessIdentitiesResponse
{ _lcfoairCloudFrontOriginAccessIdentityList :: CloudFrontOriginAccessIdentityList
} deriving (Eq, Read, Show)
listCloudFrontOriginAccessIdentitiesResponse :: CloudFrontOriginAccessIdentityList
-> ListCloudFrontOriginAccessIdentitiesResponse
listCloudFrontOriginAccessIdentitiesResponse p1 = ListCloudFrontOriginAccessIdentitiesResponse
{ _lcfoairCloudFrontOriginAccessIdentityList = p1
}
lcfoairCloudFrontOriginAccessIdentityList :: Lens' ListCloudFrontOriginAccessIdentitiesResponse CloudFrontOriginAccessIdentityList
lcfoairCloudFrontOriginAccessIdentityList =
lens _lcfoairCloudFrontOriginAccessIdentityList
(\s a -> s { _lcfoairCloudFrontOriginAccessIdentityList = a })
instance ToPath ListCloudFrontOriginAccessIdentities where
toPath = const "/2014-11-06/origin-access-identity/cloudfront"
instance ToQuery ListCloudFrontOriginAccessIdentities where
toQuery ListCloudFrontOriginAccessIdentities{..} = mconcat
[ "Marker" =? _lcfoaiMarker
, "MaxItems" =? _lcfoaiMaxItems
]
instance ToHeaders ListCloudFrontOriginAccessIdentities
instance ToXMLRoot ListCloudFrontOriginAccessIdentities where
toXMLRoot = const (namespaced ns "ListCloudFrontOriginAccessIdentities" [])
instance ToXML ListCloudFrontOriginAccessIdentities
instance AWSRequest ListCloudFrontOriginAccessIdentities where
type Sv ListCloudFrontOriginAccessIdentities = CloudFront
type Rs ListCloudFrontOriginAccessIdentities = ListCloudFrontOriginAccessIdentitiesResponse
request = get
response = xmlResponse
instance FromXML ListCloudFrontOriginAccessIdentitiesResponse where
parseXML x = ListCloudFrontOriginAccessIdentitiesResponse
<$> x .@ "CloudFrontOriginAccessIdentityList"
instance AWSPager ListCloudFrontOriginAccessIdentities where
page rq rs
| stop (rs ^. lcfoairCloudFrontOriginAccessIdentityList . cfoailIsTruncated) = Nothing
| otherwise = Just $ rq
& lcfoaiMarker .~ rs ^. lcfoairCloudFrontOriginAccessIdentityList . cfoailNextMarker