This commit is contained in:
2023-06-23 15:13:22 +03:00
parent c06a3198f6
commit 264538f492
50 changed files with 2143 additions and 76 deletions

View File

@@ -0,0 +1,39 @@
package user
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for bulk delete a list of users.
type DeleteUsersRequest struct {
// List of user ids
UserIDs string
}
// DeleteUsers bulk delete a list of users.
func (u User) DeleteUsers(ctx context.Context, req DeleteUsersRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
for _, validationError := range validators.GetErrors(err) {
return false, validators.ValidationError(validationError)
}
}
url := "/cloudbroker/user/deleteUsers"
res, err := u.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}