Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- newtype RichInfo = RichInfo {}
- richInfoSize :: RichInfo -> Int
- richInfoMapURN :: IsString s => s
- mkRichInfo :: [RichField] -> RichInfo
- data RichInfoMapAndList
- mkRichInfoMapAndList :: [RichField] -> RichInfoMapAndList
- toRichInfoAssocList :: RichInfoMapAndList -> RichInfoAssocList
- fromRichInfoAssocList :: RichInfoAssocList -> RichInfoMapAndList
- data RichInfoAssocList
- mkRichInfoAssocList :: [RichField] -> RichInfoAssocList
- normalizeRichInfoAssocList :: RichInfoAssocList -> RichInfoAssocList
- richInfoAssocListURN :: IsString s => s
- data RichField = RichField {}
RichInfo
A RichInfoAssocList
that parses and renders as RichInfoMapAndList
.
Instances
Arbitrary RichInfo Source # | |
FromJSON RichInfo Source # | |
ToJSON RichInfo Source # | |
Monoid RichInfo Source # | |
Semigroup RichInfo Source # | |
Generic RichInfo Source # | |
Show RichInfo Source # | |
Eq RichInfo Source # | |
ToSchema RichInfo Source # | |
Defined in Wire.API.User.RichInfo | |
ToSchema RichInfo Source # | |
Defined in Wire.API.User.RichInfo | |
type Rep RichInfo Source # | |
Defined in Wire.API.User.RichInfo type Rep RichInfo = D1 ('MetaData "RichInfo" "Wire.API.User.RichInfo" "wire-api-0.1.0-EbZS9CKNOfZ8BBy5DRJfXi" '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
.
mkRichInfo :: [RichField] -> RichInfo Source #
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.
Instances
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
richInfoAssocListURN :: IsString s => s Source #
Uniform Resource Names used for serialization of RichInfo
.
RichField
Instances
Arbitrary RichField Source # | |
FromJSON RichField Source # | |
ToJSON RichField Source # | |
Generic RichField Source # | |
Show RichField Source # | |
Eq RichField Source # | |
ToSchema RichField Source # | |
Defined in Wire.API.User.RichInfo | |
ToSchema RichField Source # | |
Defined in Wire.API.User.RichInfo | |
type Rep RichField Source # | |
Defined in Wire.API.User.RichInfo type Rep RichField = D1 ('MetaData "RichField" "Wire.API.User.RichInfo" "wire-api-0.1.0-EbZS9CKNOfZ8BBy5DRJfXi" '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))) |