servant-hateoas-0.2.1: HATEOAS extension for servant
Safe HaskellSafe-Inferred
LanguageGHC2021

Servant.Hateoas

Synopsis

Documentation

data Collection (t :: Type) Source #

Data-Kind representing Content-Types of HATEOAS collections.

Type parameter t is the Mime-Type suffix in application/vnd.collection+t.

data CollectionResource a Source #

Resource wrapper for Collection.

Instances

Instances details
CollectingResource CollectionResource Source # 
Instance details

Defined in Servant.Hateoas.ContentType.Collection

Resource CollectionResource Source # 
Instance details

Defined in Servant.Hateoas.ContentType.Collection

Methods

addLink :: forall (a :: k). (String, Link) -> CollectionResource a -> CollectionResource a Source #

(Related a, HasField (IdSelName a) a id, IsElem (GetOneApi a) api, HasLink (GetOneApi a), MkLink (GetOneApi a) Link ~ (id -> Link), BuildRels api (Relations a) a, Resource CollectionResource) => ToCollection (api :: Type) CollectionResource a Source # 
Instance details

Defined in Servant.Hateoas.ContentType.Collection

ToJSON a => MimeRender (Collection JSON) (CollectionResource a) Source # 
Instance details

Defined in Servant.Hateoas.ContentType.Collection

ToJSON a => ToJSON (CollectionResource a) Source # 
Instance details

Defined in Servant.Hateoas.ContentType.Collection

Generic (CollectionResource a) Source # 
Instance details

Defined in Servant.Hateoas.ContentType.Collection

Associated Types

type Rep (CollectionResource a) :: Type -> Type #

Show a => Show (CollectionResource a) Source # 
Instance details

Defined in Servant.Hateoas.ContentType.Collection

type Rep (CollectionResource a) Source # 
Instance details

Defined in Servant.Hateoas.ContentType.Collection

type Rep (CollectionResource a) = D1 ('MetaData "CollectionResource" "Servant.Hateoas.ContentType.Collection" "servant-hateoas-0.2.1-inplace" 'False) (C1 ('MetaCons "CollectionResource" 'PrefixI 'True) (S1 ('MetaSel ('Just "href") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Link)) :*: (S1 ('MetaSel ('Just "items") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [CollectionItem a]) :*: S1 ('MetaSel ('Just "links") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(String, Link)]))))

data HAL (t :: Type) Source #

Data-Kind representing Content-Types of Hypertext Application Language (HAL).

Type parameter t is the mime type suffix in application/hal+t.

Instances

Instances details
Accept (HAL JSON) Source # 
Instance details

Defined in Servant.Hateoas.ContentType.HAL

ToJSON a => MimeRender (HAL JSON) (HALResource a) Source # 
Instance details

Defined in Servant.Hateoas.ContentType.HAL

data HALResource a Source #

Resource wrapper for HAL.

Instances

Instances details
EmbeddingResource HALResource Source # 
Instance details

Defined in Servant.Hateoas.ContentType.HAL

Methods

embed :: forall b (a :: k). ToJSON b => (String, b) -> HALResource a -> HALResource a Source #

Resource HALResource Source # 
Instance details

Defined in Servant.Hateoas.ContentType.HAL

Methods

addLink :: forall (a :: k). (String, Link) -> HALResource a -> HALResource a Source #

(Related a, HasField (IdSelName a) a id, IsElem (GetOneApi a) api, HasLink (GetOneApi a), MkLink (GetOneApi a) Link ~ (id -> Link), BuildRels api (Relations a) a, Resource HALResource) => ToResource (api :: Type) HALResource a Source # 
Instance details

Defined in Servant.Hateoas.ContentType.HAL

ToJSON a => MimeRender (HAL JSON) (HALResource a) Source # 
Instance details

Defined in Servant.Hateoas.ContentType.HAL

ToJSON a => ToJSON (HALResource a) Source # 
Instance details

Defined in Servant.Hateoas.ContentType.HAL

(ToJSON a, Related a, KnownSymbol (CollectionName a)) => ToJSON [HALResource a] Source # 
Instance details

Defined in Servant.Hateoas.ContentType.HAL

Generic (HALResource a) Source # 
Instance details

Defined in Servant.Hateoas.ContentType.HAL

Associated Types

type Rep (HALResource a) :: Type -> Type #

Methods

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

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

type Rep (HALResource a) Source # 
Instance details

Defined in Servant.Hateoas.ContentType.HAL

type Rep (HALResource a) = D1 ('MetaData "HALResource" "Servant.Hateoas.ContentType.HAL" "servant-hateoas-0.2.1-inplace" 'False) (C1 ('MetaCons "HALResource" 'PrefixI 'True) (S1 ('MetaSel ('Just "resource") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: (S1 ('MetaSel ('Just "links") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(String, Link)]) :*: S1 ('MetaSel ('Just "embedded") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(String, SomeToJSON HALResource)]))))