module Network.AWS.Redshift.CreateClusterSecurityGroup
(
CreateClusterSecurityGroup
, createClusterSecurityGroup
, ccsg1ClusterSecurityGroupName
, ccsg1Description
, ccsg1Tags
, CreateClusterSecurityGroupResponse
, createClusterSecurityGroupResponse
, ccsgrClusterSecurityGroup
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.Redshift.Types
import qualified GHC.Exts
data CreateClusterSecurityGroup = CreateClusterSecurityGroup
{ _ccsg1ClusterSecurityGroupName :: Text
, _ccsg1Description :: Text
, _ccsg1Tags :: List "member" Tag
} deriving (Eq, Show)
createClusterSecurityGroup :: Text
-> Text
-> CreateClusterSecurityGroup
createClusterSecurityGroup p1 p2 = CreateClusterSecurityGroup
{ _ccsg1ClusterSecurityGroupName = p1
, _ccsg1Description = p2
, _ccsg1Tags = mempty
}
ccsg1ClusterSecurityGroupName :: Lens' CreateClusterSecurityGroup Text
ccsg1ClusterSecurityGroupName =
lens _ccsg1ClusterSecurityGroupName
(\s a -> s { _ccsg1ClusterSecurityGroupName = a })
ccsg1Description :: Lens' CreateClusterSecurityGroup Text
ccsg1Description = lens _ccsg1Description (\s a -> s { _ccsg1Description = a })
ccsg1Tags :: Lens' CreateClusterSecurityGroup [Tag]
ccsg1Tags = lens _ccsg1Tags (\s a -> s { _ccsg1Tags = a }) . _List
newtype CreateClusterSecurityGroupResponse = CreateClusterSecurityGroupResponse
{ _ccsgrClusterSecurityGroup :: Maybe ClusterSecurityGroup
} deriving (Eq, Show)
createClusterSecurityGroupResponse :: CreateClusterSecurityGroupResponse
createClusterSecurityGroupResponse = CreateClusterSecurityGroupResponse
{ _ccsgrClusterSecurityGroup = Nothing
}
ccsgrClusterSecurityGroup :: Lens' CreateClusterSecurityGroupResponse (Maybe ClusterSecurityGroup)
ccsgrClusterSecurityGroup =
lens _ccsgrClusterSecurityGroup
(\s a -> s { _ccsgrClusterSecurityGroup = a })
instance ToPath CreateClusterSecurityGroup where
toPath = const "/"
instance ToQuery CreateClusterSecurityGroup where
toQuery CreateClusterSecurityGroup{..} = mconcat
[ "ClusterSecurityGroupName" =? _ccsg1ClusterSecurityGroupName
, "Description" =? _ccsg1Description
, "Tags" =? _ccsg1Tags
]
instance ToHeaders CreateClusterSecurityGroup
instance AWSRequest CreateClusterSecurityGroup where
type Sv CreateClusterSecurityGroup = Redshift
type Rs CreateClusterSecurityGroup = CreateClusterSecurityGroupResponse
request = post "CreateClusterSecurityGroup"
response = xmlResponse
instance FromXML CreateClusterSecurityGroupResponse where
parseXML = withElement "CreateClusterSecurityGroupResult" $ \x -> CreateClusterSecurityGroupResponse
<$> x .@? "ClusterSecurityGroup"