module Stratosphere.ResourceProperties.NetworkInterface where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
import Stratosphere.ResourceProperties.PrivateIpAddressSpecification
data NetworkInterface =
NetworkInterface
{ _networkInterfaceAssociatePublicIpAddress :: Maybe (Val Bool')
, _networkInterfaceDeleteOnTermination :: Maybe (Val Bool')
, _networkInterfaceDescription :: Maybe (Val Text)
, _networkInterfaceDeviceIndex :: Val Text
, _networkInterfaceGroupSet :: Maybe [Val Text]
, _networkInterfaceNetworkInterfaceId :: Maybe (Val Text)
, _networkInterfacePrivateIpAddress :: Maybe (Val Text)
, _networkInterfacePrivateIpAddresses :: Maybe [PrivateIpAddressSpecification]
, _networkInterfaceSecondaryPrivateIpAddressCount :: Maybe (Val Integer')
, _networkInterfaceSubnetId :: Maybe (Val Text)
} deriving (Show, Generic)
instance ToJSON NetworkInterface where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 17, omitNothingFields = True }
instance FromJSON NetworkInterface where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 17, omitNothingFields = True }
networkInterface
:: Val Text
-> NetworkInterface
networkInterface deviceIndexarg =
NetworkInterface
{ _networkInterfaceAssociatePublicIpAddress = Nothing
, _networkInterfaceDeleteOnTermination = Nothing
, _networkInterfaceDescription = Nothing
, _networkInterfaceDeviceIndex = deviceIndexarg
, _networkInterfaceGroupSet = Nothing
, _networkInterfaceNetworkInterfaceId = Nothing
, _networkInterfacePrivateIpAddress = Nothing
, _networkInterfacePrivateIpAddresses = Nothing
, _networkInterfaceSecondaryPrivateIpAddressCount = Nothing
, _networkInterfaceSubnetId = Nothing
}
niAssociatePublicIpAddress :: Lens' NetworkInterface (Maybe (Val Bool'))
niAssociatePublicIpAddress = lens _networkInterfaceAssociatePublicIpAddress (\s a -> s { _networkInterfaceAssociatePublicIpAddress = a })
niDeleteOnTermination :: Lens' NetworkInterface (Maybe (Val Bool'))
niDeleteOnTermination = lens _networkInterfaceDeleteOnTermination (\s a -> s { _networkInterfaceDeleteOnTermination = a })
niDescription :: Lens' NetworkInterface (Maybe (Val Text))
niDescription = lens _networkInterfaceDescription (\s a -> s { _networkInterfaceDescription = a })
niDeviceIndex :: Lens' NetworkInterface (Val Text)
niDeviceIndex = lens _networkInterfaceDeviceIndex (\s a -> s { _networkInterfaceDeviceIndex = a })
niGroupSet :: Lens' NetworkInterface (Maybe [Val Text])
niGroupSet = lens _networkInterfaceGroupSet (\s a -> s { _networkInterfaceGroupSet = a })
niNetworkInterfaceId :: Lens' NetworkInterface (Maybe (Val Text))
niNetworkInterfaceId = lens _networkInterfaceNetworkInterfaceId (\s a -> s { _networkInterfaceNetworkInterfaceId = a })
niPrivateIpAddress :: Lens' NetworkInterface (Maybe (Val Text))
niPrivateIpAddress = lens _networkInterfacePrivateIpAddress (\s a -> s { _networkInterfacePrivateIpAddress = a })
niPrivateIpAddresses :: Lens' NetworkInterface (Maybe [PrivateIpAddressSpecification])
niPrivateIpAddresses = lens _networkInterfacePrivateIpAddresses (\s a -> s { _networkInterfacePrivateIpAddresses = a })
niSecondaryPrivateIpAddressCount :: Lens' NetworkInterface (Maybe (Val Integer'))
niSecondaryPrivateIpAddressCount = lens _networkInterfaceSecondaryPrivateIpAddressCount (\s a -> s { _networkInterfaceSecondaryPrivateIpAddressCount = a })
niSubnetId :: Lens' NetworkInterface (Maybe (Val Text))
niSubnetId = lens _networkInterfaceSubnetId (\s a -> s { _networkInterfaceSubnetId = a })