module Stratosphere.Resources.Route where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
data Route =
Route
{ _routeDestinationCidrBlock :: Val Text
, _routeGatewayId :: Maybe (Val Text)
, _routeInstanceId :: Maybe (Val Text)
, _routeNatGatewayId :: Maybe (Val Text)
, _routeNetworkInterfaceId :: Maybe (Val Text)
, _routeRouteTableId :: Val Text
} deriving (Show, Generic)
instance ToJSON Route where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 6, omitNothingFields = True }
instance FromJSON Route where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 6, omitNothingFields = True }
route
:: Val Text
-> Val Text
-> Route
route destinationCidrBlockarg routeTableIdarg =
Route
{ _routeDestinationCidrBlock = destinationCidrBlockarg
, _routeGatewayId = Nothing
, _routeInstanceId = Nothing
, _routeNatGatewayId = Nothing
, _routeNetworkInterfaceId = Nothing
, _routeRouteTableId = routeTableIdarg
}
rDestinationCidrBlock :: Lens' Route (Val Text)
rDestinationCidrBlock = lens _routeDestinationCidrBlock (\s a -> s { _routeDestinationCidrBlock = a })
rGatewayId :: Lens' Route (Maybe (Val Text))
rGatewayId = lens _routeGatewayId (\s a -> s { _routeGatewayId = a })
rInstanceId :: Lens' Route (Maybe (Val Text))
rInstanceId = lens _routeInstanceId (\s a -> s { _routeInstanceId = a })
rNatGatewayId :: Lens' Route (Maybe (Val Text))
rNatGatewayId = lens _routeNatGatewayId (\s a -> s { _routeNatGatewayId = a })
rNetworkInterfaceId :: Lens' Route (Maybe (Val Text))
rNetworkInterfaceId = lens _routeNetworkInterfaceId (\s a -> s { _routeNetworkInterfaceId = a })
rRouteTableId :: Lens' Route (Val Text)
rRouteTableId = lens _routeRouteTableId (\s a -> s { _routeRouteTableId = a })