-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Documentation and client generation from rest definition.
--   
--   Documentation and client generation from rest definition.
@package rest-gen
@version 0.20.0.0

module Rest.Gen.Types
unModuleName :: ModuleName -> String
overModuleName :: (String -> String) -> ModuleName -> ModuleName

-- | Create a simple named basic import, to be updated with other fields as
--   needed.
namedImport :: String -> ImportDecl

-- | Qualified import with given name
qualImport :: String -> ImportDecl
haskellStringType :: Type
haskellByteStringType :: Type
haskellUnitType :: Type
haskellSimpleType :: String -> Type
haskellVoidType :: Type
noLoc :: SrcLoc

-- | The name of a Haskell module.
data ModuleName l :: * -> *
ModuleName :: l -> String -> ModuleName l

-- | An import declaration.
data ImportDecl l :: * -> *
ImportDecl :: l -> ModuleName l -> Bool -> Bool -> Bool -> Maybe String -> Maybe (ModuleName l) -> Maybe (ImportSpecList l) -> ImportDecl l

-- | annotation, used by parser for position of the <tt>import</tt>
--   keyword.
[importAnn] :: ImportDecl l -> l

-- | name of the module imported.
[importModule] :: ImportDecl l -> ModuleName l

-- | imported <tt>qualified</tt>?
[importQualified] :: ImportDecl l -> Bool

