module Stratosphere.Resources.SecurityGroup where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
import Stratosphere.ResourceProperties.SecurityGroupEgressRule
import Stratosphere.ResourceProperties.SecurityGroupIngressRule
import Stratosphere.ResourceProperties.ResourceTag
data SecurityGroup =
SecurityGroup
{ _securityGroupGroupDescription :: Val Text
, _securityGroupSecurityGroupEgress :: Maybe [SecurityGroupEgressRule]
, _securityGroupSecurityGroupIngress :: Maybe [SecurityGroupIngressRule]
, _securityGroupTags :: Maybe [ResourceTag]
, _securityGroupVpcId :: Maybe (Val Text)
} deriving (Show, Generic)
instance ToJSON SecurityGroup where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 14, omitNothingFields = True }
instance FromJSON SecurityGroup where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 14, omitNothingFields = True }
securityGroup
:: Val Text
-> SecurityGroup
securityGroup groupDescriptionarg =
SecurityGroup
{ _securityGroupGroupDescription = groupDescriptionarg
, _securityGroupSecurityGroupEgress = Nothing
, _securityGroupSecurityGroupIngress = Nothing
, _securityGroupTags = Nothing
, _securityGroupVpcId = Nothing
}
sgGroupDescription :: Lens' SecurityGroup (Val Text)
sgGroupDescription = lens _securityGroupGroupDescription (\s a -> s { _securityGroupGroupDescription = a })
sgSecurityGroupEgress :: Lens' SecurityGroup (Maybe [SecurityGroupEgressRule])
sgSecurityGroupEgress = lens _securityGroupSecurityGroupEgress (\s a -> s { _securityGroupSecurityGroupEgress = a })
sgSecurityGroupIngress :: Lens' SecurityGroup (Maybe [SecurityGroupIngressRule])
sgSecurityGroupIngress = lens _securityGroupSecurityGroupIngress (\s a -> s { _securityGroupSecurityGroupIngress = a })
sgTags :: Lens' SecurityGroup (Maybe [ResourceTag])
sgTags = lens _securityGroupTags (\s a -> s { _securityGroupTags = a })
sgVpcId :: Lens' SecurityGroup (Maybe (Val Text))
sgVpcId = lens _securityGroupVpcId (\s a -> s { _securityGroupVpcId = a })