module Network.AWS.ElastiCache.CreateSnapshot
(
CreateSnapshot
, createSnapshot
, csCacheClusterId
, csSnapshotName
, CreateSnapshotResponse
, createSnapshotResponse
, csr1Snapshot
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.ElastiCache.Types
import qualified GHC.Exts
data CreateSnapshot = CreateSnapshot
{ _csCacheClusterId :: Text
, _csSnapshotName :: Text
} deriving (Eq, Ord, Read, Show)
createSnapshot :: Text
-> Text
-> CreateSnapshot
createSnapshot p1 p2 = CreateSnapshot
{ _csCacheClusterId = p1
, _csSnapshotName = p2
}
csCacheClusterId :: Lens' CreateSnapshot Text
csCacheClusterId = lens _csCacheClusterId (\s a -> s { _csCacheClusterId = a })
csSnapshotName :: Lens' CreateSnapshot Text
csSnapshotName = lens _csSnapshotName (\s a -> s { _csSnapshotName = a })
newtype CreateSnapshotResponse = CreateSnapshotResponse
{ _csr1Snapshot :: Maybe Snapshot
} deriving (Eq, Read, Show)
createSnapshotResponse :: CreateSnapshotResponse
createSnapshotResponse = CreateSnapshotResponse
{ _csr1Snapshot = Nothing
}
csr1Snapshot :: Lens' CreateSnapshotResponse (Maybe Snapshot)
csr1Snapshot = lens _csr1Snapshot (\s a -> s { _csr1Snapshot = a })
instance ToPath CreateSnapshot where
toPath = const "/"
instance ToQuery CreateSnapshot where
toQuery CreateSnapshot{..} = mconcat
[ "CacheClusterId" =? _csCacheClusterId
, "SnapshotName" =? _csSnapshotName
]
instance ToHeaders CreateSnapshot
instance AWSRequest CreateSnapshot where
type Sv CreateSnapshot = ElastiCache
type Rs CreateSnapshot = CreateSnapshotResponse
request = post "CreateSnapshot"
response = xmlResponse
instance FromXML CreateSnapshotResponse where
parseXML = withElement "CreateSnapshotResult" $ \x -> CreateSnapshotResponse
<$> x .@? "Snapshot"