code.gitea.io/gitea@v1.19.3/modules/structs/admin_user.go (about)

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