module Network.AWS.RDS.CopyDBParameterGroup
(
copyDBParameterGroup
, CopyDBParameterGroup
, cdpgTags
, cdpgSourceDBParameterGroupIdentifier
, cdpgTargetDBParameterGroupIdentifier
, cdpgTargetDBParameterGroupDescription
, copyDBParameterGroupResponse
, CopyDBParameterGroupResponse
, cdbpgrsDBParameterGroup
, cdbpgrsStatus
) 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 CopyDBParameterGroup = CopyDBParameterGroup'
{ _cdpgTags :: !(Maybe [Tag])
, _cdpgSourceDBParameterGroupIdentifier :: !Text
, _cdpgTargetDBParameterGroupIdentifier :: !Text
, _cdpgTargetDBParameterGroupDescription :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
copyDBParameterGroup
:: Text
-> Text
-> Text
-> CopyDBParameterGroup
copyDBParameterGroup pSourceDBParameterGroupIdentifier_ pTargetDBParameterGroupIdentifier_ pTargetDBParameterGroupDescription_ =
CopyDBParameterGroup'
{ _cdpgTags = Nothing
, _cdpgSourceDBParameterGroupIdentifier = pSourceDBParameterGroupIdentifier_
, _cdpgTargetDBParameterGroupIdentifier = pTargetDBParameterGroupIdentifier_
, _cdpgTargetDBParameterGroupDescription = pTargetDBParameterGroupDescription_
}
cdpgTags :: Lens' CopyDBParameterGroup [Tag]
cdpgTags = lens _cdpgTags (\ s a -> s{_cdpgTags = a}) . _Default . _Coerce;
cdpgSourceDBParameterGroupIdentifier :: Lens' CopyDBParameterGroup Text
cdpgSourceDBParameterGroupIdentifier = lens _cdpgSourceDBParameterGroupIdentifier (\ s a -> s{_cdpgSourceDBParameterGroupIdentifier = a});
cdpgTargetDBParameterGroupIdentifier :: Lens' CopyDBParameterGroup Text
cdpgTargetDBParameterGroupIdentifier = lens _cdpgTargetDBParameterGroupIdentifier (\ s a -> s{_cdpgTargetDBParameterGroupIdentifier = a});
cdpgTargetDBParameterGroupDescription :: Lens' CopyDBParameterGroup Text
cdpgTargetDBParameterGroupDescription = lens _cdpgTargetDBParameterGroupDescription (\ s a -> s{_cdpgTargetDBParameterGroupDescription = a});
instance AWSRequest CopyDBParameterGroup where
type Sv CopyDBParameterGroup = RDS
type Rs CopyDBParameterGroup =
CopyDBParameterGroupResponse
request = postQuery
response
= receiveXMLWrapper "CopyDBParameterGroupResult"
(\ s h x ->
CopyDBParameterGroupResponse' <$>
(x .@? "DBParameterGroup") <*> (pure (fromEnum s)))
instance ToHeaders CopyDBParameterGroup where
toHeaders = const mempty
instance ToPath CopyDBParameterGroup where
toPath = const "/"
instance ToQuery CopyDBParameterGroup where
toQuery CopyDBParameterGroup'{..}
= mconcat
["Action" =: ("CopyDBParameterGroup" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _cdpgTags),
"SourceDBParameterGroupIdentifier" =:
_cdpgSourceDBParameterGroupIdentifier,
"TargetDBParameterGroupIdentifier" =:
_cdpgTargetDBParameterGroupIdentifier,
"TargetDBParameterGroupDescription" =:
_cdpgTargetDBParameterGroupDescription]
data CopyDBParameterGroupResponse = CopyDBParameterGroupResponse'
{ _cdbpgrsDBParameterGroup :: !(Maybe DBParameterGroup)
, _cdbpgrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
copyDBParameterGroupResponse
:: Int
-> CopyDBParameterGroupResponse
copyDBParameterGroupResponse pStatus_ =
CopyDBParameterGroupResponse'
{ _cdbpgrsDBParameterGroup = Nothing
, _cdbpgrsStatus = pStatus_
}
cdbpgrsDBParameterGroup :: Lens' CopyDBParameterGroupResponse (Maybe DBParameterGroup)
cdbpgrsDBParameterGroup = lens _cdbpgrsDBParameterGroup (\ s a -> s{_cdbpgrsDBParameterGroup = a});
cdbpgrsStatus :: Lens' CopyDBParameterGroupResponse Int
cdbpgrsStatus = lens _cdbpgrsStatus (\ s a -> s{_cdbpgrsStatus = a});