wire-api-0.1.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Wire.API.User.RichInfo

Synopsis

RichInfo

newtype RichInfo Source #

A RichInfoAssocList that parses and renders as RichInfoMapAndList.

Constructors

RichInfo 

Instances

Instances details
Arbitrary RichInfo Source # 
Instance details

Defined in Wire.API.User.RichInfo

FromJSON RichInfo Source # 
Instance details

Defined in Wire.API.User.RichInfo

ToJSON RichInfo Source # 
Instance details

Defined in Wire.API.User.RichInfo

Monoid RichInfo Source # 
Instance details

Defined in Wire.API.User.RichInfo

Semigroup RichInfo Source # 
Instance details

Defined in Wire.API.User.RichInfo

Generic RichInfo Source # 
Instance details

Defined in Wire.API.User.RichInfo

Associated Types

type Rep RichInfo :: Type -> Type #

Methods

from :: RichInfo -> Rep RichInfo x #

to :: Rep RichInfo x -> RichInfo #

Show RichInfo Source # 
Instance details

Defined in Wire.API.User.RichInfo

Eq RichInfo Source # 
Instance details

Defined in Wire.API.User.RichInfo

ToSchema RichInfo Source # 
Instance details

Defined in Wire.API.User.RichInfo

ToSchema RichInfo Source # 
Instance details

Defined in Wire.API.User.RichInfo

type Rep RichInfo Source # 
Instance details

Defined in Wire.API.User.RichInfo

