{-# 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.RDS.CreateOptionGroup
(
createOptionGroup
, CreateOptionGroup
, cogTags
, cogOptionGroupName
, cogEngineName
, cogMajorEngineVersion
, cogOptionGroupDescription
, createOptionGroupResponse
, CreateOptionGroupResponse
, crsOptionGroup
, crsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data CreateOptionGroup = CreateOptionGroup'
{ _cogTags :: !(Maybe [Tag])
, _cogOptionGroupName :: !Text
, _cogEngineName :: !Text
, _cogMajorEngineVersion :: !Text
, _cogOptionGroupDescription :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createOptionGroup
:: Text
-> Text
-> Text
-> Text
-> CreateOptionGroup
createOptionGroup pOptionGroupName_ pEngineName_ pMajorEngineVersion_ pOptionGroupDescription_ =
CreateOptionGroup'
{ _cogTags = Nothing
, _cogOptionGroupName = pOptionGroupName_
, _cogEngineName = pEngineName_
, _cogMajorEngineVersion = pMajorEngineVersion_
, _cogOptionGroupDescription = pOptionGroupDescription_
}
cogTags :: Lens' CreateOptionGroup [Tag]
cogTags = lens _cogTags (\ s a -> s{_cogTags = a}) . _Default . _Coerce
cogOptionGroupName :: Lens' CreateOptionGroup Text
cogOptionGroupName = lens _cogOptionGroupName (\ s a -> s{_cogOptionGroupName = a})
cogEngineName :: Lens' CreateOptionGroup Text
cogEngineName = lens _cogEngineName (\ s a -> s{_cogEngineName = a})
cogMajorEngineVersion :: Lens' CreateOptionGroup Text
cogMajorEngineVersion = lens _cogMajorEngineVersion (\ s a -> s{_cogMajorEngineVersion = a})
cogOptionGroupDescription :: Lens' CreateOptionGroup Text
cogOptionGroupDescription = lens _cogOptionGroupDescription (\ s a -> s{_cogOptionGroupDescription = a})
instance AWSRequest CreateOptionGroup where
type Rs CreateOptionGroup = CreateOptionGroupResponse
request = postQuery rds
response
= receiveXMLWrapper "CreateOptionGroupResult"
(\ s h x ->
CreateOptionGroupResponse' <$>
(x .@? "OptionGroup") <*> (pure (fromEnum s)))
instance Hashable CreateOptionGroup where
instance NFData CreateOptionGroup where
instance ToHeaders CreateOptionGroup where
toHeaders = const mempty
instance ToPath CreateOptionGroup where
toPath = const "/"
instance ToQuery CreateOptionGroup where
toQuery CreateOptionGroup'{..}
= mconcat
["Action" =: ("CreateOptionGroup" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _cogTags),
"OptionGroupName" =: _cogOptionGroupName,
"EngineName" =: _cogEngineName,
"MajorEngineVersion" =: _cogMajorEngineVersion,
"OptionGroupDescription" =:
_cogOptionGroupDescription]
data CreateOptionGroupResponse = CreateOptionGroupResponse'
{ _crsOptionGroup :: !(Maybe OptionGroup)
, _crsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createOptionGroupResponse
:: Int
-> CreateOptionGroupResponse
createOptionGroupResponse pResponseStatus_ =
CreateOptionGroupResponse'
{_crsOptionGroup = Nothing, _crsResponseStatus = pResponseStatus_}
crsOptionGroup :: Lens' CreateOptionGroupResponse (Maybe OptionGroup)
crsOptionGroup = lens _crsOptionGroup (\ s a -> s{_crsOptionGroup = a})
crsResponseStatus :: Lens' CreateOptionGroupResponse Int
crsResponseStatus = lens _crsResponseStatus (\ s a -> s{_crsResponseStatus = a})
instance NFData CreateOptionGroupResponse where