module Network.AWS.RDS.CopyOptionGroup
(
copyOptionGroup
, CopyOptionGroup
, cTags
, cSourceOptionGroupIdentifier
, cTargetOptionGroupIdentifier
, cTargetOptionGroupDescription
, copyOptionGroupResponse
, CopyOptionGroupResponse
, cogrsOptionGroup
, cogrsStatus
) 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 CopyOptionGroup = CopyOptionGroup'
{ _cTags :: !(Maybe [Tag])
, _cSourceOptionGroupIdentifier :: !Text
, _cTargetOptionGroupIdentifier :: !Text
, _cTargetOptionGroupDescription :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
copyOptionGroup
:: Text
-> Text
-> Text
-> CopyOptionGroup
copyOptionGroup pSourceOptionGroupIdentifier_ pTargetOptionGroupIdentifier_ pTargetOptionGroupDescription_ =
CopyOptionGroup'
{ _cTags = Nothing
, _cSourceOptionGroupIdentifier = pSourceOptionGroupIdentifier_
, _cTargetOptionGroupIdentifier = pTargetOptionGroupIdentifier_
, _cTargetOptionGroupDescription = pTargetOptionGroupDescription_
}
cTags :: Lens' CopyOptionGroup [Tag]
cTags = lens _cTags (\ s a -> s{_cTags = a}) . _Default . _Coerce;
cSourceOptionGroupIdentifier :: Lens' CopyOptionGroup Text
cSourceOptionGroupIdentifier = lens _cSourceOptionGroupIdentifier (\ s a -> s{_cSourceOptionGroupIdentifier = a});
cTargetOptionGroupIdentifier :: Lens' CopyOptionGroup Text
cTargetOptionGroupIdentifier = lens _cTargetOptionGroupIdentifier (\ s a -> s{_cTargetOptionGroupIdentifier = a});
cTargetOptionGroupDescription :: Lens' CopyOptionGroup Text
cTargetOptionGroupDescription = lens _cTargetOptionGroupDescription (\ s a -> s{_cTargetOptionGroupDescription = a});
instance AWSRequest CopyOptionGroup where
type Sv CopyOptionGroup = RDS
type Rs CopyOptionGroup = CopyOptionGroupResponse
request = postQuery
response
= receiveXMLWrapper "CopyOptionGroupResult"
(\ s h x ->
CopyOptionGroupResponse' <$>
(x .@? "OptionGroup") <*> (pure (fromEnum s)))
instance ToHeaders CopyOptionGroup where
toHeaders = const mempty
instance ToPath CopyOptionGroup where
toPath = const "/"
instance ToQuery CopyOptionGroup where
toQuery CopyOptionGroup'{..}
= mconcat
["Action" =: ("CopyOptionGroup" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _cTags),
"SourceOptionGroupIdentifier" =:
_cSourceOptionGroupIdentifier,
"TargetOptionGroupIdentifier" =:
_cTargetOptionGroupIdentifier,
"TargetOptionGroupDescription" =:
_cTargetOptionGroupDescription]
data CopyOptionGroupResponse = CopyOptionGroupResponse'
{ _cogrsOptionGroup :: !(Maybe OptionGroup)
, _cogrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
copyOptionGroupResponse
:: Int
-> CopyOptionGroupResponse
copyOptionGroupResponse pStatus_ =
CopyOptionGroupResponse'
{ _cogrsOptionGroup = Nothing
, _cogrsStatus = pStatus_
}
cogrsOptionGroup :: Lens' CopyOptionGroupResponse (Maybe OptionGroup)
cogrsOptionGroup = lens _cogrsOptionGroup (\ s a -> s{_cogrsOptionGroup = a});
cogrsStatus :: Lens' CopyOptionGroupResponse Int
cogrsStatus = lens _cogrsStatus (\ s a -> s{_cogrsStatus = a});