wire-api-0.1.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Wire.API.Connection

Description

docs/reference/user/connection.md {#RefConnection}

Types for connections between users.

Synopsis

UserConnection

data UserConnection Source #

Exact state of the connection between two users, stored in Brig database (see lookupConnections).

Connection states have a direction -- e.g. if A sends a connection request to B, we'll create connections (A, B, Sent) and (B, A, Pending).

Instances

Instances details
Arbitrary UserConnection Source # 
Instance details

Defined in Wire.API.Connection

FromJSON UserConnection Source # 
Instance details

Defined in Wire.API.Connection

ToJSON UserConnection Source # 
Instance details

Defined in Wire.API.Connection

Generic UserConnection Source # 
Instance details

Defined in Wire.API.Connection

Associated Types

type Rep UserConnection :: Type -> Type #

Show UserConnection Source # 
Instance details

Defined in Wire.API.Connection

Eq UserConnection Source # 
Instance details

Defined in Wire.API.Connection

ToSchema UserConnection Source # 
Instance details

Defined in Wire.API.Connection

ToSchema UserConnection Source # 
Instance details

Defined in Wire.API.Connection

type Rep UserConnection Source # 
Instance details

Defined in Wire.API.Connection

data UserConnectionList Source #

Response type for endpoints returning lists of connections.

Constructors

UserConnectionList 

Fields

Instances

Instances details
Arbitrary UserConnectionList Source # 
Instance details

Defined in Wire.API.Connection

FromJSON UserConnectionList Source # 
Instance details

Defined in Wire.API.Connection

ToJSON UserConnectionList Source # 
Instance details

Defined in Wire.API.Connection

Generic UserConnectionList Source # 
Instance details

Defined in Wire.API.Connection

Associated Types

type Rep UserConnectionList :: Type -> Type #

Show UserConnectionList Source # 
Instance details

Defined in Wire.API.Connection

Eq UserConnectionList Source # 
Instance details

Defined in Wire.API.Connection

ToSchema UserConnectionList Source # 
Instance details

Defined in Wire.API.Connection

ToSchema UserConnectionList Source # 
Instance details

Defined in Wire.API.Connection

type Rep UserConnectionList Source # 
Instance details

Defined in Wire.API.Connection

type Rep UserConnectionList = D1 ('MetaData "UserConnectionList" "Wire.API.Connection" "wire-api-0.1.0-3915FetN8WgFcCGrbk6Vve" 'False) (C1 ('MetaCons "UserConnectionList" 'PrefixI 'True) (S1 ('MetaSel ('Just "clConnections") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [UserConnection]) :*: S1 ('MetaSel ('Just "clHasMore") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool)))

data Relation Source #

Possible relations between two users. For detailed descriptions of these states, see:

docs/reference/user/connection.md {#RefConnectionStates}

Constructors

Accepted 
Blocked 
Pending 
Ignored 
Sent 
Cancelled 
MissingLegalholdConsent

behaves like blocked, the extra constructor is just to inform why.

Instances

Instances details
Arbitrary Relation Source # 
Instance details

Defined in Wire.API.Connection

FromJSON Relation Source # 
Instance details

Defined in Wire.API.Connection

ToJSON Relation Source # 
Instance details

Defined in Wire.API.Connection

Bounded Relation Source # 
Instance details

Defined in Wire.API.Connection

Enum Relation Source # 
Instance details

Defined in Wire.API.Connection

Generic Relation Source # 
Instance details

Defined in Wire.API.Connection

Associated Types

type Rep Relation :: Type -> Type #

Methods

from :: Relation -> Rep Relation x #

to :: Rep Relation x -> Relation #

Show Relation Source # 
Instance details

Defined in Wire.API.Connection

Eq Relation Source # 
Instance details

Defined in Wire.API.Connection

Ord Relation Source # 
Instance details

Defined in Wire.API.Connection

FromHttpApiData Relation Source # 
Instance details

Defined in Wire.API.Connection

ToHttpApiData Relation Source # 
Instance details

Defined in Wire.API.Connection

ToParamSchema Relation Source # 
Instance details

Defined in Wire.API.Connection

ToSchema Relation Source # 
Instance details

Defined in Wire.API.Connection

ToSchema Relation Source # 
Instance details

Defined in Wire.API.Connection

type Rep Relation Source # 
Instance details

Defined in Wire.API.Connection

type Rep Relation = D1 ('MetaData "Relation" "Wire.API.Connection" "wire-api-0.1.0-3915FetN8WgFcCGrbk6Vve" 'False) ((C1 ('MetaCons "Accepted" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Blocked" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Pending" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Ignored" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Sent" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Cancelled" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MissingLegalholdConsent" 'PrefixI 'False) (U1 :: Type -> Type))))

data RelationWithHistory Source #

updateConnectionInternal, requires knowledge of the previous state (before MissingLegalholdConsent), but the clients don't need that information. To avoid having to change the API, we introduce an internal variant of Relation with surjective mapping relationDropHistory.

Instances

Instances details
Arbitrary RelationWithHistory Source # 
Instance details

Defined in Wire.API.Connection

Generic RelationWithHistory Source # 
Instance details

Defined in Wire.API.Connection

Associated Types

type Rep RelationWithHistory :: Type -> Type #

Show RelationWithHistory Source # 
Instance details

Defined in Wire.API.Connection

Cql RelationWithHistory Source # 
Instance details

Defined in Wire.API.Connection

Eq RelationWithHistory Source # 
Instance details

Defined in Wire.API.Connection

Ord RelationWithHistory Source # 
Instance details

Defined in Wire.API.Connection

type Rep RelationWithHistory Source # 
Instance details

Defined in Wire.API.Connection

type Rep RelationWithHistory = D1 ('MetaData "RelationWithHistory" "Wire.API.Connection" "wire-api-0.1.0-3915FetN8WgFcCGrbk6Vve" 'False) (((C1 ('MetaCons "AcceptedWithHistory" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "BlockedWithHistory" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PendingWithHistory" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "IgnoredWithHistory" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SentWithHistory" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CancelledWithHistory" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "MissingLegalholdConsentFromAccepted" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MissingLegalholdConsentFromBlocked" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MissingLegalholdConsentFromPending" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "MissingLegalholdConsentFromIgnored" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MissingLegalholdConsentFromSent" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MissingLegalholdConsentFromCancelled" 'PrefixI 'False) (U1 :: Type -> Type)))))

relationWithHistory :: Relation -> RelationWithHistory Source #

Convert a Relation to RelationWithHistory. This is to be used only if the MissingLegalholdConsent case does not need to be supported.

Requests

data ConnectionRequest Source #

Payload type for a connection request from one user to another.

Constructors

ConnectionRequest 

Fields

  • crUser :: UserId

    Connection recipient

  • crName :: Range 1 256 Text

    Name of the conversation to be created. This is not used in any meaningful way anymore. The clients just write the name of the target user here and it is ignored later.

    (In the past, this was used; but due to spam, clients started ignoring it)

Instances

Instances details
Arbitrary ConnectionRequest Source # 
Instance details

Defined in Wire.API.Connection

FromJSON ConnectionRequest Source # 
Instance details

Defined in Wire.API.Connection

ToJSON ConnectionRequest Source # 
Instance details

Defined in Wire.API.Connection

Generic ConnectionRequest Source # 
Instance details

Defined in Wire.API.Connection

Associated Types

type Rep ConnectionRequest :: Type -> Type #

Show ConnectionRequest Source # 
Instance details

Defined in Wire.API.Connection

Eq ConnectionRequest Source # 
Instance details

Defined in Wire.API.Connection

ToSchema ConnectionRequest Source # 
Instance details

Defined in Wire.API.Connection

ToSchema ConnectionRequest Source # 
Instance details

Defined in Wire.API.Connection

type Rep ConnectionRequest Source # 
Instance details

Defined in Wire.API.Connection

type Rep ConnectionRequest = D1 ('MetaData "ConnectionRequest" "Wire.API.Connection" "wire-api-0.1.0-3915FetN8WgFcCGrbk6Vve" 'False) (C1 ('MetaCons "ConnectionRequest" 'PrefixI 'True) (S1 ('MetaSel ('Just "crUser") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UserId) :*: S1 ('MetaSel ('Just "crName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Range 1 256 Text))))

newtype ConnectionUpdate Source #

Payload type for "please change the status of this connection".

Constructors

ConnectionUpdate 

Fields

Instances

Instances details
Arbitrary ConnectionUpdate Source # 
Instance details

Defined in Wire.API.Connection

FromJSON ConnectionUpdate Source # 
Instance details

Defined in Wire.API.Connection

ToJSON ConnectionUpdate Source # 
Instance details

Defined in Wire.API.Connection

Generic ConnectionUpdate Source # 
Instance details

Defined in Wire.API.Connection

Associated Types

type Rep ConnectionUpdate :: Type -> Type #

Show ConnectionUpdate Source # 
Instance details

Defined in Wire.API.Connection

Eq ConnectionUpdate Source # 
Instance details

Defined in Wire.API.Connection

ToSchema ConnectionUpdate Source # 
Instance details

Defined in Wire.API.Connection

ToSchema ConnectionUpdate Source # 
Instance details

Defined in Wire.API.Connection

type Rep ConnectionUpdate Source # 
Instance details

Defined in Wire.API.Connection

type Rep ConnectionUpdate = D1 ('MetaData "ConnectionUpdate" "Wire.API.Connection" "wire-api-0.1.0-3915FetN8WgFcCGrbk6Vve" 'True) (C1 ('MetaCons "ConnectionUpdate" 'PrefixI 'True) (S1 ('MetaSel ('Just "cuStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Relation)))

type ListConnectionsRequestPaginated = GetMultiTablePageRequest "Connections" LocalOrRemoteTable 500 100 Source #

Request to get a paginated list of connection