You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type CreateUserRequest struct {
Username string `json:"username"`
Email string `json:"email"`
Role UserRole `json:"role"`
Password string `json:"password"`
MaxAllowedDimensions int `json:"max_allowed_dimensions"`
MaxAllowedLines int `json:"max_allowed_lines"`
MaxAllowedBytes int `json:"max_allowed_bytes"`
MaxAllowedDatasets int `json:"max_allowed_datasets"`
MaxAllowedDataSources int `json:"max_allowed_datasources"`
MaxAllowedWorkspaces int `json:"max_allowed_workspaces"`
MaxAllowedMemberships int `json:"max_allowed_memberships"`
MaxAllowedIntegrations int `json:"max_allowed_integrations"`
MaxAllowedWebhooks int `json:"max_allowed_webhooks"`
DefaultDatasetSettings *DatasetSettings `json:"default_dataset_settings"`
DefaultWorkspaceSettings *WorkspaceSettings `json:"default_workspace_settings"`
DefaultDataSourceSettings *DataSourceSettings `json:"default_datasource_settings"`
}
Handler
// @Summary Creates a user
// @Description Creates a user with the specified username, email and role.
// @Tags Users
// @Accept json
// @Produce json
// @Param data body CreateUserRequest true "User data"
// @Success 200 {object} User "OK"
// @Router /users [post]
func (a *API) handleCreateUser(w http.ResponseWriter, r *http.Request) {
var request CreateUserRequest
// Parse the request body
if err := json.NewDecoder(r.Body).Decode(&request); err != nil {
http.Error(w, "Bad request", http.StatusBadRequest)
return
}
// Validate the request
if err := request.Validate(); err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
// Create the user
user, err := a.services.UserService.Create(r.Context(), &request)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
// Write the response
if err := json.NewEncoder(w).Encode(user); err != nil {
http.Error(w, "Internal server error", http.StatusInternalServerError)
return
}
}
This issue has been automatically generated from the Octopize project avatar-python to make SIGO compatible. Please vote with a thumbs up or thumbs down to assess the quality of the automatic generation.
Best regards,
The SIGO Team
The text was updated successfully, but these errors were encountered:
Description
Add an endpoint to create a new user.
Request
Method
POST
URL
/users
Request Parameters
username
johndoe
email
john.doe@example.com
role
user
password
password
Request Body
The request body should be a JSON object with the following format:
Result
Result parameters
id
00000000-0000-0000-0000-000000000000
organization_id
00000000-0000-0000-0000-000000000000
username
johndoe
email
john.doe@example.com
role
user
max_allowed_dimensions_per_dataset
100
max_allowed_lines_per_dataset
100000
Result Body
The response body will be a JSON object with the following format:
Example Curl Request
Request
Curl Response
Go server
Struct
Handler
Links
Automated Issue Details
Dear visitor,
This issue has been automatically generated from the Octopize project avatar-python to make SIGO compatible. Please vote with a thumbs up or thumbs down to assess the quality of the automatic generation.
Best regards,
The SIGO Team
The text was updated successfully, but these errors were encountered: