module Galley.API.Public.Team where
import Galley.API.Teams
import Galley.App
import Wire.API.Routes.API
import Wire.API.Routes.Public.Galley.Team
teamAPI :: API TeamAPI GalleyEffects
teamAPI :: API TeamAPI GalleyEffects
teamAPI =
forall {k} (name :: k) (r0 :: EffectRow) api.
(HasServer api '[Domain],
ServerEffects (DeclaredErrorEffects api) r0) =>
ServerT api (Sem (Append (DeclaredErrorEffects api) r0))
-> API (Named name api) r0
forall (name :: Symbol) (r0 :: EffectRow) api.
(HasServer api '[Domain],
ServerEffects (DeclaredErrorEffects api) r0) =>
ServerT api (Sem (Append (DeclaredErrorEffects api) r0))
-> API (Named name api) r0
mkNamedAPI @"create-non-binding-team" ServerT
(Summary "Create a new non binding team"
:> (Until 'V4
:> (ZUser
:> (ZConn
:> (CanThrow 'InvalidAction
:> ("teams"
:> (ReqBody '[JSON] NonBindingNewTeam
:> MultiVerb
'POST
'[JSON]
'[WithHeaders
'[DescHeader "Location" "Team ID" TeamId]
TeamId
(RespondEmpty 201 "Team ID as `Location` header value")]
TeamId)))))))
(Sem
(Append
(DeclaredErrorEffects
(Summary "Create a new non binding team"
:> (Until 'V4
:> (ZUser
:> (ZConn
:> (CanThrow 'InvalidAction
:> ("teams"
:> (ReqBody '[JSON] NonBindingNewTeam
:> MultiVerb
'POST
'[JSON]
'[WithHeaders
'[DescHeader "Location" "Team ID" TeamId]
TeamId
(RespondEmpty
201 "Team ID as `Location` header value")]
TeamId))))))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]))
UserId
-> ConnId
-> NonBindingNewTeam
-> Sem
'[ErrorS 'InvalidAction, BrigAccess, SparAccess,
NotificationSubsystem, GundeckAPIAccess, Rpc, ExternalAccess,
FederatorAccess, BackendNotificationQueueAccess, BotAccess,
FireAndForget, ClientStore, CodeStore, ProposalStore,
ConversationStore, SubConversationStore, Random,
CustomBackendStore, TeamFeatureStore, LegalHoldStore, MemberStore,
SearchVisibilityStore, ServiceStore, TeamNotificationStore,
TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
TeamId
forall (r :: EffectRow) a.
Member (ErrorS 'InvalidAction) r =>
UserId -> ConnId -> a -> Sem r TeamId
createNonBindingTeamH
API
(Named
"create-non-binding-team"
(Summary "Create a new non binding team"
:> (Until 'V4
:> (ZUser
:> (ZConn
:> (CanThrow 'InvalidAction
:> ("teams"
:> (ReqBody '[JSON] NonBindingNewTeam
:> MultiVerb
'POST
'[JSON]
'[WithHeaders
'[DescHeader "Location" "Team ID" TeamId]
TeamId
(RespondEmpty 201 "Team ID as `Location` header value")]
TeamId))))))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
-> API
(Named
"update-team"
(Summary "Update team properties"
:> (ZUser
:> (ZConn
:> (CanThrow 'NotATeamMember
:> (CanThrow ('MissingPermission ('Just 'SetTeamData))
:> ("teams"
:> (Capture "tid" TeamId
:> (ReqBody '[JSON] TeamUpdateData
:> MultiVerb
'PUT '[JSON] '[RespondEmpty 200 "Team updated"] ()))))))))
:<|> (Named
"get-teams"
(Summary "Get teams (deprecated); use `GET /teams/:tid`"
:> (Until 'V4 :> (ZUser :> ("teams" :> Get '[JSON] TeamList))))
:<|> (Named
"get-team"
(Summary "Get a team by ID"
:> (ZUser
:> (CanThrow 'TeamNotFound
:> ("teams" :> (Capture "tid" TeamId :> Get '[JSON] Team)))))
:<|> Named
"delete-team"
(Summary "Delete a team"
:> (ZUser
:> (ZConn
:> (CanThrow 'TeamNotFound
:> (CanThrow ('MissingPermission ('Just 'DeleteTeam))
:> (CanThrow 'NotATeamMember
:> (CanThrow OperationDenied
:> (CanThrow 'DeleteQueueFull
:> (CanThrow AuthenticationError
:> ("teams"
:> (Capture "tid" TeamId
:> (ReqBody '[JSON] TeamDeleteData
:> MultiVerb
'DELETE
'[JSON]
'[RespondEmpty
202
"Team is scheduled for removal"]
())))))))))))))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
-> API
TeamAPI
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
forall api1 (r :: EffectRow) api2.
API api1 r -> API api2 r -> API (api1 :<|> api2) r
<@> forall {k} (name :: k) (r0 :: EffectRow) api.
(HasServer api '[Domain],
ServerEffects (DeclaredErrorEffects api) r0) =>
ServerT api (Sem (Append (DeclaredErrorEffects api) r0))
-> API (Named name api) r0
forall (name :: Symbol) (r0 :: EffectRow) api.
(HasServer api '[Domain],
ServerEffects (DeclaredErrorEffects api) r0) =>
ServerT api (Sem (Append (DeclaredErrorEffects api) r0))
-> API (Named name api) r0
mkNamedAPI @"update-team" ServerT
(Summary "Update team properties"
:> (ZUser
:> (ZConn
:> (CanThrow 'NotATeamMember
:> (CanThrow ('MissingPermission ('Just 'SetTeamData))
:> ("teams"
:> (Capture "tid" TeamId
:> (ReqBody '[JSON] TeamUpdateData
:> MultiVerb
'PUT '[JSON] '[RespondEmpty 200 "Team updated"] ()))))))))
(Sem
(Append
(DeclaredErrorEffects
(Summary "Update team properties"
:> (ZUser
:> (ZConn
:> (CanThrow 'NotATeamMember
:> (CanThrow ('MissingPermission ('Just 'SetTeamData))
:> ("teams"
:> (Capture "tid" TeamId
:> (ReqBody '[JSON] TeamUpdateData
:> MultiVerb
'PUT
'[JSON]
'[RespondEmpty 200 "Team updated"]
())))))))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]))
UserId
-> ConnId
-> TeamId
-> TeamUpdateData
-> Sem
'[ErrorS 'NotATeamMember,
Error (Tagged ('MissingPermission ('Just 'SetTeamData)) ()),
BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
()
forall (r :: EffectRow).
(Member (ErrorS 'NotATeamMember) r,
Member
(Error (Tagged ('MissingPermission ('Just 'SetTeamData)) ())) r,
Member NotificationSubsystem r, Member (Input UTCTime) r,
Member TeamStore r) =>
UserId -> ConnId -> TeamId -> TeamUpdateData -> Sem r ()
updateTeamH
API
(Named
"update-team"
(Summary "Update team properties"
:> (ZUser
:> (ZConn
:> (CanThrow 'NotATeamMember
:> (CanThrow ('MissingPermission ('Just 'SetTeamData))
:> ("teams"
:> (Capture "tid" TeamId
:> (ReqBody '[JSON] TeamUpdateData
:> MultiVerb
'PUT '[JSON] '[RespondEmpty 200 "Team updated"] ())))))))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
-> API
(Named
"get-teams"
(Summary "Get teams (deprecated); use `GET /teams/:tid`"
:> (Until 'V4 :> (ZUser :> ("teams" :> Get '[JSON] TeamList))))
:<|> (Named
"get-team"
(Summary "Get a team by ID"
:> (ZUser
:> (CanThrow 'TeamNotFound
:> ("teams" :> (Capture "tid" TeamId :> Get '[JSON] Team)))))
:<|> Named
"delete-team"
(Summary "Delete a team"
:> (ZUser
:> (ZConn
:> (CanThrow 'TeamNotFound
:> (CanThrow ('MissingPermission ('Just 'DeleteTeam))
:> (CanThrow 'NotATeamMember
:> (CanThrow OperationDenied
:> (CanThrow 'DeleteQueueFull
:> (CanThrow AuthenticationError
:> ("teams"
:> (Capture "tid" TeamId
:> (ReqBody '[JSON] TeamDeleteData
:> MultiVerb
'DELETE
'[JSON]
'[RespondEmpty
202
"Team is scheduled for removal"]
()))))))))))))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
-> API
(Named
"update-team"
(Summary "Update team properties"
:> (ZUser
:> (ZConn
:> (CanThrow 'NotATeamMember
:> (CanThrow ('MissingPermission ('Just 'SetTeamData))
:> ("teams"
:> (Capture "tid" TeamId
:> (ReqBody '[JSON] TeamUpdateData
:> MultiVerb
'PUT '[JSON] '[RespondEmpty 200 "Team updated"] ()))))))))
:<|> (Named
"get-teams"
(Summary "Get teams (deprecated); use `GET /teams/:tid`"
:> (Until 'V4 :> (ZUser :> ("teams" :> Get '[JSON] TeamList))))
:<|> (Named
"get-team"
(Summary "Get a team by ID"
:> (ZUser
:> (CanThrow 'TeamNotFound
:> ("teams" :> (Capture "tid" TeamId :> Get '[JSON] Team)))))
:<|> Named
"delete-team"
(Summary "Delete a team"
:> (ZUser
:> (ZConn
:> (CanThrow 'TeamNotFound
:> (CanThrow ('MissingPermission ('Just 'DeleteTeam))
:> (CanThrow 'NotATeamMember
:> (CanThrow OperationDenied
:> (CanThrow 'DeleteQueueFull
:> (CanThrow AuthenticationError
:> ("teams"
:> (Capture "tid" TeamId
:> (ReqBody '[JSON] TeamDeleteData
:> MultiVerb
'DELETE
'[JSON]
'[RespondEmpty
202
"Team is scheduled for removal"]
())))))))))))))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
forall api1 (r :: EffectRow) api2.
API api1 r -> API api2 r -> API (api1 :<|> api2) r
<@> forall {k} (name :: k) (r0 :: EffectRow) api.
(HasServer api '[Domain],
ServerEffects (DeclaredErrorEffects api) r0) =>
ServerT api (Sem (Append (DeclaredErrorEffects api) r0))
-> API (Named name api) r0
forall (name :: Symbol) (r0 :: EffectRow) api.
(HasServer api '[Domain],
ServerEffects (DeclaredErrorEffects api) r0) =>
ServerT api (Sem (Append (DeclaredErrorEffects api) r0))
-> API (Named name api) r0
mkNamedAPI @"get-teams" ServerT
(Summary "Get teams (deprecated); use `GET /teams/:tid`"
:> (Until 'V4 :> (ZUser :> ("teams" :> Get '[JSON] TeamList))))
(Sem
(Append
(DeclaredErrorEffects
(Summary "Get teams (deprecated); use `GET /teams/:tid`"
:> (Until 'V4 :> (ZUser :> ("teams" :> Get '[JSON] TeamList)))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]))
UserId
-> Sem
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
TeamList
forall (r :: EffectRow).
(Member TeamStore r, Member (Queue DeleteItem) r,
Member (ListItems LegacyPaging TeamId) r) =>
UserId -> Sem r TeamList
getManyTeams
API
(Named
"get-teams"
(Summary "Get teams (deprecated); use `GET /teams/:tid`"
:> (Until 'V4 :> (ZUser :> ("teams" :> Get '[JSON] TeamList)))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
-> API
(Named
"get-team"
(Summary "Get a team by ID"
:> (ZUser
:> (CanThrow 'TeamNotFound
:> ("teams" :> (Capture "tid" TeamId :> Get '[JSON] Team)))))
:<|> Named
"delete-team"
(Summary "Delete a team"
:> (ZUser
:> (ZConn
:> (CanThrow 'TeamNotFound
:> (CanThrow ('MissingPermission ('Just 'DeleteTeam))
:> (CanThrow 'NotATeamMember
:> (CanThrow OperationDenied
:> (CanThrow 'DeleteQueueFull
:> (CanThrow AuthenticationError
:> ("teams"
:> (Capture "tid" TeamId
:> (ReqBody '[JSON] TeamDeleteData
:> MultiVerb
'DELETE
'[JSON]
'[RespondEmpty
202
"Team is scheduled for removal"]
())))))))))))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
-> API
(Named
"get-teams"
(Summary "Get teams (deprecated); use `GET /teams/:tid`"
:> (Until 'V4 :> (ZUser :> ("teams" :> Get '[JSON] TeamList))))
:<|> (Named
"get-team"
(Summary "Get a team by ID"
:> (ZUser
:> (CanThrow 'TeamNotFound
:> ("teams" :> (Capture "tid" TeamId :> Get '[JSON] Team)))))
:<|> Named
"delete-team"
(Summary "Delete a team"
:> (ZUser
:> (ZConn
:> (CanThrow 'TeamNotFound
:> (CanThrow ('MissingPermission ('Just 'DeleteTeam))
:> (CanThrow 'NotATeamMember
:> (CanThrow OperationDenied
:> (CanThrow 'DeleteQueueFull
:> (CanThrow AuthenticationError
:> ("teams"
:> (Capture "tid" TeamId
:> (ReqBody '[JSON] TeamDeleteData
:> MultiVerb
'DELETE
'[JSON]
'[RespondEmpty
202
"Team is scheduled for removal"]
()))))))))))))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
forall api1 (r :: EffectRow) api2.
API api1 r -> API api2 r -> API (api1 :<|> api2) r
<@> forall {k} (name :: k) (r0 :: EffectRow) api.
(HasServer api '[Domain],
ServerEffects (DeclaredErrorEffects api) r0) =>
ServerT api (Sem (Append (DeclaredErrorEffects api) r0))
-> API (Named name api) r0
forall (name :: Symbol) (r0 :: EffectRow) api.
(HasServer api '[Domain],
ServerEffects (DeclaredErrorEffects api) r0) =>
ServerT api (Sem (Append (DeclaredErrorEffects api) r0))
-> API (Named name api) r0
mkNamedAPI @"get-team" ServerT
(Summary "Get a team by ID"
:> (ZUser
:> (CanThrow 'TeamNotFound
:> ("teams" :> (Capture "tid" TeamId :> Get '[JSON] Team)))))
(Sem
(Append
(DeclaredErrorEffects
(Summary "Get a team by ID"
:> (ZUser
:> (CanThrow 'TeamNotFound
:> ("teams" :> (Capture "tid" TeamId :> Get '[JSON] Team))))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]))
UserId
-> TeamId
-> Sem
'[ErrorS 'TeamNotFound, BrigAccess, SparAccess,
NotificationSubsystem, GundeckAPIAccess, Rpc, ExternalAccess,
FederatorAccess, BackendNotificationQueueAccess, BotAccess,
FireAndForget, ClientStore, CodeStore, ProposalStore,
ConversationStore, SubConversationStore, Random,
CustomBackendStore, TeamFeatureStore, LegalHoldStore, MemberStore,
SearchVisibilityStore, ServiceStore, TeamNotificationStore,
TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
Team
forall (r :: EffectRow).
(Member (ErrorS 'TeamNotFound) r, Member (Queue DeleteItem) r,
Member TeamStore r) =>
UserId -> TeamId -> Sem r Team
getTeamH
API
(Named
"get-team"
(Summary "Get a team by ID"
:> (ZUser
:> (CanThrow 'TeamNotFound
:> ("teams" :> (Capture "tid" TeamId :> Get '[JSON] Team))))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
-> API
(Named
"delete-team"
(Summary "Delete a team"
:> (ZUser
:> (ZConn
:> (CanThrow 'TeamNotFound
:> (CanThrow ('MissingPermission ('Just 'DeleteTeam))
:> (CanThrow 'NotATeamMember
:> (CanThrow OperationDenied
:> (CanThrow 'DeleteQueueFull
:> (CanThrow AuthenticationError
:> ("teams"
:> (Capture "tid" TeamId
:> (ReqBody '[JSON] TeamDeleteData
:> MultiVerb
'DELETE
'[JSON]
'[RespondEmpty
202 "Team is scheduled for removal"]
())))))))))))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
-> API
(Named
"get-team"
(Summary "Get a team by ID"
:> (ZUser
:> (CanThrow 'TeamNotFound
:> ("teams" :> (Capture "tid" TeamId :> Get '[JSON] Team)))))
:<|> Named
"delete-team"
(Summary "Delete a team"
:> (ZUser
:> (ZConn
:> (CanThrow 'TeamNotFound
:> (CanThrow ('MissingPermission ('Just 'DeleteTeam))
:> (CanThrow 'NotATeamMember
:> (CanThrow OperationDenied
:> (CanThrow 'DeleteQueueFull
:> (CanThrow AuthenticationError
:> ("teams"
:> (Capture "tid" TeamId
:> (ReqBody '[JSON] TeamDeleteData
:> MultiVerb
'DELETE
'[JSON]
'[RespondEmpty
202
"Team is scheduled for removal"]
())))))))))))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
forall api1 (r :: EffectRow) api2.
API api1 r -> API api2 r -> API (api1 :<|> api2) r
<@> forall {k} (name :: k) (r0 :: EffectRow) api.
(HasServer api '[Domain],
ServerEffects (DeclaredErrorEffects api) r0) =>
ServerT api (Sem (Append (DeclaredErrorEffects api) r0))
-> API (Named name api) r0
forall (name :: Symbol) (r0 :: EffectRow) api.
(HasServer api '[Domain],
ServerEffects (DeclaredErrorEffects api) r0) =>
ServerT api (Sem (Append (DeclaredErrorEffects api) r0))
-> API (Named name api) r0
mkNamedAPI @"delete-team" ServerT
(Summary "Delete a team"
:> (ZUser
:> (ZConn
:> (CanThrow 'TeamNotFound
:> (CanThrow ('MissingPermission ('Just 'DeleteTeam))
:> (CanThrow 'NotATeamMember
:> (CanThrow OperationDenied
:> (CanThrow 'DeleteQueueFull
:> (CanThrow AuthenticationError
:> ("teams"
:> (Capture "tid" TeamId
:> (ReqBody '[JSON] TeamDeleteData
:> MultiVerb
'DELETE
'[JSON]
'[RespondEmpty
202 "Team is scheduled for removal"]
()))))))))))))
(Sem
(Append
(DeclaredErrorEffects
(Summary "Delete a team"
:> (ZUser
:> (ZConn
:> (CanThrow 'TeamNotFound
:> (CanThrow ('MissingPermission ('Just 'DeleteTeam))
:> (CanThrow 'NotATeamMember
:> (CanThrow OperationDenied
:> (CanThrow 'DeleteQueueFull
:> (CanThrow AuthenticationError
:> ("teams"
:> (Capture "tid" TeamId
:> (ReqBody '[JSON] TeamDeleteData
:> MultiVerb
'DELETE
'[JSON]
'[RespondEmpty
202
"Team is scheduled for removal"]
())))))))))))))
'[BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]))
UserId
-> ConnId
-> TeamId
-> TeamDeleteData
-> Sem
'[ErrorS 'TeamNotFound,
Error (Tagged ('MissingPermission ('Just 'DeleteTeam)) ()),
ErrorS 'NotATeamMember, Error (Tagged OperationDenied ()),
Error (Tagged 'DeleteQueueFull ()), Error AuthenticationError,
BrigAccess, SparAccess, NotificationSubsystem, GundeckAPIAccess,
Rpc, ExternalAccess, FederatorAccess,
BackendNotificationQueueAccess, BotAccess, FireAndForget,
ClientStore, CodeStore, ProposalStore, ConversationStore,
SubConversationStore, Random, CustomBackendStore, TeamFeatureStore,
LegalHoldStore, MemberStore, SearchVisibilityStore, ServiceStore,
TeamNotificationStore, TeamStore, TeamMemberStore InternalPaging,
TeamMemberStore CassandraPaging, ListItems CassandraPaging ConvId,
ListItems CassandraPaging (Remote ConvId),
ListItems LegacyPaging ConvId, ListItems LegacyPaging TeamId,
ListItems InternalPaging TeamId, Input AllTeamFeatures,
Input (Maybe [TeamId], FeatureDefaults LegalholdConfig),
Input (Local ()), Input Opts, Input UTCTime, Queue DeleteItem,
Logger (Msg -> Msg), Error DynError, Input ClientState, Input Env,
HashPassword, Error InvalidInput, Error InternalError,
Error FederationError, Async, Delay, Fail, Embed IO,
Error JSONResponse, Resource, Final IO]
()
forall (r :: EffectRow).
(Member BrigAccess r, Member (Error AuthenticationError) r,
Member (Error (Tagged 'DeleteQueueFull ())) r,
Member (ErrorS 'NotATeamMember) r,
Member (Error (Tagged OperationDenied ())) r,
Member (ErrorS 'TeamNotFound) r, Member (Queue DeleteItem) r,
Member TeamStore r) =>
UserId -> ConnId -> TeamId -> TeamDeleteData -> Sem r ()
deleteTeam