module Stratosphere.Resources.DBSecurityGroup where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
import Stratosphere.ResourceProperties.ResourceTag
import Stratosphere.ResourceProperties.RDSSecurityGroupRule
data DBSecurityGroup =
DBSecurityGroup
{ _dBSecurityGroupEC2VpcId :: Maybe (Val Text)
, _dBSecurityGroupDBSecurityGroupIngress :: [RDSSecurityGroupRule]
, _dBSecurityGroupGroupDescription :: Val Text
, _dBSecurityGroupResourceTags :: Maybe [ResourceTag]
} deriving (Show, Generic)
instance ToJSON DBSecurityGroup where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 16, omitNothingFields = True }
instance FromJSON DBSecurityGroup where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 16, omitNothingFields = True }
dbSecurityGroup
:: [RDSSecurityGroupRule]
-> Val Text
-> DBSecurityGroup
dbSecurityGroup dBSecurityGroupIngressarg groupDescriptionarg =
DBSecurityGroup
{ _dBSecurityGroupEC2VpcId = Nothing
, _dBSecurityGroupDBSecurityGroupIngress = dBSecurityGroupIngressarg
, _dBSecurityGroupGroupDescription = groupDescriptionarg
, _dBSecurityGroupResourceTags = Nothing
}
dbsgEC2VpcId :: Lens' DBSecurityGroup (Maybe (Val Text))
dbsgEC2VpcId = lens _dBSecurityGroupEC2VpcId (\s a -> s { _dBSecurityGroupEC2VpcId = a })
dbsgDBSecurityGroupIngress :: Lens' DBSecurityGroup [RDSSecurityGroupRule]
dbsgDBSecurityGroupIngress = lens _dBSecurityGroupDBSecurityGroupIngress (\s a -> s { _dBSecurityGroupDBSecurityGroupIngress = a })
dbsgGroupDescription :: Lens' DBSecurityGroup (Val Text)
dbsgGroupDescription = lens _dBSecurityGroupGroupDescription (\s a -> s { _dBSecurityGroupGroupDescription = a })
dbsgResourceTags :: Lens' DBSecurityGroup (Maybe [ResourceTag])
dbsgResourceTags = lens _dBSecurityGroupResourceTags (\s a -> s { _dBSecurityGroupResourceTags = a })