module Network.AWS.CloudFront.DeleteDistribution
(
DeleteDistribution
, deleteDistribution
, ddId
, ddIfMatch
, DeleteDistributionResponse
, deleteDistributionResponse
) where
import Network.AWS.Prelude
import Network.AWS.Request.RestXML
import Network.AWS.CloudFront.Types
import qualified GHC.Exts
data DeleteDistribution = DeleteDistribution
{ _ddId :: Text
, _ddIfMatch :: Maybe Text
} deriving (Eq, Ord, Show)
deleteDistribution :: Text
-> DeleteDistribution
deleteDistribution p1 = DeleteDistribution
{ _ddId = p1
, _ddIfMatch = Nothing
}
ddId :: Lens' DeleteDistribution Text
ddId = lens _ddId (\s a -> s { _ddId = a })
ddIfMatch :: Lens' DeleteDistribution (Maybe Text)
ddIfMatch = lens _ddIfMatch (\s a -> s { _ddIfMatch = a })
data DeleteDistributionResponse = DeleteDistributionResponse
deriving (Eq, Ord, Show, Generic)
deleteDistributionResponse :: DeleteDistributionResponse
deleteDistributionResponse = DeleteDistributionResponse
instance ToPath DeleteDistribution where
toPath DeleteDistribution{..} = mconcat
[ "/2014-05-31/distribution/"
, toText _ddId
]
instance ToQuery DeleteDistribution where
toQuery = const mempty
instance ToHeaders DeleteDistribution where
toHeaders DeleteDistribution{..} = mconcat
[ "If-Match" =: _ddIfMatch
]
instance ToXMLRoot DeleteDistribution where
toXMLRoot = const (namespaced ns "DeleteDistribution" [])
instance ToXML DeleteDistribution
instance AWSRequest DeleteDistribution where
type Sv DeleteDistribution = CloudFront
type Rs DeleteDistribution = DeleteDistributionResponse
request = delete
response = nullResponse DeleteDistributionResponse