You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

admin_user.go 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // Copyright 2019 The Gitea Authors. All rights reserved.
  3. // SPDX-License-Identifier: MIT
  4. package structs
  5. import "time"
  6. // CreateUserOption create user options
  7. type CreateUserOption struct {
  8. SourceID int64 `json:"source_id"`
  9. LoginName string `json:"login_name"`
  10. // required: true
  11. Username string `json:"username" binding:"Required;Username;MaxSize(40)"`
  12. FullName string `json:"full_name" binding:"MaxSize(100)"`
  13. // required: true
  14. // swagger:strfmt email
  15. Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
  16. // required: true
  17. Password string `json:"password" binding:"Required;MaxSize(255)"`
  18. MustChangePassword *bool `json:"must_change_password"`
  19. SendNotify bool `json:"send_notify"`
  20. Restricted *bool `json:"restricted"`
  21. Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
  22. // For explicitly setting the user creation timestamp. Useful when users are
  23. // migrated from other systems. When omitted, the user's creation timestamp
  24. // will be set to "now".
  25. Created *time.Time `json:"created_at"`
  26. }
  27. // EditUserOption edit user options
  28. type EditUserOption struct {
  29. // required: true
  30. SourceID int64 `json:"source_id"`
  31. // required: true
  32. LoginName string `json:"login_name" binding:"Required"`
  33. // swagger:strfmt email
  34. Email *string `json:"email" binding:"MaxSize(254)"`
  35. FullName *string `json:"full_name" binding:"MaxSize(100)"`
  36. Password string `json:"password" binding:"MaxSize(255)"`
  37. MustChangePassword *bool `json:"must_change_password"`
  38. Website *string `json:"website" binding:"OmitEmpty;ValidUrl;MaxSize(255)"`
  39. Location *string `json:"location" binding:"MaxSize(50)"`
  40. Description *string `json:"description" binding:"MaxSize(255)"`
  41. Active *bool `json:"active"`
  42. Admin *bool `json:"admin"`
  43. AllowGitHook *bool `json:"allow_git_hook"`
  44. AllowImportLocal *bool `json:"allow_import_local"`
  45. MaxRepoCreation *int `json:"max_repo_creation"`
  46. ProhibitLogin *bool `json:"prohibit_login"`
  47. AllowCreateOrganization *bool `json:"allow_create_organization"`
  48. Restricted *bool `json:"restricted"`
  49. Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
  50. }