module Network.AWS.CloudFront.CreateCloudFrontOriginAccessIdentity
(
createCloudFrontOriginAccessIdentity
, CreateCloudFrontOriginAccessIdentity
, ccfoaiCloudFrontOriginAccessIdentityConfig
, createCloudFrontOriginAccessIdentityResponse
, CreateCloudFrontOriginAccessIdentityResponse
, ccfoairsETag
, ccfoairsLocation
, ccfoairsCloudFrontOriginAccessIdentity
, ccfoairsStatus
) where
import Network.AWS.CloudFront.Types
import Network.AWS.CloudFront.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype CreateCloudFrontOriginAccessIdentity = CreateCloudFrontOriginAccessIdentity'
{ _ccfoaiCloudFrontOriginAccessIdentityConfig :: CloudFrontOriginAccessIdentityConfig
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createCloudFrontOriginAccessIdentity
:: CloudFrontOriginAccessIdentityConfig
-> CreateCloudFrontOriginAccessIdentity
createCloudFrontOriginAccessIdentity pCloudFrontOriginAccessIdentityConfig_ =
CreateCloudFrontOriginAccessIdentity'
{ _ccfoaiCloudFrontOriginAccessIdentityConfig = pCloudFrontOriginAccessIdentityConfig_
}
ccfoaiCloudFrontOriginAccessIdentityConfig :: Lens' CreateCloudFrontOriginAccessIdentity CloudFrontOriginAccessIdentityConfig
ccfoaiCloudFrontOriginAccessIdentityConfig = lens _ccfoaiCloudFrontOriginAccessIdentityConfig (\ s a -> s{_ccfoaiCloudFrontOriginAccessIdentityConfig = a});
instance AWSRequest
CreateCloudFrontOriginAccessIdentity where
type Rs CreateCloudFrontOriginAccessIdentity =
CreateCloudFrontOriginAccessIdentityResponse
request = postXML cloudFront
response
= receiveXML
(\ s h x ->
CreateCloudFrontOriginAccessIdentityResponse' <$>
(h .#? "ETag") <*> (h .#? "Location") <*>
(parseXML x)
<*> (pure (fromEnum s)))
instance ToElement
CreateCloudFrontOriginAccessIdentity where
toElement
= mkElement
"{http://cloudfront.amazonaws.com/doc/2015-04-17/}CloudFrontOriginAccessIdentityConfig"
.
_ccfoaiCloudFrontOriginAccessIdentityConfig
instance ToHeaders
CreateCloudFrontOriginAccessIdentity where
toHeaders = const mempty
instance ToPath CreateCloudFrontOriginAccessIdentity
where
toPath
= const
"/2015-04-17/origin-access-identity/cloudfront"
instance ToQuery CreateCloudFrontOriginAccessIdentity
where
toQuery = const mempty
data CreateCloudFrontOriginAccessIdentityResponse = CreateCloudFrontOriginAccessIdentityResponse'
{ _ccfoairsETag :: !(Maybe Text)
, _ccfoairsLocation :: !(Maybe Text)
, _ccfoairsCloudFrontOriginAccessIdentity :: !(Maybe CloudFrontOriginAccessIdentity)
, _ccfoairsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createCloudFrontOriginAccessIdentityResponse
:: Int
-> CreateCloudFrontOriginAccessIdentityResponse
createCloudFrontOriginAccessIdentityResponse pStatus_ =
CreateCloudFrontOriginAccessIdentityResponse'
{ _ccfoairsETag = Nothing
, _ccfoairsLocation = Nothing
, _ccfoairsCloudFrontOriginAccessIdentity = Nothing
, _ccfoairsStatus = pStatus_
}
ccfoairsETag :: Lens' CreateCloudFrontOriginAccessIdentityResponse (Maybe Text)
ccfoairsETag = lens _ccfoairsETag (\ s a -> s{_ccfoairsETag = a});
ccfoairsLocation :: Lens' CreateCloudFrontOriginAccessIdentityResponse (Maybe Text)
ccfoairsLocation = lens _ccfoairsLocation (\ s a -> s{_ccfoairsLocation = a});
ccfoairsCloudFrontOriginAccessIdentity :: Lens' CreateCloudFrontOriginAccessIdentityResponse (Maybe CloudFrontOriginAccessIdentity)
ccfoairsCloudFrontOriginAccessIdentity = lens _ccfoairsCloudFrontOriginAccessIdentity (\ s a -> s{_ccfoairsCloudFrontOriginAccessIdentity = a});
ccfoairsStatus :: Lens' CreateCloudFrontOriginAccessIdentityResponse Int
ccfoairsStatus = lens _ccfoairsStatus (\ s a -> s{_ccfoairsStatus = a});