Copyright | (c) Alex Brandt 2017 |
---|---|
License | MIT |
Safe Haskell | None |
Language | Haskell2010 |
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.
Instances
Eq Collection Source # | |
Defined in Data.CollectionJSON (==) :: Collection -> Collection -> Bool # (/=) :: Collection -> Collection -> Bool # | |
Show Collection Source # | |
Defined in Data.CollectionJSON showsPrec :: Int -> Collection -> ShowS # show :: Collection -> String # showList :: [Collection] -> ShowS # | |
ToJSON Collection Source # | |
Defined in Data.CollectionJSON toJSON :: Collection -> Value # toEncoding :: Collection -> Encoding # toJSONList :: [Collection] -> Value # toEncodingList :: [Collection] -> Encoding # | |
FromJSON Collection Source # | |
Defined in Data.CollectionJSON parseJSON :: Value -> Parser Collection # parseJSONList :: Value -> Parser [Collection] # |
A link to a related resource (not necessarily an
application/vnd.collection+json
resource).
An element in the Collection
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}
Query | |
A fillable template for creation of a new object in the Collection
.
Information about latest error that occured when responding to a request.
Contents of a Collection
Item
.
Type Conversion
class FromCollection a where Source #
A type that can be converted from Collection
.
fromCollection :: Collection -> a Source #
class ToCollection a where Source #
A type that can be converted to Collection
.
toCollection :: a -> Collection Source #