-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusers.go
More file actions
93 lines (75 loc) · 2.86 KB
/
users.go
File metadata and controls
93 lines (75 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// This file was auto-generated by Fern from our API Definition.
package api
import (
fmt "fmt"
core "github.com/codecombat/codecombat-go/core"
)
type UsersCreateRequest struct {
Name string `json:"name"`
Email string `json:"email"`
// `"student"` or `"teacher"`. If unset, a home user will be created, unable to join classrooms.
Role *core.Optional[UsersCreateRequestRole] `json:"role,omitempty"`
PreferredLanguage *core.Optional[string] `json:"preferredLanguage,omitempty"`
HeroConfig *core.Optional[UsersCreateRequestHeroConfig] `json:"heroConfig,omitempty"`
Birthday *core.Optional[string] `json:"birthday,omitempty"`
}
type UsersGetRequest struct {
// Set to non-empty string to include stats.playTime in response
IncludePlayTime *string `json:"-"`
}
type UsersGetClassroomsRequest struct {
// limit the return number of members for each classroom
RetMemberLimit *float64 `json:"-"`
}
type UsersGrantLicenseRequest struct {
Ends DatetimeString `json:"ends"`
}
type UsersGrantPremiumSubscriptionRequest struct {
Ends DatetimeString `json:"ends"`
}
type UsersSetAceConfigRequest struct {
// controls whether autocompletion snippets show up, the default value is true
LiveCompletion *core.Optional[bool] `json:"liveCompletion,omitempty"`
// controls whether things like automatic parenthesis and quote completion happens, the default value is false
Behaviors *core.Optional[bool] `json:"behaviors,omitempty"`
// only for home users, should be one of ["python", "javascript", "cpp", "lua", "coffeescript"] right now
Language *core.Optional[string] `json:"language,omitempty"`
}
type UsersSetHeroRequest struct {
ThangType *core.Optional[ObjectIdString] `json:"thangType,omitempty"`
}
type UsersShortenLicenseRequest struct {
Ends DatetimeString `json:"ends"`
}
type UsersShortenSubscriptionRequest struct {
Ends DatetimeString `json:"ends"`
}
type UsersCreateRequestHeroConfig struct {
ThangType *ObjectIdString `json:"thangType,omitempty"`
}
// `"student"` or `"teacher"`. If unset, a home user will be created, unable to join classrooms.
type UsersCreateRequestRole string
const (
UsersCreateRequestRoleStudent UsersCreateRequestRole = "student"
UsersCreateRequestRoleTeacher UsersCreateRequestRole = "teacher"
)
func NewUsersCreateRequestRoleFromString(s string) (UsersCreateRequestRole, error) {
switch s {
case "student":
return UsersCreateRequestRoleStudent, nil
case "teacher":
return UsersCreateRequestRoleTeacher, nil
}
var t UsersCreateRequestRole
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (u UsersCreateRequestRole) Ptr() *UsersCreateRequestRole {
return &u
}
type DatetimeString = string
type UsersUpdateRequest struct {
// Set to new name string
Name string `json:"name"`
// Set the birthday
Birthday *core.Optional[string] `json:"birthday,omitempty"`
}