module Network.AWS.ElastiCache.DeleteReplicationGroup
(
DeleteReplicationGroup
, deleteReplicationGroup
, drgFinalSnapshotIdentifier
, drgReplicationGroupId
, drgRetainPrimaryCluster
, DeleteReplicationGroupResponse
, deleteReplicationGroupResponse
, drgrReplicationGroup
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.ElastiCache.Types
import qualified GHC.Exts
data DeleteReplicationGroup = DeleteReplicationGroup
{ _drgFinalSnapshotIdentifier :: Maybe Text
, _drgReplicationGroupId :: Text
, _drgRetainPrimaryCluster :: Maybe Bool
} deriving (Eq, Ord, Read, Show)
deleteReplicationGroup :: Text
-> DeleteReplicationGroup
deleteReplicationGroup p1 = DeleteReplicationGroup
{ _drgReplicationGroupId = p1
, _drgRetainPrimaryCluster = Nothing
, _drgFinalSnapshotIdentifier = Nothing
}
drgFinalSnapshotIdentifier :: Lens' DeleteReplicationGroup (Maybe Text)
drgFinalSnapshotIdentifier =
lens _drgFinalSnapshotIdentifier
(\s a -> s { _drgFinalSnapshotIdentifier = a })
drgReplicationGroupId :: Lens' DeleteReplicationGroup Text
drgReplicationGroupId =
lens _drgReplicationGroupId (\s a -> s { _drgReplicationGroupId = a })
drgRetainPrimaryCluster :: Lens' DeleteReplicationGroup (Maybe Bool)
drgRetainPrimaryCluster =
lens _drgRetainPrimaryCluster (\s a -> s { _drgRetainPrimaryCluster = a })
newtype DeleteReplicationGroupResponse = DeleteReplicationGroupResponse
{ _drgrReplicationGroup :: Maybe ReplicationGroup
} deriving (Eq, Read, Show)
deleteReplicationGroupResponse :: DeleteReplicationGroupResponse
deleteReplicationGroupResponse = DeleteReplicationGroupResponse
{ _drgrReplicationGroup = Nothing
}
drgrReplicationGroup :: Lens' DeleteReplicationGroupResponse (Maybe ReplicationGroup)
drgrReplicationGroup =
lens _drgrReplicationGroup (\s a -> s { _drgrReplicationGroup = a })
instance ToPath DeleteReplicationGroup where
toPath = const "/"
instance ToQuery DeleteReplicationGroup where
toQuery DeleteReplicationGroup{..} = mconcat
[ "FinalSnapshotIdentifier" =? _drgFinalSnapshotIdentifier
, "ReplicationGroupId" =? _drgReplicationGroupId
, "RetainPrimaryCluster" =? _drgRetainPrimaryCluster
]
instance ToHeaders DeleteReplicationGroup
instance AWSRequest DeleteReplicationGroup where
type Sv DeleteReplicationGroup = ElastiCache
type Rs DeleteReplicationGroup = DeleteReplicationGroupResponse
request = post "DeleteReplicationGroup"
response = xmlResponse
instance FromXML DeleteReplicationGroupResponse where
parseXML = withElement "DeleteReplicationGroupResult" $ \x -> DeleteReplicationGroupResponse
<$> x .@? "ReplicationGroup"