module Network.AWS.CloudFront.UpdateStreamingDistribution
(
updateStreamingDistribution
, UpdateStreamingDistribution
, usdIfMatch
, usdStreamingDistributionConfig
, usdId
, updateStreamingDistributionResponse
, UpdateStreamingDistributionResponse
, usdrsETag
, usdrsStreamingDistribution
, usdrsStatus
) 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 UpdateStreamingDistribution = UpdateStreamingDistribution'
{ _usdIfMatch :: !(Maybe Text)
, _usdStreamingDistributionConfig :: !StreamingDistributionConfig
, _usdId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateStreamingDistribution
:: StreamingDistributionConfig
-> Text
-> UpdateStreamingDistribution
updateStreamingDistribution pStreamingDistributionConfig_ pId_ =
UpdateStreamingDistribution'
{ _usdIfMatch = Nothing
, _usdStreamingDistributionConfig = pStreamingDistributionConfig_
, _usdId = pId_
}
usdIfMatch :: Lens' UpdateStreamingDistribution (Maybe Text)
usdIfMatch = lens _usdIfMatch (\ s a -> s{_usdIfMatch = a});
usdStreamingDistributionConfig :: Lens' UpdateStreamingDistribution StreamingDistributionConfig
usdStreamingDistributionConfig = lens _usdStreamingDistributionConfig (\ s a -> s{_usdStreamingDistributionConfig = a});
usdId :: Lens' UpdateStreamingDistribution Text
usdId = lens _usdId (\ s a -> s{_usdId = a});
instance AWSRequest UpdateStreamingDistribution where
type Rs UpdateStreamingDistribution =
UpdateStreamingDistributionResponse
request = putXML cloudFront
response
= receiveXML
(\ s h x ->
UpdateStreamingDistributionResponse' <$>
(h .#? "ETag") <*> (parseXML x) <*>
(pure (fromEnum s)))
instance ToElement UpdateStreamingDistribution where
toElement
= mkElement
"{http://cloudfront.amazonaws.com/doc/2015-04-17/}StreamingDistributionConfig"
.
_usdStreamingDistributionConfig
instance ToHeaders UpdateStreamingDistribution where
toHeaders UpdateStreamingDistribution'{..}
= mconcat ["If-Match" =# _usdIfMatch]
instance ToPath UpdateStreamingDistribution where
toPath UpdateStreamingDistribution'{..}
= mconcat
["/2015-04-17/streaming-distribution/", toBS _usdId,
"/config"]
instance ToQuery UpdateStreamingDistribution where
toQuery = const mempty
data UpdateStreamingDistributionResponse = UpdateStreamingDistributionResponse'
{ _usdrsETag :: !(Maybe Text)
, _usdrsStreamingDistribution :: !(Maybe StreamingDistribution)
, _usdrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateStreamingDistributionResponse
:: Int
-> UpdateStreamingDistributionResponse
updateStreamingDistributionResponse pStatus_ =
UpdateStreamingDistributionResponse'
{ _usdrsETag = Nothing
, _usdrsStreamingDistribution = Nothing
, _usdrsStatus = pStatus_
}
usdrsETag :: Lens' UpdateStreamingDistributionResponse (Maybe Text)
usdrsETag = lens _usdrsETag (\ s a -> s{_usdrsETag = a});
usdrsStreamingDistribution :: Lens' UpdateStreamingDistributionResponse (Maybe StreamingDistribution)
usdrsStreamingDistribution = lens _usdrsStreamingDistribution (\ s a -> s{_usdrsStreamingDistribution = a});
usdrsStatus :: Lens' UpdateStreamingDistributionResponse Int
usdrsStatus = lens _usdrsStatus (\ s a -> s{_usdrsStatus = a});