Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Servant.Hateoas.RelationLink
Synopsis
- data RelationLink = RelationLink {
- _path :: Text
- _params :: [RelationParam]
- _templated :: Bool
- _method :: StdMethod
- _contentTypes :: [MediaType]
- _summary :: Maybe Text
- _description :: Maybe Text
- data RelationParam = RelationParam {}
- fromURI :: [MediaType] -> StdMethod -> URI -> RelationLink
- mkPlaceHolder :: Text -> Text
- appendPath :: Text -> Text -> Text
- class HasRelationLink endpoint where
- toRelationLink :: Proxy endpoint -> RelationLink
- reflectStdMethod :: ReflectMethod method => Proxy method -> StdMethod
RelationLink
Type
data RelationLink Source #
Link data-type for hypermedia-links in HATEOAS with potentially templated URIs.
Constructors
RelationLink | |
Fields
|
Instances
ToJSON RelationLink Source # | |
Defined in Servant.Hateoas.RelationLink Methods toJSON :: RelationLink -> Value # toEncoding :: RelationLink -> Encoding # toJSONList :: [RelationLink] -> Value # toEncodingList :: [RelationLink] -> Encoding # omitField :: RelationLink -> Bool # | |
Show RelationLink Source # | |
Defined in Servant.Hateoas.RelationLink Methods showsPrec :: Int -> RelationLink -> ShowS # show :: RelationLink -> String # showList :: [RelationLink] -> ShowS # | |
Eq RelationLink Source # | |
Defined in Servant.Hateoas.RelationLink |
data RelationParam Source #
Parameter data-type for hypermedia-links in HATEOAS.
Constructors
RelationParam | |
Instances
Show RelationParam Source # | |
Defined in Servant.Hateoas.RelationLink Methods showsPrec :: Int -> RelationParam -> ShowS # show :: RelationParam -> String # showList :: [RelationParam] -> ShowS # | |
Eq RelationParam Source # | |
Defined in Servant.Hateoas.RelationLink Methods (==) :: RelationParam -> RelationParam -> Bool # (/=) :: RelationParam -> RelationParam -> Bool # |
Creation
fromURI :: [MediaType] -> StdMethod -> URI -> RelationLink Source #
Creates a RelationLink
from an URI
.
Operations
mkPlaceHolder :: Text -> Text Source #
Create a placeholder for a URI template parameter.
Class
class HasRelationLink endpoint where Source #
Class for creating a RelationLink
to an API.
Methods
toRelationLink :: Proxy endpoint -> RelationLink Source #
Instances
Utility
ReflectStdMethod
reflectStdMethod :: ReflectMethod method => Proxy method -> StdMethod Source #
Like reflectMethod
but returns a StdMethod
.