module Network.AWS.CloudFront.UpdateCloudFrontOriginAccessIdentity
(
UpdateCloudFrontOriginAccessIdentity
, updateCloudFrontOriginAccessIdentity
, ucfoaiCloudFrontOriginAccessIdentityConfig
, ucfoaiId
, ucfoaiIfMatch
, UpdateCloudFrontOriginAccessIdentityResponse
, updateCloudFrontOriginAccessIdentityResponse
, ucfoairCloudFrontOriginAccessIdentity
, ucfoairETag
) where
import Network.AWS.Prelude
import Network.AWS.Request.RestXML
import Network.AWS.CloudFront.Types
import qualified GHC.Exts
data UpdateCloudFrontOriginAccessIdentity = UpdateCloudFrontOriginAccessIdentity
{ _ucfoaiCloudFrontOriginAccessIdentityConfig :: CloudFrontOriginAccessIdentityConfig
, _ucfoaiId :: Text
, _ucfoaiIfMatch :: Maybe Text
} deriving (Eq, Read, Show)
updateCloudFrontOriginAccessIdentity :: CloudFrontOriginAccessIdentityConfig
-> Text
-> UpdateCloudFrontOriginAccessIdentity
updateCloudFrontOriginAccessIdentity p1 p2 = UpdateCloudFrontOriginAccessIdentity
{ _ucfoaiCloudFrontOriginAccessIdentityConfig = p1
, _ucfoaiId = p2
, _ucfoaiIfMatch = Nothing
}
ucfoaiCloudFrontOriginAccessIdentityConfig :: Lens' UpdateCloudFrontOriginAccessIdentity CloudFrontOriginAccessIdentityConfig
ucfoaiCloudFrontOriginAccessIdentityConfig =
lens _ucfoaiCloudFrontOriginAccessIdentityConfig
(\s a -> s { _ucfoaiCloudFrontOriginAccessIdentityConfig = a })
ucfoaiId :: Lens' UpdateCloudFrontOriginAccessIdentity Text
ucfoaiId = lens _ucfoaiId (\s a -> s { _ucfoaiId = a })
ucfoaiIfMatch :: Lens' UpdateCloudFrontOriginAccessIdentity (Maybe Text)
ucfoaiIfMatch = lens _ucfoaiIfMatch (\s a -> s { _ucfoaiIfMatch = a })
data UpdateCloudFrontOriginAccessIdentityResponse = UpdateCloudFrontOriginAccessIdentityResponse
{ _ucfoairCloudFrontOriginAccessIdentity :: Maybe CloudFrontOriginAccessIdentity
, _ucfoairETag :: Maybe Text
} deriving (Eq, Read, Show)
updateCloudFrontOriginAccessIdentityResponse :: UpdateCloudFrontOriginAccessIdentityResponse
updateCloudFrontOriginAccessIdentityResponse = UpdateCloudFrontOriginAccessIdentityResponse
{ _ucfoairCloudFrontOriginAccessIdentity = Nothing
, _ucfoairETag = Nothing
}
ucfoairCloudFrontOriginAccessIdentity :: Lens' UpdateCloudFrontOriginAccessIdentityResponse (Maybe CloudFrontOriginAccessIdentity)
ucfoairCloudFrontOriginAccessIdentity =
lens _ucfoairCloudFrontOriginAccessIdentity
(\s a -> s { _ucfoairCloudFrontOriginAccessIdentity = a })
ucfoairETag :: Lens' UpdateCloudFrontOriginAccessIdentityResponse (Maybe Text)
ucfoairETag = lens _ucfoairETag (\s a -> s { _ucfoairETag = a })
instance ToPath UpdateCloudFrontOriginAccessIdentity where
toPath UpdateCloudFrontOriginAccessIdentity{..} = mconcat
[ "/2014-11-06/origin-access-identity/cloudfront/"
, toText _ucfoaiId
, "/config"
]
instance ToQuery UpdateCloudFrontOriginAccessIdentity where
toQuery = const mempty
instance ToHeaders UpdateCloudFrontOriginAccessIdentity where
toHeaders UpdateCloudFrontOriginAccessIdentity{..} = mconcat
[ "If-Match" =: _ucfoaiIfMatch
]
instance ToXMLRoot UpdateCloudFrontOriginAccessIdentity where
toXMLRoot = extractRoot ns . toXML . _ucfoaiCloudFrontOriginAccessIdentityConfig
instance ToXML UpdateCloudFrontOriginAccessIdentity
instance AWSRequest UpdateCloudFrontOriginAccessIdentity where
type Sv UpdateCloudFrontOriginAccessIdentity = CloudFront
type Rs UpdateCloudFrontOriginAccessIdentity = UpdateCloudFrontOriginAccessIdentityResponse
request = put
response = xmlHeaderResponse $ \h x -> UpdateCloudFrontOriginAccessIdentityResponse
<$> x .@? "CloudFrontOriginAccessIdentity"
<*> h ~:? "ETag"