wire-api-0.1.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Wire.API.Routes.Public.Galley.Messaging

Documentation

type MessagingAPI = Named "post-otr-message-unqualified" (Summary "Post an encrypted message to a conversation (accepts JSON or Protobuf)" :> (Description PostOtrDescriptionUnqualified :> (MakesFederatedCall 'Galley "on-message-sent" :> (MakesFederatedCall 'Brig "get-user-clients" :> (ZLocalUser :> (ZConn :> ("conversations" :> (Capture "cnv" ConvId :> ("otr" :> ("messages" :> (QueryParam "ignore_missing" IgnoreMissing :> (QueryParam "report_missing" ReportMissing :> (ReqBody '[JSON, Proto] NewOtrMessage :> MultiVerb 'POST '[JSON] (PostOtrResponses ClientMismatch) (PostOtrResponse ClientMismatch)))))))))))))) :<|> (Named "post-otr-broadcast-unqualified" (Summary "Broadcast an encrypted message to all team members and all contacts (accepts JSON or Protobuf)" :> (Description PostOtrDescriptionUnqualified :> (ZLocalUser :> (ZConn :> (CanThrow 'TeamNotFound :> (CanThrow 'BroadcastLimitExceeded :> (CanThrow 'NonBindingTeam :> ("broadcast" :> ("otr" :> ("messages" :> (QueryParam "ignore_missing" IgnoreMissing :> (QueryParam "report_missing" ReportMissing :> (ReqBody '[JSON, Proto] NewOtrMessage :> MultiVerb 'POST '[JSON] (PostOtrResponses ClientMismatch) (PostOtrResponse ClientMismatch)))))))))))))) :<|> (Named "post-proteus-message" (Summary "Post an encrypted message to a conversation (accepts only Protobuf)" :> (Description PostOtrDescription :> (MakesFederatedCall 'Brig "get-user-clients" :> (MakesFederatedCall 'Galley "on-message-sent" :> (MakesFederatedCall 'Galley "send-message" :> (ZLocalUser :> (ZConn :> ("conversations" :> (QualifiedCapture "cnv" ConvId :> ("proteus" :> ("messages" :> (ReqBody '[Proto] (RawProto QualifiedNewOtrMessage) :> MultiVerb 'POST '[JSON] (PostOtrResponses MessageSendingStatus) (Either (MessageNotSent MessageSendingStatus) MessageSendingStatus))))))))))))) :<|> Named "post-proteus-broadcast" (Summary "Post an encrypted message to all team members and all contacts (accepts only Protobuf)" :> (Description PostOtrDescription :> (ZLocalUser :> (ZConn :> (CanThrow 'TeamNotFound :> (CanThrow 'BroadcastLimitExceeded :> (CanThrow 'NonBindingTeam :> ("broadcast" :> ("proteus" :> ("messages" :> (ReqBody '[Proto] QualifiedNewOtrMessage :> MultiVerb 'POST '[JSON] (PostOtrResponses MessageSendingStatus) (Either (MessageNotSent MessageSendingStatus) MessageSendingStatus)))))))))))))) Source #

data MessageNotSent a Source #

Instances

Instances details
Functor MessageNotSent Source # 
Instance details

Defined in Wire.API.Routes.Public.Galley.Messaging

Methods

fmap :: (a -> b) -> MessageNotSent a -> MessageNotSent b #

(<$) :: a -> MessageNotSent b -> MessageNotSent a #

(rs ~ (MessageNotSentResponses a .++ '[r]), a ~ ResponseType r) => AsUnion rs (PostOtrResponse a) Source # 
Instance details

Defined in Wire.API.Routes.Public.Galley.Messaging

Generic (MessageNotSent a) Source # 
Instance details

Defined in Wire.API.Routes.Public.Galley.Messaging

Associated Types

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

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

Defined in Wire.API.Routes.Public.Galley.Messaging

Generic (MessageNotSent a) Source # 
Instance details

Defined in Wire.API.Routes.Public.Galley.Messaging

Associated Types

type Code (MessageNotSent a) :: [[Type]] Source #

Eq a => Eq (MessageNotSent a) Source # 
Instance details

Defined in Wire.API.Routes.Public.Galley.Messaging

ToSchema a => ToSchema (MessageNotSent a) Source # 
Instance details

Defined in Wire.API.Routes.Public.Galley.Messaging

AsUnion (MessageNotSentResponses a) (MessageNotSent a) Source # 
Instance details

Defined in Wire.API.Routes.Public.Galley.Messaging

type Rep (MessageNotSent a) Source # 
Instance details

Defined in Wire.API.Routes.Public.Galley.Messaging

type Rep (MessageNotSent a) = D1 ('MetaData "MessageNotSent" "Wire.API.Routes.Public.Galley.Messaging" "wire-api-0.1.0-3915FetN8WgFcCGrbk6Vve" 'False) ((C1 ('MetaCons "MessageNotSentConversationNotFound" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MessageNotSentUnknownClient" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MessageNotSentLegalholdOldClients" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MessageNotSentLegalhold" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MessageNotSentClientMissing" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))))
type Code (MessageNotSent a) Source # 
Instance details

Defined in Wire.API.Routes.Public.Galley.Messaging

type PostOtrResponses a = MessageNotSentResponses a .++ '[Respond 201 "Message sent" a] Source #

type PostOtrDescriptionUnqualified = "This endpoint ensures that the list of clients is correct and only sends the message if the list is correct.\nTo override this, the endpoint accepts two query params:\n- `ignore_missing`: Can be 'true' 'false' or a comma separated list of user IDs.\n - When 'true' all missing clients are ignored.\n - When 'false' all missing clients are reported.\n - When comma separated list of user-ids, only clients for listed users are ignored.\n- `report_missing`: Can be 'true' 'false' or a comma separated list of user IDs.\n - When 'true' all missing clients are reported.\n - When 'false' all missing clients are ignored.\n - When comma separated list of user-ids, only clients for listed users are reported.\n\nApart from these, the request body also accepts `report_missing` which can only be a list of user ids and behaves the same way as the query parameter.\n\nAll three of these should be considered mutually exclusive. The server however does not error if more than one is specified, it reads them in this order of precedence:\n- `report_missing` in the request body has highest precedence.\n- `ignore_missing` in the query param is the next.\n- `report_missing` in the query param has the lowest precedence.\n\nThis endpoint can lead to OtrMessageAdd event being sent to the recipients.\n\n**NOTE:** The protobuf definitions of the request body can be found at https://github.com/wireapp/generic-message-proto/blob/master/proto/otr.proto." Source #

type PostOtrDescription = "This endpoint ensures that the list of clients is correct and only sends the message if the list is correct.\nTo override this, the endpoint accepts `client_mismatch_strategy` in the body. It can have these values:\n- `report_all`: When set, the message is not sent if any clients are missing. The missing clients are reported in the response.\n- `ignore_all`: When set, no checks about missing clients are carried out.\n- `report_only`: Takes a list of qualified UserIDs. If any clients of the listed users are missing, the message is not sent. The missing clients are reported in the response.\n- `ignore_only`: Takes a list of qualified UserIDs. If any clients of the non-listed users are missing, the message is not sent. The missing clients are reported in the response.\n\nThe sending of messages in a federated conversation could theoretically fail partially. To make this case unlikely, the backend first gets a list of clients from all the involved backends and then tries to send a message. So, if any backend is down, the message is not propagated to anyone. But the actual message fan out to multiple backends could still fail partially. This type of failure is reported as a 201, the clients for which the message sending failed are part of the response body.\n\nThis endpoint can lead to OtrMessageAdd event being sent to the recipients.\n\n**NOTE:** The protobuf definitions of the request body can be found at https://github.com/wireapp/generic-message-proto/blob/master/proto/otr.proto." Source #