module Network.AWS.RDS.ModifyOptionGroup
(
modifyOptionGroup
, ModifyOptionGroup
, mogOptionsToInclude
, mogOptionsToRemove
, mogApplyImmediately
, mogOptionGroupName
, modifyOptionGroupResponse
, ModifyOptionGroupResponse
, mogrsOptionGroup
, mogrsStatus
) 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 ModifyOptionGroup = ModifyOptionGroup'
{ _mogOptionsToInclude :: !(Maybe [OptionConfiguration])
, _mogOptionsToRemove :: !(Maybe [Text])
, _mogApplyImmediately :: !(Maybe Bool)
, _mogOptionGroupName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyOptionGroup
:: Text
-> ModifyOptionGroup
modifyOptionGroup pOptionGroupName_ =
ModifyOptionGroup'
{ _mogOptionsToInclude = Nothing
, _mogOptionsToRemove = Nothing
, _mogApplyImmediately = Nothing
, _mogOptionGroupName = pOptionGroupName_
}
mogOptionsToInclude :: Lens' ModifyOptionGroup [OptionConfiguration]
mogOptionsToInclude = lens _mogOptionsToInclude (\ s a -> s{_mogOptionsToInclude = a}) . _Default . _Coerce;
mogOptionsToRemove :: Lens' ModifyOptionGroup [Text]
mogOptionsToRemove = lens _mogOptionsToRemove (\ s a -> s{_mogOptionsToRemove = a}) . _Default . _Coerce;
mogApplyImmediately :: Lens' ModifyOptionGroup (Maybe Bool)
mogApplyImmediately = lens _mogApplyImmediately (\ s a -> s{_mogApplyImmediately = a});
mogOptionGroupName :: Lens' ModifyOptionGroup Text
mogOptionGroupName = lens _mogOptionGroupName (\ s a -> s{_mogOptionGroupName = a});
instance AWSRequest ModifyOptionGroup where
type Sv ModifyOptionGroup = RDS
type Rs ModifyOptionGroup = ModifyOptionGroupResponse
request = postQuery
response
= receiveXMLWrapper "ModifyOptionGroupResult"
(\ s h x ->
ModifyOptionGroupResponse' <$>
(x .@? "OptionGroup") <*> (pure (fromEnum s)))
instance ToHeaders ModifyOptionGroup where
toHeaders = const mempty
instance ToPath ModifyOptionGroup where
toPath = const "/"
instance ToQuery ModifyOptionGroup where
toQuery ModifyOptionGroup'{..}
= mconcat
["Action" =: ("ModifyOptionGroup" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"OptionsToInclude" =:
toQuery
(toQueryList "OptionConfiguration" <$>
_mogOptionsToInclude),
"OptionsToRemove" =:
toQuery
(toQueryList "member" <$> _mogOptionsToRemove),
"ApplyImmediately" =: _mogApplyImmediately,
"OptionGroupName" =: _mogOptionGroupName]
data ModifyOptionGroupResponse = ModifyOptionGroupResponse'
{ _mogrsOptionGroup :: !(Maybe OptionGroup)
, _mogrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyOptionGroupResponse
:: Int
-> ModifyOptionGroupResponse
modifyOptionGroupResponse pStatus_ =
ModifyOptionGroupResponse'
{ _mogrsOptionGroup = Nothing
, _mogrsStatus = pStatus_
}
mogrsOptionGroup :: Lens' ModifyOptionGroupResponse (Maybe OptionGroup)
mogrsOptionGroup = lens _mogrsOptionGroup (\ s a -> s{_mogrsOptionGroup = a});
mogrsStatus :: Lens' ModifyOptionGroupResponse Int
mogrsStatus = lens _mogrsStatus (\ s a -> s{_mogrsStatus = a});