module Network.AWS.RDS.CreateOptionGroup
(
createOptionGroup
, CreateOptionGroup
, cogTags
, cogOptionGroupName
, cogEngineName
, cogMajorEngineVersion
, cogOptionGroupDescription
, createOptionGroupResponse
, CreateOptionGroupResponse
, crsOptionGroup
, crsStatus
) where
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 Sv CreateOptionGroup = RDS
type Rs CreateOptionGroup = CreateOptionGroupResponse
request = postQuery
response
= receiveXMLWrapper "CreateOptionGroupResult"
(\ s h x ->
CreateOptionGroupResponse' <$>
(x .@? "OptionGroup") <*> (pure (fromEnum s)))
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)
, _crsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createOptionGroupResponse
:: Int
-> CreateOptionGroupResponse
createOptionGroupResponse pStatus_ =
CreateOptionGroupResponse'
{ _crsOptionGroup = Nothing
, _crsStatus = pStatus_
}
crsOptionGroup :: Lens' CreateOptionGroupResponse (Maybe OptionGroup)
crsOptionGroup = lens _crsOptionGroup (\ s a -> s{_crsOptionGroup = a});
crsStatus :: Lens' CreateOptionGroupResponse Int
crsStatus = lens _crsStatus (\ s a -> s{_crsStatus = a});