mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
synapseadmin: add SuspendAccount method
This commit is contained in:
parent
2b973cac00
commit
441349efac
1 changed files with 13 additions and 0 deletions
|
|
@ -106,6 +106,19 @@ func (cli *Client) DeactivateAccount(ctx context.Context, userID id.UserID, req
|
|||
return err
|
||||
}
|
||||
|
||||
type ReqSuspendUser struct {
|
||||
Suspend bool `json:"suspend"`
|
||||
}
|
||||
|
||||
// SuspendAccount suspends or unsuspends a specific local user account.
|
||||
//
|
||||
// https://element-hq.github.io/synapse/latest/admin_api/user_admin_api.html#suspendunsuspend-account
|
||||
func (cli *Client) SuspendAccount(ctx context.Context, userID id.UserID, req ReqSuspendUser) error {
|
||||
reqURL := cli.BuildAdminURL("v1", "suspend", userID)
|
||||
_, err := cli.MakeRequest(ctx, http.MethodPut, reqURL, &req, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
type ReqCreateOrModifyAccount struct {
|
||||
Password string `json:"password,omitempty"`
|
||||
LogoutDevices *bool `json:"logout_devices,omitempty"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue