module Network.AWS.RDS.CreateDBSnapshot
(
CreateDBSnapshot
, createDBSnapshot
, cdbs1DBInstanceIdentifier
, cdbs1DBSnapshotIdentifier
, cdbs1Tags
, CreateDBSnapshotResponse
, createDBSnapshotResponse
, cdbsr1DBSnapshot
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.RDS.Types
import qualified GHC.Exts
data CreateDBSnapshot = CreateDBSnapshot
{ _cdbs1DBInstanceIdentifier :: Text
, _cdbs1DBSnapshotIdentifier :: Text
, _cdbs1Tags :: List "member" Tag
} deriving (Eq, Read, Show)
createDBSnapshot :: Text
-> Text
-> CreateDBSnapshot
createDBSnapshot p1 p2 = CreateDBSnapshot
{ _cdbs1DBSnapshotIdentifier = p1
, _cdbs1DBInstanceIdentifier = p2
, _cdbs1Tags = mempty
}
cdbs1DBInstanceIdentifier :: Lens' CreateDBSnapshot Text
cdbs1DBInstanceIdentifier =
lens _cdbs1DBInstanceIdentifier
(\s a -> s { _cdbs1DBInstanceIdentifier = a })
cdbs1DBSnapshotIdentifier :: Lens' CreateDBSnapshot Text
cdbs1DBSnapshotIdentifier =
lens _cdbs1DBSnapshotIdentifier
(\s a -> s { _cdbs1DBSnapshotIdentifier = a })
cdbs1Tags :: Lens' CreateDBSnapshot [Tag]
cdbs1Tags = lens _cdbs1Tags (\s a -> s { _cdbs1Tags = a }) . _List
newtype CreateDBSnapshotResponse = CreateDBSnapshotResponse
{ _cdbsr1DBSnapshot :: Maybe DBSnapshot
} deriving (Eq, Read, Show)
createDBSnapshotResponse :: CreateDBSnapshotResponse
createDBSnapshotResponse = CreateDBSnapshotResponse
{ _cdbsr1DBSnapshot = Nothing
}
cdbsr1DBSnapshot :: Lens' CreateDBSnapshotResponse (Maybe DBSnapshot)
cdbsr1DBSnapshot = lens _cdbsr1DBSnapshot (\s a -> s { _cdbsr1DBSnapshot = a })
instance ToPath CreateDBSnapshot where
toPath = const "/"
instance ToQuery CreateDBSnapshot where
toQuery CreateDBSnapshot{..} = mconcat
[ "DBInstanceIdentifier" =? _cdbs1DBInstanceIdentifier
, "DBSnapshotIdentifier" =? _cdbs1DBSnapshotIdentifier
, "Tags" =? _cdbs1Tags
]
instance ToHeaders CreateDBSnapshot
instance AWSRequest CreateDBSnapshot where
type Sv CreateDBSnapshot = RDS
type Rs CreateDBSnapshot = CreateDBSnapshotResponse
request = post "CreateDBSnapshot"
response = xmlResponse
instance FromXML CreateDBSnapshotResponse where
parseXML = withElement "CreateDBSnapshotResult" $ \x -> CreateDBSnapshotResponse
<$> x .@? "DBSnapshot"