module Network.AWS.Redshift.CreateClusterSecurityGroup
(
createClusterSecurityGroup
, CreateClusterSecurityGroup
, creTags
, creClusterSecurityGroupName
, creDescription
, createClusterSecurityGroupResponse
, CreateClusterSecurityGroupResponse
, crsClusterSecurityGroup
, crsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Redshift.Types
import Network.AWS.Redshift.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data CreateClusterSecurityGroup = CreateClusterSecurityGroup'
{ _creTags :: !(Maybe [Tag])
, _creClusterSecurityGroupName :: !Text
, _creDescription :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createClusterSecurityGroup
:: Text
-> Text
-> CreateClusterSecurityGroup
createClusterSecurityGroup pClusterSecurityGroupName_ pDescription_ =
CreateClusterSecurityGroup'
{ _creTags = Nothing
, _creClusterSecurityGroupName = pClusterSecurityGroupName_
, _creDescription = pDescription_
}
creTags :: Lens' CreateClusterSecurityGroup [Tag]
creTags = lens _creTags (\ s a -> s{_creTags = a}) . _Default . _Coerce;
creClusterSecurityGroupName :: Lens' CreateClusterSecurityGroup Text
creClusterSecurityGroupName = lens _creClusterSecurityGroupName (\ s a -> s{_creClusterSecurityGroupName = a});
creDescription :: Lens' CreateClusterSecurityGroup Text
creDescription = lens _creDescription (\ s a -> s{_creDescription = a});
instance AWSRequest CreateClusterSecurityGroup where
type Rs CreateClusterSecurityGroup =
CreateClusterSecurityGroupResponse
request = postQuery redshift
response
= receiveXMLWrapper
"CreateClusterSecurityGroupResult"
(\ s h x ->
CreateClusterSecurityGroupResponse' <$>
(x .@? "ClusterSecurityGroup") <*>
(pure (fromEnum s)))
instance Hashable CreateClusterSecurityGroup
instance NFData CreateClusterSecurityGroup
instance ToHeaders CreateClusterSecurityGroup where
toHeaders = const mempty
instance ToPath CreateClusterSecurityGroup where
toPath = const "/"
instance ToQuery CreateClusterSecurityGroup where
toQuery CreateClusterSecurityGroup'{..}
= mconcat
["Action" =:
("CreateClusterSecurityGroup" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _creTags),
"ClusterSecurityGroupName" =:
_creClusterSecurityGroupName,
"Description" =: _creDescription]
data CreateClusterSecurityGroupResponse = CreateClusterSecurityGroupResponse'
{ _crsClusterSecurityGroup :: !(Maybe ClusterSecurityGroup)
, _crsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createClusterSecurityGroupResponse
:: Int
-> CreateClusterSecurityGroupResponse
createClusterSecurityGroupResponse pResponseStatus_ =
CreateClusterSecurityGroupResponse'
{ _crsClusterSecurityGroup = Nothing
, _crsResponseStatus = pResponseStatus_
}
crsClusterSecurityGroup :: Lens' CreateClusterSecurityGroupResponse (Maybe ClusterSecurityGroup)
crsClusterSecurityGroup = lens _crsClusterSecurityGroup (\ s a -> s{_crsClusterSecurityGroup = a});
crsResponseStatus :: Lens' CreateClusterSecurityGroupResponse Int
crsResponseStatus = lens _crsResponseStatus (\ s a -> s{_crsResponseStatus = a});
instance NFData CreateClusterSecurityGroupResponse