{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.Redshift.CreateClusterSubnetGroup
(
createClusterSubnetGroup
, CreateClusterSubnetGroup
, ccsgTags
, ccsgClusterSubnetGroupName
, ccsgDescription
, ccsgSubnetIds
, createClusterSubnetGroupResponse
, CreateClusterSubnetGroupResponse
, ccsgrsClusterSubnetGroup
, ccsgrsResponseStatus
) 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 CreateClusterSubnetGroup = CreateClusterSubnetGroup'
{ _ccsgTags :: !(Maybe [Tag])
, _ccsgClusterSubnetGroupName :: !Text
, _ccsgDescription :: !Text
, _ccsgSubnetIds :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createClusterSubnetGroup
:: Text
-> Text
-> CreateClusterSubnetGroup
createClusterSubnetGroup pClusterSubnetGroupName_ pDescription_ =
CreateClusterSubnetGroup'
{ _ccsgTags = Nothing
, _ccsgClusterSubnetGroupName = pClusterSubnetGroupName_
, _ccsgDescription = pDescription_
, _ccsgSubnetIds = mempty
}
ccsgTags :: Lens' CreateClusterSubnetGroup [Tag]
ccsgTags = lens _ccsgTags (\ s a -> s{_ccsgTags = a}) . _Default . _Coerce;
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}) . _Coerce;
instance AWSRequest CreateClusterSubnetGroup where
type Rs CreateClusterSubnetGroup =
CreateClusterSubnetGroupResponse
request = postQuery redshift
response
= receiveXMLWrapper "CreateClusterSubnetGroupResult"
(\ s h x ->
CreateClusterSubnetGroupResponse' <$>
(x .@? "ClusterSubnetGroup") <*> (pure (fromEnum s)))
instance Hashable CreateClusterSubnetGroup
instance NFData CreateClusterSubnetGroup
instance ToHeaders CreateClusterSubnetGroup where
toHeaders = const mempty
instance ToPath CreateClusterSubnetGroup where
toPath = const "/"
instance ToQuery CreateClusterSubnetGroup where
toQuery CreateClusterSubnetGroup'{..}
= mconcat
["Action" =:
("CreateClusterSubnetGroup" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _ccsgTags),
"ClusterSubnetGroupName" =:
_ccsgClusterSubnetGroupName,
"Description" =: _ccsgDescription,
"SubnetIds" =:
toQueryList "SubnetIdentifier" _ccsgSubnetIds]
data CreateClusterSubnetGroupResponse = CreateClusterSubnetGroupResponse'
{ _ccsgrsClusterSubnetGroup :: !(Maybe ClusterSubnetGroup)
, _ccsgrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createClusterSubnetGroupResponse
:: Int
-> CreateClusterSubnetGroupResponse
createClusterSubnetGroupResponse pResponseStatus_ =
CreateClusterSubnetGroupResponse'
{ _ccsgrsClusterSubnetGroup = Nothing
, _ccsgrsResponseStatus = pResponseStatus_
}
ccsgrsClusterSubnetGroup :: Lens' CreateClusterSubnetGroupResponse (Maybe ClusterSubnetGroup)
ccsgrsClusterSubnetGroup = lens _ccsgrsClusterSubnetGroup (\ s a -> s{_ccsgrsClusterSubnetGroup = a});
ccsgrsResponseStatus :: Lens' CreateClusterSubnetGroupResponse Int
ccsgrsResponseStatus = lens _ccsgrsResponseStatus (\ s a -> s{_ccsgrsResponseStatus = a});
instance NFData CreateClusterSubnetGroupResponse