module Network.AWS.Redshift.CreateClusterSubnetGroup
(
CreateClusterSubnetGroup
, createClusterSubnetGroup
, ccsgClusterSubnetGroupName
, ccsgDescription
, ccsgSubnetIds
, ccsgTags
, CreateClusterSubnetGroupResponse
, createClusterSubnetGroupResponse
, ccsgrClusterSubnetGroup
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.Redshift.Types
import qualified GHC.Exts
data CreateClusterSubnetGroup = CreateClusterSubnetGroup
{ _ccsgClusterSubnetGroupName :: Text
, _ccsgDescription :: Text
, _ccsgSubnetIds :: List "member" Text
, _ccsgTags :: List "member" Tag
} deriving (Eq, Show)
createClusterSubnetGroup :: Text
-> Text
-> CreateClusterSubnetGroup
createClusterSubnetGroup p1 p2 = CreateClusterSubnetGroup
{ _ccsgClusterSubnetGroupName = p1
, _ccsgDescription = p2
, _ccsgSubnetIds = mempty
, _ccsgTags = mempty
}
ccsgClusterSubnetGroupName :: Lens' CreateClusterSubnetGroup Text
ccsgClusterSubnetGroupName =
lens _ccsgClusterSubnetGroupName
(\s a -> s { _ccsgClusterSubnetGroupName = a })
ccsgDescription :: Lens' CreateClusterSubnetGroup Text
ccsgDescription = lens _ccsgDescription (\s a -> s { _ccsgDescription = a })
ccsgSubnetIds :: Lens' CreateClusterSubnetGroup [Text]
ccsgSubnetIds = lens _ccsgSubnetIds (\s a -> s { _ccsgSubnetIds = a }) . _List
ccsgTags :: Lens' CreateClusterSubnetGroup [Tag]
ccsgTags = lens _ccsgTags (\s a -> s { _ccsgTags = a }) . _List
newtype CreateClusterSubnetGroupResponse = CreateClusterSubnetGroupResponse
{ _ccsgrClusterSubnetGroup :: Maybe ClusterSubnetGroup
} deriving (Eq, Show)
createClusterSubnetGroupResponse :: CreateClusterSubnetGroupResponse
createClusterSubnetGroupResponse = CreateClusterSubnetGroupResponse
{ _ccsgrClusterSubnetGroup = Nothing
}
ccsgrClusterSubnetGroup :: Lens' CreateClusterSubnetGroupResponse (Maybe ClusterSubnetGroup)
ccsgrClusterSubnetGroup =
lens _ccsgrClusterSubnetGroup (\s a -> s { _ccsgrClusterSubnetGroup = a })
instance ToPath CreateClusterSubnetGroup where
toPath = const "/"
instance ToQuery CreateClusterSubnetGroup where
toQuery CreateClusterSubnetGroup{..} = mconcat
[ "ClusterSubnetGroupName" =? _ccsgClusterSubnetGroupName
, "Description" =? _ccsgDescription
, "SubnetIds" =? _ccsgSubnetIds
, "Tags" =? _ccsgTags
]
instance ToHeaders CreateClusterSubnetGroup
instance AWSRequest CreateClusterSubnetGroup where
type Sv CreateClusterSubnetGroup = Redshift
type Rs CreateClusterSubnetGroup = CreateClusterSubnetGroupResponse
request = post "CreateClusterSubnetGroup"
response = xmlResponse
instance FromXML CreateClusterSubnetGroupResponse where
parseXML = withElement "CreateClusterSubnetGroupResult" $ \x -> CreateClusterSubnetGroupResponse
<$> x .@? "ClusterSubnetGroup"