module Network.AWS.RDS.CopyOptionGroup
(
CopyOptionGroup
, copyOptionGroup
, cog1SourceOptionGroupIdentifier
, cog1Tags
, cog1TargetOptionGroupDescription
, cog1TargetOptionGroupIdentifier
, CopyOptionGroupResponse
, copyOptionGroupResponse
, cogrOptionGroup
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.RDS.Types
import qualified GHC.Exts
data CopyOptionGroup = CopyOptionGroup
{ _cog1SourceOptionGroupIdentifier :: Text
, _cog1Tags :: List "member" Tag
, _cog1TargetOptionGroupDescription :: Text
, _cog1TargetOptionGroupIdentifier :: Text
} deriving (Eq, Read, Show)
copyOptionGroup :: Text
-> Text
-> Text
-> CopyOptionGroup
copyOptionGroup p1 p2 p3 = CopyOptionGroup
{ _cog1SourceOptionGroupIdentifier = p1
, _cog1TargetOptionGroupIdentifier = p2
, _cog1TargetOptionGroupDescription = p3
, _cog1Tags = mempty
}
cog1SourceOptionGroupIdentifier :: Lens' CopyOptionGroup Text
cog1SourceOptionGroupIdentifier =
lens _cog1SourceOptionGroupIdentifier
(\s a -> s { _cog1SourceOptionGroupIdentifier = a })
cog1Tags :: Lens' CopyOptionGroup [Tag]
cog1Tags = lens _cog1Tags (\s a -> s { _cog1Tags = a }) . _List
cog1TargetOptionGroupDescription :: Lens' CopyOptionGroup Text
cog1TargetOptionGroupDescription =
lens _cog1TargetOptionGroupDescription
(\s a -> s { _cog1TargetOptionGroupDescription = a })
cog1TargetOptionGroupIdentifier :: Lens' CopyOptionGroup Text
cog1TargetOptionGroupIdentifier =
lens _cog1TargetOptionGroupIdentifier
(\s a -> s { _cog1TargetOptionGroupIdentifier = a })
newtype CopyOptionGroupResponse = CopyOptionGroupResponse
{ _cogrOptionGroup :: Maybe OptionGroup
} deriving (Eq, Read, Show)
copyOptionGroupResponse :: CopyOptionGroupResponse
copyOptionGroupResponse = CopyOptionGroupResponse
{ _cogrOptionGroup = Nothing
}
cogrOptionGroup :: Lens' CopyOptionGroupResponse (Maybe OptionGroup)
cogrOptionGroup = lens _cogrOptionGroup (\s a -> s { _cogrOptionGroup = a })
instance ToPath CopyOptionGroup where
toPath = const "/"
instance ToQuery CopyOptionGroup where
toQuery CopyOptionGroup{..} = mconcat
[ "SourceOptionGroupIdentifier" =? _cog1SourceOptionGroupIdentifier
, "Tags" =? _cog1Tags
, "TargetOptionGroupDescription" =? _cog1TargetOptionGroupDescription
, "TargetOptionGroupIdentifier" =? _cog1TargetOptionGroupIdentifier
]
instance ToHeaders CopyOptionGroup
instance AWSRequest CopyOptionGroup where
type Sv CopyOptionGroup = RDS
type Rs CopyOptionGroup = CopyOptionGroupResponse
request = post "CopyOptionGroup"
response = xmlResponse
instance FromXML CopyOptionGroupResponse where
parseXML = withElement "CopyOptionGroupResult" $ \x -> CopyOptionGroupResponse
<$> x .@? "OptionGroup"