module Network.AWS.Redshift.ModifyClusterSubnetGroup
(
modifyClusterSubnetGroup
, ModifyClusterSubnetGroup
, mcsgDescription
, mcsgClusterSubnetGroupName
, mcsgSubnetIds
, modifyClusterSubnetGroupResponse
, ModifyClusterSubnetGroupResponse
, mcsgrsClusterSubnetGroup
, mcsgrsResponseStatus
) where
import Network.AWS.Prelude
import Network.AWS.Redshift.Types
import Network.AWS.Redshift.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data ModifyClusterSubnetGroup = ModifyClusterSubnetGroup'
{ _mcsgDescription :: !(Maybe Text)
, _mcsgClusterSubnetGroupName :: !Text
, _mcsgSubnetIds :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyClusterSubnetGroup
:: Text
-> ModifyClusterSubnetGroup
modifyClusterSubnetGroup pClusterSubnetGroupName_ =
ModifyClusterSubnetGroup'
{ _mcsgDescription = Nothing
, _mcsgClusterSubnetGroupName = pClusterSubnetGroupName_
, _mcsgSubnetIds = mempty
}
mcsgDescription :: Lens' ModifyClusterSubnetGroup (Maybe Text)
mcsgDescription = lens _mcsgDescription (\ s a -> s{_mcsgDescription = a});
mcsgClusterSubnetGroupName :: Lens' ModifyClusterSubnetGroup Text
mcsgClusterSubnetGroupName = lens _mcsgClusterSubnetGroupName (\ s a -> s{_mcsgClusterSubnetGroupName = a});
mcsgSubnetIds :: Lens' ModifyClusterSubnetGroup [Text]
mcsgSubnetIds = lens _mcsgSubnetIds (\ s a -> s{_mcsgSubnetIds = a}) . _Coerce;
instance AWSRequest ModifyClusterSubnetGroup where
type Rs ModifyClusterSubnetGroup =
ModifyClusterSubnetGroupResponse
request = postQuery redshift
response
= receiveXMLWrapper "ModifyClusterSubnetGroupResult"
(\ s h x ->
ModifyClusterSubnetGroupResponse' <$>
(x .@? "ClusterSubnetGroup") <*> (pure (fromEnum s)))
instance ToHeaders ModifyClusterSubnetGroup where
toHeaders = const mempty
instance ToPath ModifyClusterSubnetGroup where
toPath = const "/"
instance ToQuery ModifyClusterSubnetGroup where
toQuery ModifyClusterSubnetGroup'{..}
= mconcat
["Action" =:
("ModifyClusterSubnetGroup" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"Description" =: _mcsgDescription,
"ClusterSubnetGroupName" =:
_mcsgClusterSubnetGroupName,
"SubnetIds" =:
toQueryList "SubnetIdentifier" _mcsgSubnetIds]
data ModifyClusterSubnetGroupResponse = ModifyClusterSubnetGroupResponse'
{ _mcsgrsClusterSubnetGroup :: !(Maybe ClusterSubnetGroup)
, _mcsgrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyClusterSubnetGroupResponse
:: Int
-> ModifyClusterSubnetGroupResponse
modifyClusterSubnetGroupResponse pResponseStatus_ =
ModifyClusterSubnetGroupResponse'
{ _mcsgrsClusterSubnetGroup = Nothing
, _mcsgrsResponseStatus = pResponseStatus_
}
mcsgrsClusterSubnetGroup :: Lens' ModifyClusterSubnetGroupResponse (Maybe ClusterSubnetGroup)
mcsgrsClusterSubnetGroup = lens _mcsgrsClusterSubnetGroup (\ s a -> s{_mcsgrsClusterSubnetGroup = a});
mcsgrsResponseStatus :: Lens' ModifyClusterSubnetGroupResponse Int
mcsgrsResponseStatus = lens _mcsgrsResponseStatus (\ s a -> s{_mcsgrsResponseStatus = a});