rest-gen-0.9.0.2: Documentation and client generation from rest definition.

Safe HaskellNone

Rest.Gen.Base.ActionInfo

Contents

Synopsis

The types describing a resource's actions.

type ResourceId = [String]Source

Representation of resource

data RequestMethod Source

Intermediate data representation of Rest structure

Constructors

GET 
POST 
PUT 
DELETE 

Instances

data ActionTarget Source

Constructors

Self 
Any 

Instances

data ActionInfo Source

Constructors

ActionInfo 

Instances

data DataType Source

Constructors

String 
XML 
JSON 
File 
Other 

Instances

Eq DataType 
Show DataType 

data DataDescription Source

Description of input/output data

Constructors

DataDescription 

Fields

dataType :: DataType
 
dataTypeDesc :: String
 
dataSchema :: String
 
dataExample :: String
 
haskellType :: String
 
haskellModule :: [String]
 

Instances

Traverse a resource's Schema and Handlers to create a [ActionInfo].

topLevelActionInfo :: Resource m s sid mid aid -> Cardinality sid mid -> [ActionInfo]Source

stepActionInfo :: Resource m s sid mid aid -> Step sid mid aid -> [ActionInfo]Source

namedActionInfo :: Resource m s sid mid aid -> String -> Endpoint sid mid aid -> [ActionInfo]Source

unnamedActionInfo :: Resource m s sid mid aid -> Cardinality (Id sid) (Id mid) -> [ActionInfo]Source

getterActionInfo :: Resource m s sid mid aid -> String -> Getter sid -> [ActionInfo]Source

listGetterActionInfo :: Resource m s sid mid aid -> String -> Getter mid -> [ActionInfo]Source

singleActionInfo :: Resource m s sid mid aid -> Maybe (Id sid) -> String -> [ActionInfo]Source

Smart constructors for ActionInfo.

getActionInfo :: Maybe (Id sid) -> String -> Handler m -> ActionInfoSource

updateActionInfo :: Maybe (Id sid) -> String -> Handler m -> ActionInfoSource

multiUpdateActionInfo :: Monad m => Id sid -> String -> Handler m -> Maybe ActionInfoSource

listActionInfo :: Monad m => Maybe (Id mid) -> String -> ListHandler m -> Maybe ActionInfoSource

handlerActionInfo :: Maybe (Id id) -> Bool -> ActionType -> ActionTarget -> String -> RequestMethod -> Handler m -> ActionInfoSource

Utilities for extraction information from Handlers.

handlerParams :: GenHandler m f -> [String]Source

paramNames :: Param a -> [String]Source

A Param can contain the same parameter multiple times. For example, offset and count are added in Rest.Handler.mkListing, and in Rest.Driver.Routing.mkListHandler. For that reason, we nub here.

paramNames_ :: Param a -> [String]Source

handlerInputs :: Handler m -> [DataDescription]Source

Extract input description from handlers

handlerOutputs :: Handler m -> [DataDescription]Source

Extract output description from handlers

handlerErrors :: Handler m -> [DataDescription]Source

Extract input description from handlers

typeString :: forall a. Typeable a => Proxy a -> StringSource

modString :: forall a. Typeable a => Proxy a -> [String]Source

actionIdent :: forall a. Ident a -> IdentSource

mkActionDescription :: String -> ActionInfo -> StringSource