github.com/altoros/juju-vmware@v0.0.0-20150312064031-f19ae857ccca/apiserver/params/usermanager.go (about) 1 // Copyright 2014 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package params 5 6 import ( 7 "time" 8 ) 9 10 // UserInfo holds information on a user. 11 type UserInfo struct { 12 Username string `json:"username"` 13 DisplayName string `json:"display-name"` 14 CreatedBy string `json:"created-by"` 15 DateCreated time.Time `json:"date-created"` 16 LastConnection *time.Time `json:"last-connection,omitempty"` 17 Disabled bool `json:"disabled"` 18 } 19 20 // UserInfoResult holds the result of a UserInfo call. 21 type UserInfoResult struct { 22 Result *UserInfo `json:"result,omitempty"` 23 Error *Error `json:"error,omitempty"` 24 } 25 26 // UserInfoResults holds the result of a bulk UserInfo API call. 27 type UserInfoResults struct { 28 Results []UserInfoResult `json:"results"` 29 } 30 31 // UserInfoRequest defines the users to return. An empty 32 // Entities list indicates that all matching users should be returned. 33 type UserInfoRequest struct { 34 Entities []Entity `json:"entities"` 35 IncludeDisabled bool `json:"include-disabled"` 36 } 37 38 // AddUsers holds the parameters for adding new users. 39 type AddUsers struct { 40 Users []AddUser `json:"users"` 41 } 42 43 // AddUser stores the parameters to add one user. 44 type AddUser struct { 45 Username string `json:"username"` 46 DisplayName string `json:"display-name"` 47 Password string `json:"password"` 48 } 49 50 // AddUserResults holds the results of the bulk AddUser API call. 51 type AddUserResults struct { 52 Results []AddUserResult `json:"results"` 53 } 54 55 // AddUserResult returns the tag of the newly created user, or an error. 56 type AddUserResult struct { 57 Tag string `json:"tag,omitempty"` 58 Error *Error `json:"error,omitempty"` 59 }