| Copyright | (c) Alex Brandt 2017 |
|---|---|
| License | MIT |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.CollectionJSON
Contents
Description
A collection of types and instances for application/vnd.collection+json.
Full documentation for application/vnd.collection+json can be found at
http://amundsen.com/media-types/collection/.
Synopsis
- data Collection = Collection {}
- data Link = Link {}
- data Item = Item {}
- data Query = Query {}
- newtype Template = Template {}
- data Error = Error {}
- data Datum = Datum {}
- class FromCollection a where
- fromCollection :: Collection -> a
- class ToCollection a where
- toCollection :: a -> Collection
Core Data Types
data Collection Source #
The top-level object for an application/vnd.collection+json resource.
Constructors
| Collection | |
Instances
| Eq Collection Source # | |
Defined in Data.CollectionJSON | |
| Show Collection Source # | |
Defined in Data.CollectionJSON Methods showsPrec :: Int -> Collection -> ShowS # show :: Collection -> String # showList :: [Collection] -> ShowS # | |
| ToJSON Collection Source # | |
Defined in Data.CollectionJSON Methods toJSON :: Collection -> Value # toEncoding :: Collection -> Encoding # toJSONList :: [Collection] -> Value # toEncodingList :: [Collection] -> Encoding # | |
| FromJSON Collection Source # | |
Defined in Data.CollectionJSON | |
A link to a related resource (not necessarily an
application/vnd.collection+json resource).
Constructors
| Link | |
An element in the Collection
Constructors
| Item | |
A template for possible queries related to this Collection.
A query should correspond to an associated HTTP GET request.
The Query: > Query "http://example.com/search" "search" Nothing (Just "Search:") [Datum "search" "" Nothing]
Corresponds with the following URI for an HTTP GET: > http://example.com/search?search={search_terms}
Constructors
| Query | |
A fillable template for creation of a new object in the Collection.
Information about latest error that occured when responding to a request.
Constructors
| Error | |
Contents of a Collection Item.
Constructors
| Datum | |
Type Conversion
class FromCollection a where Source #
A type that can be converted from Collection.
Methods
fromCollection :: Collection -> a Source #
class ToCollection a where Source #
A type that can be converted to Collection.
Methods
toCollection :: a -> Collection Source #