3 26fb88e9 2022-01-12 o import "encoding/json"
5 50558780 2022-01-06 o // User represents a User object.
6 50558780 2022-01-06 o // Note that this is different from an ApiUser.
7 6e415953 2022-01-06 o type User struct {
8 46ca0f68 2022-02-01 o Name string `json:"-"`
9 46ca0f68 2022-02-01 o Email string `json:"email,omitempty"`
10 46ca0f68 2022-02-01 o Groups []string `json:"groups,omitempty"`
13 6e415953 2022-01-06 o func (u User) MarshalJSON() ([]byte, error) {
14 46ca0f68 2022-02-01 o type alias User
16 46ca0f68 2022-02-01 o return json.Marshal(map[string]interface{}{"attrs": a})
19 76669f9b 2022-01-11 o func (u User) name() string {
23 76669f9b 2022-01-11 o func (u User) path() string {
24 76669f9b 2022-01-11 o return "/objects/users/" + u.Name