-- | imported with <tt>{-# SOURCE #-}</tt>?
[importSrc] :: ImportDecl l -> Bool

-- | Import <tt>safe</tt>?
[importSafe] :: ImportDecl l -> Bool

-- | imported with explicit package name
[importPkg] :: ImportDecl l -> Maybe String

-- | optional alias name in an <tt>as</tt> clause.
[importAs] :: ImportDecl l -> Maybe (ModuleName l)

-- | optional list of import specifications.
[importSpecs] :: ImportDecl l -> Maybe (ImportSpecList l)

module Rest.Gen.Config
data Action
MakeDocs :: String -> Action
MakeJS :: Action
MakeRb :: Action
MakeHS :: Action
data Location
Default :: Location
Stream :: Location
Location :: String -> Location
data Config
action :: forall cat. ArrowApply cat => Lens cat Config (Maybe Action)
source :: forall cat. ArrowApply cat => Lens cat Config Location
target :: forall cat. ArrowApply cat => Lens cat Config Location
apiVersion :: forall cat. ArrowApply cat => Lens cat Config String
apiPrivate :: forall cat. ArrowApply cat => Lens cat Config Bool
defaultConfig :: Config
parseLocation :: String -> Location
options :: (a :-> Config) -> [OptDescr (a -> a)]
configFromArgs :: String -> IO Config

module Rest.Gen.Base.ActionInfo.Ident
data Ident
Ident :: String -> Type -> [ModuleName] -> Ident
[description] :: Ident -> String
[haskellType] :: Ident -> Type
[haskellModules] :: Ident -> [ModuleName]
instance GHC.Classes.Eq Rest.Gen.Base.ActionInfo.Ident.Ident
instance GHC.Show.Show Rest.Gen.Base.ActionInfo.Ident.Ident

module Rest.Gen.Base.ActionInfo
type Accessor = (String, Maybe Ident)
data ActionInfo
ActionInfo :: Maybe Ident -> Bool -> ActionType -> ActionTarget -> String -> RequestMethod -> [DataDescription] -> [DataDescription] -> [DataDescription] -> [String] -> Bool -> Link -> ActionInfo
[ident] :: ActionInfo -> Maybe Ident
[postAction] :: ActionInfo -> Bool
[actionType] :: ActionInfo -> ActionType
[actionTarget] :: ActionInfo -> ActionTarget
[resDir] :: ActionInfo -> String
[method] :: ActionInfo -> RequestMethod
[inputs] :: ActionInfo -> [DataDescription]
[outputs] :: ActionInfo -> [DataDescription]
[errors] :: ActionInfo -> [DataDescription]
[params] :: ActionInfo -> [String]
[https] :: ActionInfo -> Bool
[link] :: ActionInfo -> Link
data ActionType
Retrieve :: ActionType
Create :: ActionType
Delete :: ActionType
DeleteMany :: ActionType
List :: ActionType
Update :: ActionType
UpdateMany :: ActionType
Modify :: ActionType
data ActionTarget
Self :: ActionTarget
Any :: ActionTarget
data DataType
String :: DataType
XML :: DataType
JSON :: DataType
File :: DataType
Other :: DataType

-- | Representation of resource
type ResourceId = [String]
accessLink :: [Accessor] -> Link
accessors :: Step sid mid aid -> [Accessor]
chooseType :: NonEmpty DataDescription -> DataDescription

-- | Core information about the type of the input/output
data DataDesc
DataDesc :: DataType -> Type -> [ModuleName] -> DataDesc
[_dataType] :: DataDesc -> DataType
[_haskellType] :: DataDesc -> Type
[_haskellModules] :: DataDesc -> [ModuleName]
dataType :: forall cat. ArrowApply cat => Lens cat DataDesc DataType
haskellType :: forall cat. ArrowApply cat => Lens cat DataDesc Type
haskellModules :: forall cat. ArrowApply cat => Lens cat DataDesc [ModuleName]

-- | Documentation information about the input/output
data DataMeta
DataMeta :: String -> Maybe String -> [String] -> DataMeta

-- | The name of the DataType, or a custom value if dataType is Other
[_dataTypeDesc] :: DataMeta -> String

-- | Just if dataType is XML
[_dataSchema] :: DataMeta -> Maybe String

-- | Non empty if dataType is XML or JSON
[_dataExample] :: DataMeta -> [String]
dataTypeDesc :: forall cat. ArrowApply cat => Lens cat DataMeta String
dataSchema :: forall cat. ArrowApply cat => Lens cat DataMeta (Maybe String)
dataExample :: forall cat. ArrowApply cat => Lens cat DataMeta [String]

-- | Combines the core and documentation information for input/output
data DataDescription
DataDescription :: DataDesc -> DataMeta -> DataDescription
[_desc] :: DataDescription -> DataDesc
[_meta] :: DataDescription -> DataMeta
desc :: forall cat. ArrowApply cat => Lens cat DataDescription DataDesc
meta :: forall cat. ArrowApply cat => Lens cat DataDescription DataMeta
data ResponseType
ResponseType :: Maybe DataDesc -> Maybe DataDesc -> ResponseType
[errorType] :: ResponseType -> Maybe DataDesc
[outputType] :: ResponseType -> Maybe DataDesc
responseAcceptType :: ResponseType -> [DataType]

-- | First argument is the default accept header to use if there is no
--   output or errors, must be XML or JSON.
dataTypesToAcceptHeader :: DataType -> [DataType] -> String
chooseResponseType :: ActionInfo -> ResponseType
isAccessor :: ActionInfo -> Bool
listGetterActionInfo :: Resource m s sid mid aid -> String -> Getter mid -> [ActionInfo]
mkActionDescription :: String -> ActionInfo -> String
namedActionInfo :: Resource m s sid mid aid -> String -> Endpoint sid mid aid -> [ActionInfo]
resourceToAccessors :: Resource m s sid mid aid -> [Accessor]
resourceToActionInfo :: forall m s sid mid aid. Resource m s sid mid aid -> [ActionInfo]
selectActionInfo :: Link -> String -> Handler m -> ActionInfo
singleActionInfo :: Resource m s sid mid aid -> Maybe (Id sid) -> String -> [ActionInfo]
instance GHC.Show.Show Rest.Gen.Base.ActionInfo.ResponseType
instance GHC.Classes.Eq Rest.Gen.Base.ActionInfo.ActionInfo
instance GHC.Show.Show Rest.Gen.Base.ActionInfo.ActionInfo
instance GHC.Classes.Eq Rest.Gen.Base.ActionInfo.DataDescription
instance GHC.Show.Show Rest.Gen.Base.ActionInfo.DataDescription
instance GHC.Classes.Eq Rest.Gen.Base.ActionInfo.DataMeta
instance GHC.Show.Show Rest.Gen.Base.ActionInfo.DataMeta
instance GHC.Classes.Eq Rest.Gen.Base.ActionInfo.DataDesc
instance GHC.Show.Show Rest.Gen.Base.ActionInfo.DataDesc
instance GHC.Classes.Eq Rest.Gen.Base.ActionInfo.DataType
instance GHC.Show.Show Rest.Gen.Base.ActionInfo.DataType
instance GHC.Classes.Eq Rest.Gen.Base.ActionInfo.ActionTarget
instance GHC.Show.Show Rest.Gen.Base.ActionInfo.ActionTarget
instance GHC.Classes.Eq Rest.Gen.Base.ActionInfo.ActionType
instance GHC.Show.Show Rest.Gen.Base.ActionInfo.ActionType
instance GHC.Classes.Eq Rest.Gen.Base.ActionInfo.RequestMethod
instance GHC.Show.Show Rest.Gen.Base.ActionInfo.RequestMethod

module Rest.Gen.Base.ApiTree
data ApiAction
ApiAction :: ResourceId -> Link -> ActionInfo -> ApiAction
[itemResource] :: ApiAction -> ResourceId
[itemLink] :: ApiAction -> Link
[itemInfo] :: ApiAction -> ActionInfo
data ApiResource
TreeItem :: String -> ResourceId -> ResourceId -> Link -> [Accessor] -> Bool -> [ApiAction] -> String -> [ApiResource] -> ApiResource
[resName] :: ApiResource -> String
[resId] :: ApiResource -> ResourceId
[resParents] :: ApiResource -> ResourceId
[resLink] :: ApiResource -> Link
[resAccessors] :: ApiResource -> [Accessor]
[resPrivate] :: ApiResource -> Bool
[resItems] :: ApiResource -> [ApiAction]
[resDescription] :: ApiResource -> String
[subResources] :: ApiResource -> [ApiResource]
allResourceIds :: ApiResource -> [ResourceId]
allSubResourceIds :: ApiResource -> [ResourceId]
allSubResources :: ApiResource -> [ApiResource]
allSubTrees :: ApiResource -> [ApiResource]
allTrees :: ApiResource -> [ApiResource]
apiResources :: ApiResource -> [ResourceId]
apiSubtrees :: Router m s -> ApiResource
apiTree :: Router m s -> ApiResource
apiTree' :: ResourceId -> Link -> Router m s -> ApiResource
cleanName :: String -> [String]
defaultTree :: ApiResource

-- | Traversing ApiResources
foldTree :: (ApiResource -> [a] -> a) -> ApiResource -> a
foldTreeChildren :: ([a] -> a) -> (ApiResource -> [a] -> a) -> ApiResource -> a
hasAccessor :: ApiResource -> Bool

-- | Extra functions for generation
mkFuncParts :: ApiAction -> [String]
noPrivate :: ApiResource -> ApiResource
resIdents :: ApiResource -> [Link]
sortTree :: ApiResource -> ApiResource
subResourceIds :: ApiResource -> [ResourceId]
subResourceNames :: ApiResource -> [String]
instance GHC.Classes.Eq Rest.Gen.Base.ApiTree.ApiResource
instance GHC.Show.Show Rest.Gen.Base.ApiTree.ApiResource
instance GHC.Classes.Eq Rest.Gen.Base.ApiTree.ApiAction
instance GHC.Show.Show Rest.Gen.Base.ApiTree.ApiAction

module Rest.Gen.Base
type Link = [LinkItem]

-- | Data structure representing Api links
data LinkItem
LResource :: String -> LinkItem
LAction :: String -> LinkItem
LParam :: String -> LinkItem
LAccess :: [Link] -> LinkItem
flattenLast :: Link -> [Link]
flattenLastResource :: Link -> [Link]
flattenLink :: Link -> [Link]
getLinkIds :: Link -> [(String, [(String, String)])]
hasParam :: LinkItem -> Bool
itemString :: LinkItem -> String
setLinkIds :: Link -> [String] -> String

module Rest.Gen.Docs

-- | Information about the context in which a resource is contained
data DocsContext
DocsContext :: String -> Version -> String -> DocsContext
[rootUrl] :: DocsContext -> String
[contextVersion] :: DocsContext -> Version
[templates] :: DocsContext -> String
cdiv :: String -> Html -> Html

-- | Helper functions for generating HTML
cls :: String -> Attribute
mkAllResources :: DocsContext -> ApiResource -> IO String
mkSingleResource :: DocsContext -> ApiResource -> IO String

-- | Recursively generate information for a resource structure
resourcesInfo :: DocsContext -> ApiResource -> Html
row :: Html -> Html
subResourcesInfo :: DocsContext -> ApiResource -> Html
writeDocs :: DocsContext -> Router m s -> String -> IO ()
instance GHC.Show.Show Rest.Gen.Docs.DocsContext
instance GHC.Classes.Eq Rest.Gen.Docs.DocsContext

module Rest.Gen.Haskell
data HaskellContext
HaskellContext :: Version -> String -> String -> Bool -> [ModuleName] -> [ImportDecl] -> [(ModuleName, ModuleName)] -> [String] -> HaskellContext
[apiVersion] :: HaskellContext -> Version
[targetPath] :: HaskellContext -> String
[wrapperName] :: HaskellContext -> String
[includePrivate] :: HaskellContext -> Bool
[sources] :: HaskellContext -> [ModuleName]
[imports] :: HaskellContext -> [ImportDecl]
[rewrites] :: HaskellContext -> [(ModuleName, ModuleName)]
[namespace] :: HaskellContext -> [String]
mkHsApi :: HaskellContext -> Router m s -> IO ()
instance GHC.Show.Show Rest.Gen.Haskell.ResponseInfo
instance GHC.Classes.Eq Rest.Gen.Haskell.ResponseInfo
instance GHC.Show.Show Rest.Gen.Haskell.InputInfo
instance GHC.Classes.Eq Rest.Gen.Haskell.InputInfo

module Rest.Gen.JavaScript
mkJsApi :: ModuleName -> Bool -> Version -> Router m s -> IO String

module Rest.Gen.Ruby
mkRbApi :: ModuleName -> Bool -> Version -> Router m s -> IO String

module Rest.Gen
generate :: Config -> String -> Api m -> [ModuleName] -> [ImportDecl] -> [(ModuleName, ModuleName)] -> IO ()
