{-# 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.CreateClusterParameterGroup
(
createClusterParameterGroup
, CreateClusterParameterGroup
, ccpgTags
, ccpgParameterGroupName
, ccpgParameterGroupFamily
, ccpgDescription
, createClusterParameterGroupResponse
, CreateClusterParameterGroupResponse
, ccpgrsClusterParameterGroup
, ccpgrsResponseStatus
) 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 CreateClusterParameterGroup = CreateClusterParameterGroup'
{ _ccpgTags :: !(Maybe [Tag])
, _ccpgParameterGroupName :: !Text
, _ccpgParameterGroupFamily :: !Text
, _ccpgDescription :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createClusterParameterGroup
:: Text
-> Text
-> Text
-> CreateClusterParameterGroup
createClusterParameterGroup pParameterGroupName_ pParameterGroupFamily_ pDescription_ =
CreateClusterParameterGroup'
{ _ccpgTags = Nothing
, _ccpgParameterGroupName = pParameterGroupName_
, _ccpgParameterGroupFamily = pParameterGroupFamily_
, _ccpgDescription = pDescription_
}
ccpgTags :: Lens' CreateClusterParameterGroup [Tag]
ccpgTags = lens _ccpgTags (\ s a -> s{_ccpgTags = a}) . _Default . _Coerce
ccpgParameterGroupName :: Lens' CreateClusterParameterGroup Text
ccpgParameterGroupName = lens _ccpgParameterGroupName (\ s a -> s{_ccpgParameterGroupName = a})
ccpgParameterGroupFamily :: Lens' CreateClusterParameterGroup Text
ccpgParameterGroupFamily = lens _ccpgParameterGroupFamily (\ s a -> s{_ccpgParameterGroupFamily = a})
ccpgDescription :: Lens' CreateClusterParameterGroup Text
ccpgDescription = lens _ccpgDescription (\ s a -> s{_ccpgDescription = a})
instance AWSRequest CreateClusterParameterGroup where
type Rs CreateClusterParameterGroup =
CreateClusterParameterGroupResponse
request = postQuery redshift
response
= receiveXMLWrapper
"CreateClusterParameterGroupResult"
(\ s h x ->
CreateClusterParameterGroupResponse' <$>
(x .@? "ClusterParameterGroup") <*>
(pure (fromEnum s)))
instance Hashable CreateClusterParameterGroup where
instance NFData CreateClusterParameterGroup where
instance ToHeaders CreateClusterParameterGroup where
toHeaders = const mempty
instance ToPath CreateClusterParameterGroup where
toPath = const "/"
instance ToQuery CreateClusterParameterGroup where
toQuery CreateClusterParameterGroup'{..}
= mconcat
["Action" =:
("CreateClusterParameterGroup" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _ccpgTags),
"ParameterGroupName" =: _ccpgParameterGroupName,
"ParameterGroupFamily" =: _ccpgParameterGroupFamily,
"Description" =: _ccpgDescription]
data CreateClusterParameterGroupResponse = CreateClusterParameterGroupResponse'
{ _ccpgrsClusterParameterGroup :: !(Maybe ClusterParameterGroup)
, _ccpgrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createClusterParameterGroupResponse
:: Int
-> CreateClusterParameterGroupResponse
createClusterParameterGroupResponse pResponseStatus_ =
CreateClusterParameterGroupResponse'
{ _ccpgrsClusterParameterGroup = Nothing
, _ccpgrsResponseStatus = pResponseStatus_
}
ccpgrsClusterParameterGroup :: Lens' CreateClusterParameterGroupResponse (Maybe ClusterParameterGroup)
ccpgrsClusterParameterGroup = lens _ccpgrsClusterParameterGroup (\ s a -> s{_ccpgrsClusterParameterGroup = a})
ccpgrsResponseStatus :: Lens' CreateClusterParameterGroupResponse Int
ccpgrsResponseStatus = lens _ccpgrsResponseStatus (\ s a -> s{_ccpgrsResponseStatus = a})
instance NFData CreateClusterParameterGroupResponse
where