{-# 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.DAX.CreateParameterGroup
(
createParameterGroup
, CreateParameterGroup
, cpgDescription
, cpgParameterGroupName
, createParameterGroupResponse
, CreateParameterGroupResponse
, cpgrsParameterGroup
, cpgrsResponseStatus
) where
import Network.AWS.DAX.Types
import Network.AWS.DAX.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CreateParameterGroup = CreateParameterGroup'
{ _cpgDescription :: !(Maybe Text)
, _cpgParameterGroupName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createParameterGroup
:: Text
-> CreateParameterGroup
createParameterGroup pParameterGroupName_ =
CreateParameterGroup'
{_cpgDescription = Nothing, _cpgParameterGroupName = pParameterGroupName_}
cpgDescription :: Lens' CreateParameterGroup (Maybe Text)
cpgDescription = lens _cpgDescription (\ s a -> s{_cpgDescription = a})
cpgParameterGroupName :: Lens' CreateParameterGroup Text
cpgParameterGroupName = lens _cpgParameterGroupName (\ s a -> s{_cpgParameterGroupName = a})
instance AWSRequest CreateParameterGroup where
type Rs CreateParameterGroup =
CreateParameterGroupResponse
request = postJSON dax
response
= receiveJSON
(\ s h x ->
CreateParameterGroupResponse' <$>
(x .?> "ParameterGroup") <*> (pure (fromEnum s)))
instance Hashable CreateParameterGroup where
instance NFData CreateParameterGroup where
instance ToHeaders CreateParameterGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonDAXV3.CreateParameterGroup" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateParameterGroup where
toJSON CreateParameterGroup'{..}
= object
(catMaybes
[("Description" .=) <$> _cpgDescription,
Just
("ParameterGroupName" .= _cpgParameterGroupName)])
instance ToPath CreateParameterGroup where
toPath = const "/"
instance ToQuery CreateParameterGroup where
toQuery = const mempty
data CreateParameterGroupResponse = CreateParameterGroupResponse'
{ _cpgrsParameterGroup :: !(Maybe ParameterGroup)
, _cpgrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createParameterGroupResponse
:: Int
-> CreateParameterGroupResponse
createParameterGroupResponse pResponseStatus_ =
CreateParameterGroupResponse'
{_cpgrsParameterGroup = Nothing, _cpgrsResponseStatus = pResponseStatus_}
cpgrsParameterGroup :: Lens' CreateParameterGroupResponse (Maybe ParameterGroup)
cpgrsParameterGroup = lens _cpgrsParameterGroup (\ s a -> s{_cpgrsParameterGroup = a})
cpgrsResponseStatus :: Lens' CreateParameterGroupResponse Int
cpgrsResponseStatus = lens _cpgrsResponseStatus (\ s a -> s{_cpgrsResponseStatus = a})
instance NFData CreateParameterGroupResponse where