{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.CloudFront.UpdateFieldLevelEncryptionConfig
(
updateFieldLevelEncryptionConfig
, UpdateFieldLevelEncryptionConfig
, uflecIfMatch
, uflecFieldLevelEncryptionConfig
, uflecId
, updateFieldLevelEncryptionConfigResponse
, UpdateFieldLevelEncryptionConfigResponse
, uflecrsETag
, uflecrsFieldLevelEncryption
, uflecrsResponseStatus
) 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 UpdateFieldLevelEncryptionConfig = UpdateFieldLevelEncryptionConfig'
{ _uflecIfMatch :: !(Maybe Text)
, _uflecFieldLevelEncryptionConfig :: !FieldLevelEncryptionConfig
, _uflecId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateFieldLevelEncryptionConfig
:: FieldLevelEncryptionConfig
-> Text
-> UpdateFieldLevelEncryptionConfig
updateFieldLevelEncryptionConfig pFieldLevelEncryptionConfig_ pId_ =
UpdateFieldLevelEncryptionConfig'
{ _uflecIfMatch = Nothing
, _uflecFieldLevelEncryptionConfig = pFieldLevelEncryptionConfig_
, _uflecId = pId_
}
uflecIfMatch :: Lens' UpdateFieldLevelEncryptionConfig (Maybe Text)
uflecIfMatch = lens _uflecIfMatch (\ s a -> s{_uflecIfMatch = a})
uflecFieldLevelEncryptionConfig :: Lens' UpdateFieldLevelEncryptionConfig FieldLevelEncryptionConfig
uflecFieldLevelEncryptionConfig = lens _uflecFieldLevelEncryptionConfig (\ s a -> s{_uflecFieldLevelEncryptionConfig = a})
uflecId :: Lens' UpdateFieldLevelEncryptionConfig Text
uflecId = lens _uflecId (\ s a -> s{_uflecId = a})
instance AWSRequest UpdateFieldLevelEncryptionConfig
where
type Rs UpdateFieldLevelEncryptionConfig =
UpdateFieldLevelEncryptionConfigResponse
request = putXML cloudFront
response
= receiveXML
(\ s h x ->
UpdateFieldLevelEncryptionConfigResponse' <$>
(h .#? "ETag") <*> (parseXML x) <*>
(pure (fromEnum s)))
instance Hashable UpdateFieldLevelEncryptionConfig
where
instance NFData UpdateFieldLevelEncryptionConfig
where
instance ToElement UpdateFieldLevelEncryptionConfig
where
toElement
= mkElement
"{http://cloudfront.amazonaws.com/doc/2017-10-30/}FieldLevelEncryptionConfig"
.
_uflecFieldLevelEncryptionConfig
instance ToHeaders UpdateFieldLevelEncryptionConfig
where
toHeaders UpdateFieldLevelEncryptionConfig'{..}
= mconcat ["If-Match" =# _uflecIfMatch]
instance ToPath UpdateFieldLevelEncryptionConfig
where
toPath UpdateFieldLevelEncryptionConfig'{..}
= mconcat
["/2017-10-30/field-level-encryption/",
toBS _uflecId, "/config"]
instance ToQuery UpdateFieldLevelEncryptionConfig
where
toQuery = const mempty
data UpdateFieldLevelEncryptionConfigResponse = UpdateFieldLevelEncryptionConfigResponse'
{ _uflecrsETag :: !(Maybe Text)
, _uflecrsFieldLevelEncryption :: !(Maybe FieldLevelEncryption)
, _uflecrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateFieldLevelEncryptionConfigResponse
:: Int
-> UpdateFieldLevelEncryptionConfigResponse
updateFieldLevelEncryptionConfigResponse pResponseStatus_ =
UpdateFieldLevelEncryptionConfigResponse'
{ _uflecrsETag = Nothing
, _uflecrsFieldLevelEncryption = Nothing
, _uflecrsResponseStatus = pResponseStatus_
}
uflecrsETag :: Lens' UpdateFieldLevelEncryptionConfigResponse (Maybe Text)
uflecrsETag = lens _uflecrsETag (\ s a -> s{_uflecrsETag = a})
uflecrsFieldLevelEncryption :: Lens' UpdateFieldLevelEncryptionConfigResponse (Maybe FieldLevelEncryption)
uflecrsFieldLevelEncryption = lens _uflecrsFieldLevelEncryption (\ s a -> s{_uflecrsFieldLevelEncryption = a})
uflecrsResponseStatus :: Lens' UpdateFieldLevelEncryptionConfigResponse Int
uflecrsResponseStatus = lens _uflecrsResponseStatus (\ s a -> s{_uflecrsResponseStatus = a})
instance NFData
UpdateFieldLevelEncryptionConfigResponse
where