module Stratosphere.ResourceProperties.SecurityGroupEgressRule where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
data SecurityGroupEgressRule =
SecurityGroupEgressRule
{ _securityGroupEgressRuleCidrIp :: Maybe (Val Text)
, _securityGroupEgressRuleDestinationSecurityGroupId :: Maybe (Val Text)
, _securityGroupEgressRuleFromPort :: Maybe (Val Integer')
, _securityGroupEgressRuleIpProtocol :: Val Text
, _securityGroupEgressRuleToPort :: Maybe (Val Integer')
} deriving (Show, Generic)
instance ToJSON SecurityGroupEgressRule where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 24, omitNothingFields = True }
instance FromJSON SecurityGroupEgressRule where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 24, omitNothingFields = True }
securityGroupEgressRule
:: Val Text
-> SecurityGroupEgressRule
securityGroupEgressRule ipProtocolarg =
SecurityGroupEgressRule
{ _securityGroupEgressRuleCidrIp = Nothing
, _securityGroupEgressRuleDestinationSecurityGroupId = Nothing
, _securityGroupEgressRuleFromPort = Nothing
, _securityGroupEgressRuleIpProtocol = ipProtocolarg
, _securityGroupEgressRuleToPort = Nothing
}
sgerCidrIp :: Lens' SecurityGroupEgressRule (Maybe (Val Text))
sgerCidrIp = lens _securityGroupEgressRuleCidrIp (\s a -> s { _securityGroupEgressRuleCidrIp = a })
sgerDestinationSecurityGroupId :: Lens' SecurityGroupEgressRule (Maybe (Val Text))
sgerDestinationSecurityGroupId = lens _securityGroupEgressRuleDestinationSecurityGroupId (\s a -> s { _securityGroupEgressRuleDestinationSecurityGroupId = a })
sgerFromPort :: Lens' SecurityGroupEgressRule (Maybe (Val Integer'))
sgerFromPort = lens _securityGroupEgressRuleFromPort (\s a -> s { _securityGroupEgressRuleFromPort = a })
sgerIpProtocol :: Lens' SecurityGroupEgressRule (Val Text)
sgerIpProtocol = lens _securityGroupEgressRuleIpProtocol (\s a -> s { _securityGroupEgressRuleIpProtocol = a })
sgerToPort :: Lens' SecurityGroupEgressRule (Maybe (Val Integer'))
sgerToPort = lens _securityGroupEgressRuleToPort (\s a -> s { _securityGroupEgressRuleToPort = a })