module Network.AWS.CloudFront.UpdateCloudFrontOriginAccessIdentity
(
updateCloudFrontOriginAccessIdentity
, UpdateCloudFrontOriginAccessIdentity
, ucfoaiIfMatch
, ucfoaiCloudFrontOriginAccessIdentityConfig
, ucfoaiId
, updateCloudFrontOriginAccessIdentityResponse
, UpdateCloudFrontOriginAccessIdentityResponse
, ucfoairsETag
, ucfoairsCloudFrontOriginAccessIdentity
, ucfoairsResponseStatus
) where
import Network.AWS.CloudFront.Types
import Network.AWS.CloudFront.Types.Product
import Network.AWS.Lens
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 Hashable
UpdateCloudFrontOriginAccessIdentity
instance ToElement
UpdateCloudFrontOriginAccessIdentity where
toElement
= mkElement
"{http://cloudfront.amazonaws.com/doc/2016-01-28/}CloudFrontOriginAccessIdentityConfig"
.
_ucfoaiCloudFrontOriginAccessIdentityConfig
instance ToHeaders
UpdateCloudFrontOriginAccessIdentity where
toHeaders UpdateCloudFrontOriginAccessIdentity'{..}
= mconcat ["If-Match" =# _ucfoaiIfMatch]
instance ToPath UpdateCloudFrontOriginAccessIdentity
where
toPath UpdateCloudFrontOriginAccessIdentity'{..}
= mconcat
["/2016-01-28/origin-access-identity/cloudfront/",
toBS _ucfoaiId, "/config"]
instance ToQuery UpdateCloudFrontOriginAccessIdentity
where
toQuery = const mempty
data UpdateCloudFrontOriginAccessIdentityResponse = UpdateCloudFrontOriginAccessIdentityResponse'
{ _ucfoairsETag :: !(Maybe Text)
, _ucfoairsCloudFrontOriginAccessIdentity :: !(Maybe CloudFrontOriginAccessIdentity)
, _ucfoairsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateCloudFrontOriginAccessIdentityResponse
:: Int
-> UpdateCloudFrontOriginAccessIdentityResponse
updateCloudFrontOriginAccessIdentityResponse pResponseStatus_ =
UpdateCloudFrontOriginAccessIdentityResponse'
{ _ucfoairsETag = Nothing
, _ucfoairsCloudFrontOriginAccessIdentity = Nothing
, _ucfoairsResponseStatus = pResponseStatus_
}
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});
ucfoairsResponseStatus :: Lens' UpdateCloudFrontOriginAccessIdentityResponse Int
ucfoairsResponseStatus = lens _ucfoairsResponseStatus (\ s a -> s{_ucfoairsResponseStatus = a});