module Stratosphere.Resources.ApiGatewayResource where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
data ApiGatewayResource =
ApiGatewayResource
{ _apiGatewayResourceParentId :: Val Text
, _apiGatewayResourcePathPart :: Val Text
, _apiGatewayResourceRestApiId :: Val Text
} deriving (Show, Generic)
instance ToJSON ApiGatewayResource where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 19, omitNothingFields = True }
instance FromJSON ApiGatewayResource where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 19, omitNothingFields = True }
apiGatewayResource
:: Val Text
-> Val Text
-> Val Text
-> ApiGatewayResource
apiGatewayResource parentIdarg pathPartarg restApiIdarg =
ApiGatewayResource
{ _apiGatewayResourceParentId = parentIdarg
, _apiGatewayResourcePathPart = pathPartarg
, _apiGatewayResourceRestApiId = restApiIdarg
}
agrParentId :: Lens' ApiGatewayResource (Val Text)
agrParentId = lens _apiGatewayResourceParentId (\s a -> s { _apiGatewayResourceParentId = a })
agrPathPart :: Lens' ApiGatewayResource (Val Text)
agrPathPart = lens _apiGatewayResourcePathPart (\s a -> s { _apiGatewayResourcePathPart = a })
agrRestApiId :: Lens' ApiGatewayResource (Val Text)
agrRestApiId = lens _apiGatewayResourceRestApiId (\s a -> s { _apiGatewayResourceRestApiId = a })