-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Utilities for generating JSON-API payloads -- -- Provides utilities for deriving JSON payloads conformant to the -- json-api specification @package json-api @version 0.1.0.4 -- | Module representing a JSON-API meta object. -- -- Specification: http://jsonapi.org/format/#document-meta module Network.JSONApi.Meta -- | Type representing a JSON-API meta object. -- -- Meta is an abstraction around an underlying Map consisting of -- resource-specific metadata. -- -- Example JSON: "meta": { "copyright": "Copyright 2015 Example -- Corp.", "authors": [ "Andre Dawson", "Kirby Puckett", "Don Mattingly", -- "Ozzie Guillen" ] } -- -- Specification: http://jsonapi.org/format/#document-meta data Meta a Meta :: (Map Text a) -> Meta a instance GHC.Generics.Generic (Network.JSONApi.Meta.Meta a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Network.JSONApi.Meta.Meta a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Network.JSONApi.Meta.Meta a) instance GHC.Show.Show a => GHC.Show.Show (Network.JSONApi.Meta.Meta a) instance Data.Aeson.Types.Class.ToJSON a => Data.Aeson.Types.Class.ToJSON (Network.JSONApi.Meta.Meta a) instance Data.Aeson.Types.Class.FromJSON a => Data.Aeson.Types.Class.FromJSON (Network.JSONApi.Meta.Meta a) -- | Module representing a JSON-API link object. -- -- Specification: http://jsonapi.org/format/#document-links module Network.JSONApi.Link -- | Type representing a JSON-API link object. -- -- Links are an abstraction around an underlying Map consisting of -- relevance identifiers as keys and URIs as values. -- -- Example JSON: "links": { "self": -- "http://example.com/posts/1" } -- -- Specification: http://jsonapi.org/format/#document-links data Links type Rel = Text type Href = Text -- | Constructor function for building Links toLinks :: [(Rel, URL)] -> Links instance GHC.Generics.Generic Network.JSONApi.Link.Links instance Data.Aeson.Types.Class.FromJSON Network.JSONApi.Link.Links instance Data.Aeson.Types.Class.ToJSON Network.JSONApi.Link.Links instance GHC.Classes.Ord Network.JSONApi.Link.Links instance GHC.Classes.Eq Network.JSONApi.Link.Links instance GHC.Show.Show Network.JSONApi.Link.Links -- | Module representing a JSON-API resource object. -- -- Specification: -- http://jsonapi.org/format/#document-resource-objects module Network.JSONApi.Resource -- | Identifiers are used to encapsulate the minimum amount of information -- to uniquely identify a resource. -- -- This object will be found at multiple levels of the JSON-API structure -- -- Specification: -- http://jsonapi.org/format/#document-resource-identifier-objects data Identifier Identifier :: Text -> Text -> Identifier [_id] :: Identifier -> Text [_type] :: Identifier -> Text -- | 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 data Resource a b Resource :: Identifier -> a -> Maybe Links -> Maybe (Meta b) -> Maybe (Map Text Relationship) -> Resource a b [getIdentifier] :: Resource a b -> Identifier [getResource] :: Resource a b -> a [getLinks] :: Resource a b -> Maybe Links [getMetaData] :: Resource a b -> Maybe (Meta b) [getRelationships] :: Resource a b -> Maybe (Map Text Relationship) -- | 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 data Relationship -- | Constructor function for creating a Relationship record -- -- A relationship must contain either an Identifier or a Links record mkRelationship :: Maybe Identifier -> Maybe Links -> Maybe Relationship instance GHC.Generics.Generic (Network.JSONApi.Resource.Resource a b) instance (GHC.Classes.Eq a, GHC.Classes.Eq b) => GHC.Classes.Eq (Network.JSONApi.Resource.Resource a b) instance (GHC.Show.Show a, GHC.Show.Show b) => GHC.Show.Show (Network.JSONApi.Resource.Resource a b) instance GHC.Generics.Generic Network.JSONApi.Resource.Relationship instance GHC.Classes.Eq Network.JSONApi.Resource.Relationship instance GHC.Show.Show Network.JSONApi.Resource.Relationship instance GHC.Generics.Generic Network.JSONApi.Resource.Identifier instance GHC.Classes.Eq Network.JSONApi.Resource.Identifier instance GHC.Show.Show Network.JSONApi.Resource.Identifier instance (Data.Aeson.Types.Class.ToJSON a, Data.Aeson.Types.Class.ToJSON b) => Data.Aeson.Types.Class.ToJSON (Network.JSONApi.Resource.Resource a b) instance (Data.Aeson.Types.Class.FromJSON a, Data.Aeson.Types.Class.FromJSON b) => Data.Aeson.Types.Class.FromJSON (Network.JSONApi.Resource.Resource a b) instance Data.Aeson.Types.Class.ToJSON Network.JSONApi.Resource.Relationship instance Data.Aeson.Types.Class.FromJSON Network.JSONApi.Resource.Relationship instance Data.Aeson.Types.Class.ToJSON Network.JSONApi.Resource.Identifier instance Data.Aeson.Types.Class.FromJSON Network.JSONApi.Resource.Identifier -- | Module representing a JSON-API error object. -- -- Error objects are used for providing application-specific detail to -- unsuccessful API responses. -- -- Specification: http://jsonapi.org/format/#error-objects module Network.JSONApi.Error -- | Type for providing application-specific detail to unsuccessful API -- responses. -- -- Specification: http://jsonapi.org/format/#error-objects data Error a Error :: Maybe Text -> Maybe Links -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe (Meta a) -> Error a [id] :: Error a -> Maybe Text [links] :: Error a -> Maybe Links [status] :: Error a -> Maybe Text [code] :: Error a -> Maybe Text [title] :: Error a -> Maybe Text [detail] :: Error a -> Maybe Text [meta] :: Error a -> Maybe (Meta a) instance GHC.Generics.Generic (Network.JSONApi.Error.Error a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Network.JSONApi.Error.Error a) instance GHC.Show.Show a => GHC.Show.Show (Network.JSONApi.Error.Error a) instance Data.Aeson.Types.Class.ToJSON a => Data.Aeson.Types.Class.ToJSON (Network.JSONApi.Error.Error a) instance Data.Aeson.Types.Class.FromJSON a => Data.Aeson.Types.Class.FromJSON (Network.JSONApi.Error.Error a) instance Data.Default.Class.Default (Network.JSONApi.Error.Error a) -- | Entry-point module for this package. -- -- Contains representations of the top-level JSON-API document structure. module Network.JSONApi.Document -- | The Document type represents the top-level JSON-API -- requirement. -- -- data attribute - the resulting JSON may be either a singleton -- resource or a list of resources. See Resource for the -- construction. -- -- For more information see: -- http://jsonapi.org/format/#document-top-level data Document a b c Document :: ResourceData a b -> Maybe Links -> Maybe (Meta c) -> Document a b c [_data] :: Document a b c -> ResourceData a b [_links] :: Document a b c -> Maybe Links [_meta] :: Document a b c -> Maybe (Meta c) -- | The ErrorDocument type represents the alternative form of the -- top-level JSON-API requirement. -- -- error attribute - a descriptive object encapsulating -- application-specific error detail. -- -- For more information see: http://jsonapi.org/format/#errors data ErrorDocument a b ErrorDocument :: Error a -> Maybe Links -> Maybe (Meta b) -> ErrorDocument a b [_error] :: ErrorDocument a b -> Error a [_errorLinks] :: ErrorDocument a b -> Maybe Links [_errorMeta] :: ErrorDocument a b -> Maybe (Meta b) -- | Type for providing application-specific detail to unsuccessful API -- responses. -- -- Specification: http://jsonapi.org/format/#error-objects data Error a Error :: Maybe Text -> Maybe Links -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe (Meta a) -> Error a [id] :: Error a -> Maybe Text [links] :: Error a -> Maybe Links [status] :: Error a -> Maybe Text [code] :: Error a -> Maybe Text [title] :: Error a -> Maybe Text [detail] :: Error a -> Maybe Text [meta] :: Error a -> Maybe (Meta a) -- | The Resource type encapsulates the underlying Resource -- -- Included in the top-level Document, the Resource may -- be either a singleton resource or a list. -- -- For more information see: -- http://jsonapi.org/format/#document-top-level data ResourceData a b Singleton :: (Resource a b) -> ResourceData a b List :: [Resource a b] -> ResourceData a b -- | 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 data Relationship -- | 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 data Resource a b Resource :: Identifier -> a -> Maybe Links -> Maybe (Meta b) -> Maybe (Map Text Relationship) -> Resource a b [getIdentifier] :: Resource a b -> Identifier [getResource] :: Resource a b -> a [getLinks] :: Resource a b -> Maybe Links [getMetaData] :: Resource a b -> Maybe (Meta b) [getRelationships] :: Resource a b -> Maybe (Map Text Relationship) -- | Identifiers are used to encapsulate the minimum amount of information -- to uniquely identify a resource. -- -- This object will be found at multiple levels of the JSON-API structure -- -- Specification: -- http://jsonapi.org/format/#document-resource-identifier-objects data Identifier Identifier :: Text -> Text -> Identifier [_id] :: Identifier -> Text [_type] :: Identifier -> Text -- | Type representing a JSON-API link object. -- -- Links are an abstraction around an underlying Map consisting of -- relevance identifiers as keys and URIs as values. -- -- Example JSON: "links": { "self": -- "http://example.com/posts/1" } -- -- Specification: http://jsonapi.org/format/#document-links data Links -- | Type representing a JSON-API meta object. -- -- Meta is an abstraction around an underlying Map consisting of -- resource-specific metadata. -- -- Example JSON: "meta": { "copyright": "Copyright 2015 Example -- Corp.", "authors": [ "Andre Dawson", "Kirby Puckett", "Don Mattingly", -- "Ozzie Guillen" ] } -- -- Specification: http://jsonapi.org/format/#document-meta data Meta a Meta :: (Map Text a) -> Meta a -- | Constructor function for building Links toLinks :: [(Rel, URL)] -> Links -- | Constructor function for creating a Relationship record -- -- A relationship must contain either an Identifier or a Links record mkRelationship :: Maybe Identifier -> Maybe Links -> Maybe Relationship instance GHC.Generics.Generic (Network.JSONApi.Document.ErrorDocument a b) instance (GHC.Classes.Eq a, GHC.Classes.Eq b) => GHC.Classes.Eq (Network.JSONApi.Document.ErrorDocument a b) instance (GHC.Show.Show a, GHC.Show.Show b) => GHC.Show.Show (Network.JSONApi.Document.ErrorDocument a b) instance GHC.Generics.Generic (Network.JSONApi.Document.Document a b c) instance (GHC.Classes.Eq a, GHC.Classes.Eq b, GHC.Classes.Eq c) => GHC.Classes.Eq (Network.JSONApi.Document.Document a b c) instance (GHC.Show.Show a, GHC.Show.Show b, GHC.Show.Show c) => GHC.Show.Show (Network.JSONApi.Document.Document a b c) instance GHC.Generics.Generic (Network.JSONApi.Document.ResourceData a b) instance (GHC.Classes.Eq a, GHC.Classes.Eq b) => GHC.Classes.Eq (Network.JSONApi.Document.ResourceData a b) instance (GHC.Show.Show a, GHC.Show.Show b) => GHC.Show.Show (Network.JSONApi.Document.ResourceData a b) instance (Data.Aeson.Types.Class.ToJSON a, Data.Aeson.Types.Class.ToJSON b) => Data.Aeson.Types.Class.ToJSON (Network.JSONApi.Document.ResourceData a b) instance (Data.Aeson.Types.Class.FromJSON a, Data.Aeson.Types.Class.FromJSON b) => Data.Aeson.Types.Class.FromJSON (Network.JSONApi.Document.ResourceData a b) instance (Data.Aeson.Types.Class.ToJSON a, Data.Aeson.Types.Class.ToJSON b, Data.Aeson.Types.Class.ToJSON c) => Data.Aeson.Types.Class.ToJSON (Network.JSONApi.Document.Document a b c) instance (Data.Aeson.Types.Class.FromJSON a, Data.Aeson.Types.Class.FromJSON b, Data.Aeson.Types.Class.FromJSON c) => Data.Aeson.Types.Class.FromJSON (Network.JSONApi.Document.Document a b c) instance (Data.Aeson.Types.Class.ToJSON a, Data.Aeson.Types.Class.ToJSON b) => Data.Aeson.Types.Class.ToJSON (Network.JSONApi.Document.ErrorDocument a b) instance (Data.Aeson.Types.Class.FromJSON a, Data.Aeson.Types.Class.FromJSON b) => Data.Aeson.Types.Class.FromJSON (Network.JSONApi.Document.ErrorDocument a b)