type Rep RichInfo = D1 ('MetaData "RichInfo" "Wire.API.User.RichInfo" "wire-api-0.1.0-3915FetN8WgFcCGrbk6Vve" 'True) (C1 ('MetaCons "RichInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unRichInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RichInfoAssocList)))

richInfoSize :: RichInfo -> Int Source #

Calculate the length of user-supplied data in RichInfo. Used for enforcing setRichInfoLimit

NB: we could just calculate the length of JSON-encoded payload, but it is fragile because if our JSON encoding changes, existing payloads might become unacceptable.

richInfoMapURN :: IsString s => s Source #

Uniform Resource Names used for serialization of RichInfo.

RichInfoMapAndList

data RichInfoMapAndList Source #

Represents all the ways we can recieve RichInfo from a SCIM peer.

$sel:richInfoMap:RichInfoMapAndList represents fields given under richInfoMapURN as a JSON object (use case: enterprise extensions as sent by eg. microsoft azure).

$sel:richInfoAssocList:RichInfoMapAndList represents fields given under richInfoAssocListURN as an assoc list (use case: wire native code; we used this so we can give the client arbitrary order in which to show the rich info).

Internally we only store one assoc list. This type is just to keep serialization separate from the tricky semantics of how the map is merged into the list. See toRichInfoAssocList, fromRichInfoAssocList for the merge semantics.

TODO: https://github.com/zinfra/backend-issues/issues/1627

Instances

Instances details
Arbitrary RichInfoMapAndList Source # 
Instance details

Defined in Wire.API.User.RichInfo

Generic RichInfoMapAndList Source # 
Instance details

Defined in Wire.API.User.RichInfo

Associated Types

type Rep RichInfoMapAndList :: Type -> Type #

Show RichInfoMapAndList Source # 
Instance details

Defined in Wire.API.User.RichInfo

Eq RichInfoMapAndList Source # 
Instance details

Defined in Wire.API.User.RichInfo

type Rep RichInfoMapAndList Source # 
Instance details

Defined in Wire.API.User.RichInfo

type Rep RichInfoMapAndList = D1 ('MetaData "RichInfoMapAndList" "Wire.API.User.RichInfo" "wire-api-0.1.0-3915FetN8WgFcCGrbk6Vve" 'False) (C1 ('MetaCons "RichInfoMapAndList" 'PrefixI 'True) (S1 ('MetaSel ('Just "richInfoMap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map (CI Text) Text)) :*: S1 ('MetaSel ('Just "richInfoAssocList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [RichField])))

mkRichInfoMapAndList :: [RichField] -> RichInfoMapAndList Source #

Uses normalizeRichInfoMapAndList.

toRichInfoAssocList :: RichInfoMapAndList -> RichInfoAssocList Source #

Lossy transformation of map-and-list representation into list-only representation. The order of the list part of RichInfo is not changed in the output; keys in the map that do not appear in the list are appended in alpha order.

Uses mkRichInfoAssocList; used as one half of normalizeRichInfoAssocList.

fromRichInfoAssocList :: RichInfoAssocList -> RichInfoMapAndList Source #

This is called by spar to recover the more type that also contains a map. Since we don't know where the data came from when it was posted or where the SCIM peer expects the data to be (map or assoc list), we copy the assoc list into the map, and provide all attributes twice.

Used as the other half of normalizeRichInfoAssocList (next to toRichInfoAssocList.

RichInfoAssocList

data RichInfoAssocList Source #

Instances

Instances details
Arbitrary RichInfoAssocList Source # 
Instance details

Defined in Wire.API.User.RichInfo

FromJSON RichInfoAssocList Source # 
Instance details

Defined in Wire.API.User.RichInfo

ToJSON RichInfoAssocList Source # 
Instance details

Defined in Wire.API.User.RichInfo

Monoid RichInfoAssocList Source # 
Instance details

Defined in Wire.API.User.RichInfo

Semigroup RichInfoAssocList Source # 
Instance details

Defined in Wire.API.User.RichInfo

Generic RichInfoAssocList Source # 
Instance details

Defined in Wire.API.User.RichInfo

Associated Types

type Rep RichInfoAssocList :: Type -> Type #

Show RichInfoAssocList Source # 
Instance details

Defined in Wire.API.User.RichInfo

Cql RichInfoAssocList Source # 
Instance details

Defined in Wire.API.User.RichInfo

Eq RichInfoAssocList Source # 
Instance details

Defined in Wire.API.User.RichInfo

ToSchema RichInfoAssocList Source # 
Instance details

Defined in Wire.API.User.RichInfo

ToSchema RichInfoAssocList Source # 
Instance details

Defined in Wire.API.User.RichInfo

type Rep RichInfoAssocList Source # 
Instance details

Defined in Wire.API.User.RichInfo

type Rep RichInfoAssocList = D1 ('MetaData "RichInfoAssocList" "Wire.API.User.RichInfo" "wire-api-0.1.0-3915FetN8WgFcCGrbk6Vve" 'True) (C1 ('MetaCons "RichInfoAssocList" 'PrefixI 'True) (S1 ('MetaSel ('Just "unRichInfoAssocList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [RichField])))

richInfoAssocListURN :: IsString s => s Source #

Uniform Resource Names used for serialization of RichInfo.

RichField

data RichField Source #

Constructors

RichField 

Instances

Instances details
Arbitrary RichField Source # 
Instance details

Defined in Wire.API.User.RichInfo

FromJSON RichField Source # 
Instance details

Defined in Wire.API.User.RichInfo

ToJSON RichField Source # 
Instance details

Defined in Wire.API.User.RichInfo

Generic RichField Source # 
Instance details

Defined in Wire.API.User.RichInfo

Associated Types

type Rep RichField :: Type -> Type #

Show RichField Source # 
Instance details

Defined in Wire.API.User.RichInfo

Eq RichField Source # 
Instance details

Defined in Wire.API.User.RichInfo

ToSchema RichField Source # 
Instance details

Defined in Wire.API.User.RichInfo

ToSchema RichField Source # 
Instance details

Defined in Wire.API.User.RichInfo

type Rep RichField Source # 
Instance details

Defined in Wire.API.User.RichInfo

type Rep RichField = D1 ('MetaData "RichField" "Wire.API.User.RichInfo" "wire-api-0.1.0-3915FetN8WgFcCGrbk6Vve" 'False) (C1 ('MetaCons "RichField" 'PrefixI 'True) (S1 ('MetaSel ('Just "richFieldType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (CI Text)) :*: S1 ('MetaSel ('Just "richFieldValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))