@@ -8,22 +8,29 @@ import "time"
8
8
9
9
// CreateUserOption create user options
10
10
type CreateUserOption struct {
11
+ // The authentication source ID to associate with the user
11
12
SourceID int64 `json:"source_id"`
12
13
// identifier of the user, provided by the external authenticator (if configured)
13
14
// default: empty
14
15
LoginName string `json:"login_name"`
15
16
// username of the user
16
17
// required: true
17
18
Username string `json:"username" binding:"Required;Username;MaxSize(40)"`
19
+ // The full display name of the user
18
20
FullName string `json:"full_name" binding:"MaxSize(100)"`
19
21
// required: true
20
22
// swagger:strfmt email
21
- Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
22
- Password string `json:"password" binding:"MaxSize(255)"`
23
- MustChangePassword * bool `json:"must_change_password"`
24
- SendNotify bool `json:"send_notify"`
25
- Restricted * bool `json:"restricted"`
26
- Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
23
+ Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
24
+ // The plain text password for the user
25
+ Password string `json:"password" binding:"MaxSize(255)"`
26
+ // Whether the user must change password on first login
27
+ MustChangePassword * bool `json:"must_change_password"`
28
+ // Whether to send welcome notification email to the user
29
+ SendNotify bool `json:"send_notify"`
30
+ // Whether the user has restricted access privileges
31
+ Restricted * bool `json:"restricted"`
32
+ // User visibility level: public, limited, or private
33
+ Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
27
34
28
35
// For explicitly setting the user creation timestamp. Useful when users are
29
36
// migrated from other systems. When omitted, the user's creation timestamp
@@ -34,26 +41,43 @@ type CreateUserOption struct {
34
41
// EditUserOption edit user options
35
42
type EditUserOption struct {
36
43
// required: true
44
+ // The authentication source ID to associate with the user
37
45
SourceID int64 `json:"source_id"`
38
46
// identifier of the user, provided by the external authenticator (if configured)
39
47
// default: empty
40
48
// required: true
41
49
LoginName string `json:"login_name" binding:"Required"`
42
50
// swagger:strfmt email
43
- Email * string `json:"email" binding:"MaxSize(254)"`
44
- FullName * string `json:"full_name" binding:"MaxSize(100)"`
45
- Password string `json:"password" binding:"MaxSize(255)"`
46
- MustChangePassword * bool `json:"must_change_password"`
47
- Website * string `json:"website" binding:"OmitEmpty;ValidUrl;MaxSize(255)"`
48
- Location * string `json:"location" binding:"MaxSize(50)"`
49
- Description * string `json:"description" binding:"MaxSize(255)"`
50
- Active * bool `json:"active"`
51
- Admin * bool `json:"admin"`
52
- AllowGitHook * bool `json:"allow_git_hook"`
53
- AllowImportLocal * bool `json:"allow_import_local"`
54
- MaxRepoCreation * int `json:"max_repo_creation"`
55
- ProhibitLogin * bool `json:"prohibit_login"`
56
- AllowCreateOrganization * bool `json:"allow_create_organization"`
57
- Restricted * bool `json:"restricted"`
58
- Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
51
+ // The email address of the user
52
+ Email * string `json:"email" binding:"MaxSize(254)"`
53
+ // The full display name of the user
54
+ FullName * string `json:"full_name" binding:"MaxSize(100)"`
55
+ // The plain text password for the user
56
+ Password string `json:"password" binding:"MaxSize(255)"`
57
+ // Whether the user must change password on next login
58
+ MustChangePassword * bool `json:"must_change_password"`
59
+ // The user's personal website URL
60
+ Website * string `json:"website" binding:"OmitEmpty;ValidUrl;MaxSize(255)"`
61
+ // The user's location or address
62
+ Location * string `json:"location" binding:"MaxSize(50)"`
63
+ // The user's personal description or bio
64
+ Description * string `json:"description" binding:"MaxSize(255)"`
65
+ // Whether the user account is active
66
+ Active * bool `json:"active"`
67
+ // Whether the user has administrator privileges
68
+ Admin * bool `json:"admin"`
69
+ // Whether the user can use Git hooks
70
+ AllowGitHook * bool `json:"allow_git_hook"`
71
+ // Whether the user can import local repositories
72
+ AllowImportLocal * bool `json:"allow_import_local"`
73
+ // Maximum number of repositories the user can create
74
+ MaxRepoCreation * int `json:"max_repo_creation"`
75
+ // Whether the user is prohibited from logging in
76
+ ProhibitLogin * bool `json:"prohibit_login"`
77
+ // Whether the user can create organizations
78
+ AllowCreateOrganization * bool `json:"allow_create_organization"`
79
+ // Whether the user has restricted access privileges
80
+ Restricted * bool `json:"restricted"`
81
+ // User visibility level: public, limited, or private
82
+ Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
59
83
}
0 commit comments