-- 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.2 -- | 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.ResourceObject newtype ResourceId ResourceId :: Text -> ResourceId -- | Type representing a JSON-API resource object. -- -- A ResourceObject supplies standardized data and metadata about a -- resource. -- -- Specification: -- http://jsonapi.org/format/#document-resource-objects data ResourceObject a b ResourceObject :: ResourceId -> ResourceType -> a -> Maybe Links -> Maybe (Meta b) -> ResourceObject a b [getResourceId] :: ResourceObject a b -> ResourceId [getResourceType] :: ResourceObject a b -> ResourceType [getResource] :: ResourceObject a b -> a [getLinks] :: ResourceObject a b -> Maybe Links [getMetaData] :: ResourceObject a b -> Maybe (Meta b) newtype ResourceType ResourceType :: Text -> ResourceType instance GHC.Generics.Generic (Network.JSONApi.ResourceObject.ResourceObject a b) instance (GHC.Classes.Ord a, GHC.Classes.Ord b) => GHC.Classes.Ord (Network.JSONApi.ResourceObject.ResourceObject a b) instance (GHC.Classes.Eq a, GHC.Classes.Eq b) => GHC.Classes.Eq (Network.JSONApi.ResourceObject.ResourceObject a b) instance (GHC.Show.Show a, GHC.Show.Show b) => GHC.Show.Show (Network.JSONApi.ResourceObject.ResourceObject a b) instance GHC.Generics.Generic Network.JSONApi.ResourceObject.ResourceType instance Data.Aeson.Types.Class.FromJSON Network.JSONApi.ResourceObject.ResourceType instance Data.Aeson.Types.Class.ToJSON Network.JSONApi.ResourceObject.ResourceType instance GHC.Classes.Ord Network.JSONApi.ResourceObject.ResourceType instance GHC.Classes.Eq Network.JSONApi.ResourceObject.ResourceType instance GHC.Show.Show Network.JSONApi.ResourceObject.ResourceType instance GHC.Generics.Generic Network.JSONApi.ResourceObject.ResourceId instance Data.Aeson.Types.Class.FromJSON Network.JSONApi.ResourceObject.ResourceId instance Data.Aeson.Types.Class.ToJSON Network.JSONApi.ResourceObject.ResourceId instance GHC.Classes.Ord Network.JSONApi.ResourceObject.ResourceId instance GHC.Classes.Eq Network.JSONApi.ResourceObject.ResourceId instance GHC.Show.Show Network.JSONApi.ResourceObject.ResourceId instance (Data.Aeson.Types.Class.ToJSON a, Data.Aeson.Types.Class.ToJSON b) => Data.Aeson.Types.Class.ToJSON (Network.JSONApi.ResourceObject.ResourceObject a b) instance (Data.Aeson.Types.Class.FromJSON a, Data.Aeson.Types.Class.FromJSON b) => Data.Aeson.Types.Class.FromJSON (Network.JSONApi.ResourceObject.ResourceObject a b) -- | 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 :: Resource a b -> Maybe Links -> Maybe (Meta c) -> Document a b c [_data] :: Document a b c -> Resource 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 -- ResourceObject -- -- 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 Resource a b Singleton :: (ResourceObject a b) -> Resource a b List :: [ResourceObject a b] -> Resource a b newtype ResourceId ResourceId :: Text -> ResourceId -- | Type representing a JSON-API resource object. -- -- A ResourceObject supplies standardized data and metadata about a -- resource. -- -- Specification: -- http://jsonapi.org/format/#document-resource-objects data ResourceObject a b ResourceObject :: ResourceId -> ResourceType -> a -> Maybe Links -> Maybe (Meta b) -> ResourceObject a b [getResourceId] :: ResourceObject a b -> ResourceId [getResourceType] :: ResourceObject a b -> ResourceType [getResource] :: ResourceObject a b -> a [getLinks] :: ResourceObject a b -> Maybe Links [getMetaData] :: ResourceObject a b -> Maybe (Meta b) newtype ResourceType ResourceType :: Text -> ResourceType -- | 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 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.Resource a b) instance (GHC.Classes.Eq a, GHC.Classes.Eq b) => GHC.Classes.Eq (Network.JSONApi.Document.Resource a b) instance (GHC.Show.Show a, GHC.Show.Show b) => GHC.Show.Show (Network.JSONApi.Document.Resource a b) instance (Data.Aeson.Types.Class.ToJSON a, Data.Aeson.Types.Class.ToJSON b) => Data.Aeson.Types.Class.ToJSON (Network.JSONApi.Document.Resource a b) instance (Data.Aeson.Types.Class.FromJSON a, Data.Aeson.Types.Class.FromJSON b) => Data.Aeson.Types.Class.FromJSON (Network.JSONApi.Document.Resource 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)