module Network.AWS.CloudFront.UpdateCloudFrontOriginAccessIdentity
(
updateCloudFrontOriginAccessIdentity
, UpdateCloudFrontOriginAccessIdentity
, ucfoaiIfMatch
, ucfoaiCloudFrontOriginAccessIdentityConfig
, ucfoaiId
, updateCloudFrontOriginAccessIdentityResponse
, UpdateCloudFrontOriginAccessIdentityResponse
, ucfoairsETag
, ucfoairsCloudFrontOriginAccessIdentity
, ucfoairsStatus
) 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 UpdateCloudFrontOriginAccessIdentity = UpdateCloudFrontOriginAccessIdentity'
{ _ucfoaiIfMatch :: !(Maybe Text)
, _ucfoaiCloudFrontOriginAccessIdentityConfig :: !CloudFrontOriginAccessIdentityConfig
, _ucfoaiId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateCloudFrontOriginAccessIdentity
:: CloudFrontOriginAccessIdentityConfig
-> Text
-> UpdateCloudFrontOriginAccessIdentity
updateCloudFrontOriginAccessIdentity pCloudFrontOriginAccessIdentityConfig_ pId_ =
UpdateCloudFrontOriginAccessIdentity'
{ _ucfoaiIfMatch = Nothing
, _ucfoaiCloudFrontOriginAccessIdentityConfig = pCloudFrontOriginAccessIdentityConfig_
, _ucfoaiId = pId_
}
ucfoaiIfMatch :: Lens' UpdateCloudFrontOriginAccessIdentity (Maybe Text)
ucfoaiIfMatch = lens _ucfoaiIfMatch (\ s a -> s{_ucfoaiIfMatch = a});
ucfoaiCloudFrontOriginAccessIdentityConfig :: Lens' UpdateCloudFrontOriginAccessIdentity CloudFrontOriginAccessIdentityConfig
ucfoaiCloudFrontOriginAccessIdentityConfig = lens _ucfoaiCloudFrontOriginAccessIdentityConfig (\ s a -> s{_ucfoaiCloudFrontOriginAccessIdentityConfig = a});
ucfoaiId :: Lens' UpdateCloudFrontOriginAccessIdentity Text
ucfoaiId = lens _ucfoaiId (\ s a -> s{_ucfoaiId = a});
instance AWSRequest
UpdateCloudFrontOriginAccessIdentity where
type Rs UpdateCloudFrontOriginAccessIdentity =
UpdateCloudFrontOriginAccessIdentityResponse
request = putXML cloudFront
response
= receiveXML
(\ s h x ->
UpdateCloudFrontOriginAccessIdentityResponse' <$>
(h .#? "ETag") <*> (parseXML x) <*>
(pure (fromEnum s)))
instance ToElement
UpdateCloudFrontOriginAccessIdentity where
toElement
= mkElement
"{http://cloudfront.amazonaws.com/doc/2015-04-17/}CloudFrontOriginAccessIdentityConfig"
.
_ucfoaiCloudFrontOriginAccessIdentityConfig
instance ToHeaders
UpdateCloudFrontOriginAccessIdentity where
toHeaders UpdateCloudFrontOriginAccessIdentity'{..}
= mconcat ["If-Match" =# _ucfoaiIfMatch]
instance ToPath UpdateCloudFrontOriginAccessIdentity
where
toPath UpdateCloudFrontOriginAccessIdentity'{..}
= mconcat
["/2015-04-17/origin-access-identity/cloudfront/",
toBS _ucfoaiId, "/config"]
instance ToQuery UpdateCloudFrontOriginAccessIdentity
where
toQuery = const mempty
data UpdateCloudFrontOriginAccessIdentityResponse = UpdateCloudFrontOriginAccessIdentityResponse'
{ _ucfoairsETag :: !(Maybe Text)
, _ucfoairsCloudFrontOriginAccessIdentity :: !(Maybe CloudFrontOriginAccessIdentity)
, _ucfoairsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateCloudFrontOriginAccessIdentityResponse
:: Int
-> UpdateCloudFrontOriginAccessIdentityResponse
updateCloudFrontOriginAccessIdentityResponse pStatus_ =
UpdateCloudFrontOriginAccessIdentityResponse'
{ _ucfoairsETag = Nothing
, _ucfoairsCloudFrontOriginAccessIdentity = Nothing
, _ucfoairsStatus = pStatus_
}
ucfoairsETag :: Lens' UpdateCloudFrontOriginAccessIdentityResponse (Maybe Text)
ucfoairsETag = lens _ucfoairsETag (\ s a -> s{_ucfoairsETag = a});
ucfoairsCloudFrontOriginAccessIdentity :: Lens' UpdateCloudFrontOriginAccessIdentityResponse (Maybe CloudFrontOriginAccessIdentity)
ucfoairsCloudFrontOriginAccessIdentity = lens _ucfoairsCloudFrontOriginAccessIdentity (\ s a -> s{_ucfoairsCloudFrontOriginAccessIdentity = a});
ucfoairsStatus :: Lens' UpdateCloudFrontOriginAccessIdentityResponse Int
ucfoairsStatus = lens _ucfoairsStatus (\ s a -> s{_ucfoairsStatus = a});