module Network.AWS.RDS.CreateOptionGroup
(
CreateOptionGroup
, createOptionGroup
, cogEngineName
, cogMajorEngineVersion
, cogOptionGroupDescription
, cogOptionGroupName
, cogTags
, CreateOptionGroupResponse
, createOptionGroupResponse
, cogr1OptionGroup
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.RDS.Types
import qualified GHC.Exts
data CreateOptionGroup = CreateOptionGroup
{ _cogEngineName :: Text
, _cogMajorEngineVersion :: Text
, _cogOptionGroupDescription :: Text
, _cogOptionGroupName :: Text
, _cogTags :: List "Tag" Tag
} deriving (Eq, Show)
createOptionGroup :: Text
-> Text
-> Text
-> Text
-> CreateOptionGroup
createOptionGroup p1 p2 p3 p4 = CreateOptionGroup
{ _cogOptionGroupName = p1
, _cogEngineName = p2
, _cogMajorEngineVersion = p3
, _cogOptionGroupDescription = p4
, _cogTags = mempty
}
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 })
cogOptionGroupName :: Lens' CreateOptionGroup Text
cogOptionGroupName =
lens _cogOptionGroupName (\s a -> s { _cogOptionGroupName = a })
cogTags :: Lens' CreateOptionGroup [Tag]
cogTags = lens _cogTags (\s a -> s { _cogTags = a }) . _List
newtype CreateOptionGroupResponse = CreateOptionGroupResponse
{ _cogr1OptionGroup :: Maybe OptionGroup
} deriving (Eq, Show)
createOptionGroupResponse :: CreateOptionGroupResponse
createOptionGroupResponse = CreateOptionGroupResponse
{ _cogr1OptionGroup = Nothing
}
cogr1OptionGroup :: Lens' CreateOptionGroupResponse (Maybe OptionGroup)
cogr1OptionGroup = lens _cogr1OptionGroup (\s a -> s { _cogr1OptionGroup = a })
instance ToPath CreateOptionGroup where
toPath = const "/"
instance ToQuery CreateOptionGroup where
toQuery CreateOptionGroup{..} = mconcat
[ "EngineName" =? _cogEngineName
, "MajorEngineVersion" =? _cogMajorEngineVersion
, "OptionGroupDescription" =? _cogOptionGroupDescription
, "OptionGroupName" =? _cogOptionGroupName
, "Tags" =? _cogTags
]
instance ToHeaders CreateOptionGroup
instance AWSRequest CreateOptionGroup where
type Sv CreateOptionGroup = RDS
type Rs CreateOptionGroup = CreateOptionGroupResponse
request = post "CreateOptionGroup"
response = xmlResponse
instance FromXML CreateOptionGroupResponse where
parseXML = withElement "CreateOptionGroupResult" $ \x -> CreateOptionGroupResponse
<$> x .@? "OptionGroup"