SetSuspended
client.Users.SetSuspended(ctx, body) (*UserSetSuspendedResponse, error)
POST/gitpod.v1.UserService/SetSuspended
Sets whether a user account is suspended.
Use this method to:
- Suspend problematic users
- Reactivate suspended accounts
- Manage user access
Examples
-
Suspend user:
Suspends a user account.
userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" suspended: true -
Reactivate user:
Removes suspension from a user account.
userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" suspended: false
SetSuspended
package main
import (
"context"
"fmt"
"github.com/gitpod-io/gitpod-sdk-go"
"github.com/gitpod-io/gitpod-sdk-go/option"
)
func main() {
client := gitpod.NewClient(
option.WithBearerToken("My Bearer Token"),
)
response, err := client.Users.SetSuspended(context.TODO(), gitpod.UserSetSuspendedParams{
UserID: gitpod.F("f53d2330-3795-4c5d-a1f3-453121af9c60"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
{}Returns Examples
{}