json-api-0.1.1.2: Utilities for generating JSON-API payloads

Safe HaskellNone
LanguageHaskell2010

Network.JSONApi.Resource

Description

Module representing a JSON-API resource object.

Specification: http://jsonapi.org/format/#document-resource-objects

Synopsis

Documentation

data Resource a Source #

Type representing a JSON-API resource object.

A Resource supplies standardized data and metadata about a resource.

Specification: http://jsonapi.org/format/#document-resource-objects

Instances

Eq a => Eq (Resource a) Source # 

Methods

(==) :: Resource a -> Resource a -> Bool #

(/=) :: Resource a -> Resource a -> Bool #

Show a => Show (Resource a) Source # 

Methods

showsPrec :: Int -> Resource a -> ShowS #

show :: Resource a -> String #

showList :: [Resource a] -> ShowS #

Generic (Resource a) Source # 

Associated Types

type Rep (Resource a) :: * -> * #

Methods

from :: Resource a -> Rep (Resource a) x #

to :: Rep (Resource a) x -> Resource a #

ToJSON a => ToJSON (Resource a) Source # 
FromJSON a => FromJSON (Resource a) Source # 

Methods

parseJSON :: Value -> Parser (Resource a) #

HasIdentifier (Resource a) Source # 
type Rep (Resource a) Source # 
type Rep (Resource a) = D1 (MetaData "Resource" "Network.JSONApi.Resource" "json-api-0.1.1.2-J3OYNh9O2lm3eKT5VaEijS" False) (C1 (MetaCons "Resource" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "getIdentifier") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Identifier)) (S1 (MetaSel (Just Symbol "getResource") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))) ((:*:) (S1 (MetaSel (Just Symbol "getLinks") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Links))) (S1 (MetaSel (Just Symbol "getRelationships") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Relationships))))))

data Relationship Source #

A type representing the Relationship between 2 entities

A Relationship provides basic information for fetching further information about a related resource.

Specification: http://jsonapi.org/format/#document-resource-object-relationships

mkRelationship :: Maybe Identifier -> Maybe Links -> Maybe Relationship Source #

Constructor function for creating a Relationship record

A relationship must contain either an Identifier or a Links record