module Network.AWS.CloudFront.CreateStreamingDistribution
(
CreateStreamingDistribution
, createStreamingDistribution
, csdStreamingDistributionConfig
, CreateStreamingDistributionResponse
, createStreamingDistributionResponse
, csdrETag
, csdrLocation
, csdrStreamingDistribution
) where
import Network.AWS.Prelude
import Network.AWS.Request.RestXML
import Network.AWS.CloudFront.Types
import qualified GHC.Exts
newtype CreateStreamingDistribution = CreateStreamingDistribution
{ _csdStreamingDistributionConfig :: StreamingDistributionConfig
} deriving (Eq, Show)
createStreamingDistribution :: StreamingDistributionConfig
-> CreateStreamingDistribution
createStreamingDistribution p1 = CreateStreamingDistribution
{ _csdStreamingDistributionConfig = p1
}
csdStreamingDistributionConfig :: Lens' CreateStreamingDistribution StreamingDistributionConfig
csdStreamingDistributionConfig =
lens _csdStreamingDistributionConfig
(\s a -> s { _csdStreamingDistributionConfig = a })
data CreateStreamingDistributionResponse = CreateStreamingDistributionResponse
{ _csdrETag :: Maybe Text
, _csdrLocation :: Maybe Text
, _csdrStreamingDistribution :: Maybe StreamingDistribution
} deriving (Eq, Show)
createStreamingDistributionResponse :: CreateStreamingDistributionResponse
createStreamingDistributionResponse = CreateStreamingDistributionResponse
{ _csdrStreamingDistribution = Nothing
, _csdrLocation = Nothing
, _csdrETag = Nothing
}
csdrETag :: Lens' CreateStreamingDistributionResponse (Maybe Text)
csdrETag = lens _csdrETag (\s a -> s { _csdrETag = a })
csdrLocation :: Lens' CreateStreamingDistributionResponse (Maybe Text)
csdrLocation = lens _csdrLocation (\s a -> s { _csdrLocation = a })
csdrStreamingDistribution :: Lens' CreateStreamingDistributionResponse (Maybe StreamingDistribution)
csdrStreamingDistribution =
lens _csdrStreamingDistribution
(\s a -> s { _csdrStreamingDistribution = a })
instance ToPath CreateStreamingDistribution where
toPath = const "/2014-05-31/streaming-distribution"
instance ToQuery CreateStreamingDistribution where
toQuery = const mempty
instance ToHeaders CreateStreamingDistribution
instance ToXMLRoot CreateStreamingDistribution where
toXMLRoot CreateStreamingDistribution{..} = namespaced ns "CreateStreamingDistribution"
[ "StreamingDistributionConfig" =@ _csdStreamingDistributionConfig
]
instance ToXML CreateStreamingDistribution
instance AWSRequest CreateStreamingDistribution where
type Sv CreateStreamingDistribution = CloudFront
type Rs CreateStreamingDistribution = CreateStreamingDistributionResponse
request = post
response = xmlHeaderResponse $ \h x -> CreateStreamingDistributionResponse
<$> h ~:? "ETag"
<*> h ~:? "Location"
<*> x .@? "StreamingDistribution"