module Network.AWS.Redshift.CreateClusterSnapshot
(
CreateClusterSnapshot
, createClusterSnapshot
, ccsClusterIdentifier
, ccsSnapshotIdentifier
, ccsTags
, CreateClusterSnapshotResponse
, createClusterSnapshotResponse
, ccsr1Snapshot
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.Redshift.Types
import qualified GHC.Exts
data CreateClusterSnapshot = CreateClusterSnapshot
{ _ccsClusterIdentifier :: Text
, _ccsSnapshotIdentifier :: Text
, _ccsTags :: List "Tag" Tag
} deriving (Eq, Show)
createClusterSnapshot :: Text
-> Text
-> CreateClusterSnapshot
createClusterSnapshot p1 p2 = CreateClusterSnapshot
{ _ccsSnapshotIdentifier = p1
, _ccsClusterIdentifier = p2
, _ccsTags = mempty
}
ccsClusterIdentifier :: Lens' CreateClusterSnapshot Text
ccsClusterIdentifier =
lens _ccsClusterIdentifier (\s a -> s { _ccsClusterIdentifier = a })
ccsSnapshotIdentifier :: Lens' CreateClusterSnapshot Text
ccsSnapshotIdentifier =
lens _ccsSnapshotIdentifier (\s a -> s { _ccsSnapshotIdentifier = a })
ccsTags :: Lens' CreateClusterSnapshot [Tag]
ccsTags = lens _ccsTags (\s a -> s { _ccsTags = a }) . _List
newtype CreateClusterSnapshotResponse = CreateClusterSnapshotResponse
{ _ccsr1Snapshot :: Maybe Snapshot
} deriving (Eq, Show)
createClusterSnapshotResponse :: CreateClusterSnapshotResponse
createClusterSnapshotResponse = CreateClusterSnapshotResponse
{ _ccsr1Snapshot = Nothing
}
ccsr1Snapshot :: Lens' CreateClusterSnapshotResponse (Maybe Snapshot)
ccsr1Snapshot = lens _ccsr1Snapshot (\s a -> s { _ccsr1Snapshot = a })
instance ToPath CreateClusterSnapshot where
toPath = const "/"
instance ToQuery CreateClusterSnapshot where
toQuery CreateClusterSnapshot{..} = mconcat
[ "ClusterIdentifier" =? _ccsClusterIdentifier
, "SnapshotIdentifier" =? _ccsSnapshotIdentifier
, "Tags" =? _ccsTags
]
instance ToHeaders CreateClusterSnapshot
instance AWSRequest CreateClusterSnapshot where
type Sv CreateClusterSnapshot = Redshift
type Rs CreateClusterSnapshot = CreateClusterSnapshotResponse
request = post "CreateClusterSnapshot"
response = xmlResponse
instance FromXML CreateClusterSnapshotResponse where
parseXML = withElement "CreateClusterSnapshotResult" $ \x -> CreateClusterSnapshotResponse
<$> x .@? "Snapshot"