Skip to content

Commit

Permalink
WPB-663 servantify brig provider service API (#3566)
Browse files Browse the repository at this point in the history
  • Loading branch information
battermann committed Oct 2, 2023
1 parent 42e1824 commit 0f4623a
Show file tree
Hide file tree
Showing 13 changed files with 508 additions and 389 deletions.
14 changes: 14 additions & 0 deletions changelog.d/5-internal/WPB-663
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Migrating the following routes to the Servant API form.

POST /provider/services
GET /provider/services
GET /provider/services/:sid
PUT /provider/services/:sid
PUT /provider/services/:sid/connection
DELETE /provider/services/:sid
GET /providers/:pid/services
GET /providers/:pid/services/:sid
GET /services
GET /services/tags
GET /teams/:tid/services/whitelisted
POST /teams/:tid/services/whitelist
6 changes: 6 additions & 0 deletions libs/wire-api/src/Wire/API/Error/Brig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,19 @@ data BrigError
| TooManyConversationMembers
| ServiceDisabled
| InvalidBot
| InvalidServiceKey
| ServiceNotFound
| VerificationCodeThrottled
| InvalidProvider
| ProviderNotFound

instance (Typeable (MapError e), KnownError (MapError e)) => IsSwaggerError (e :: BrigError) where
addToOpenApi = addStaticErrorToSwagger @(MapError e)

type instance MapError 'ServiceNotFound = 'StaticError 404 "not-found" "Service not found."

type instance MapError 'InvalidServiceKey = 'StaticError 400 "invalid-service-key" "Invalid service key."

type instance MapError 'ProviderNotFound = 'StaticError 404 "not-found" "Provider not found."

type instance MapError 'InvalidProvider = 'StaticError 403 "invalid-provider" "The provider does not exist."
Expand Down
Loading

0 comments on commit 0f4623a

Please sign in to comment.