-
Notifications
You must be signed in to change notification settings - Fork 36
/
calendar_role_type.go
51 lines (49 loc) · 1.63 KB
/
calendar_role_type.go
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
package models
type CalendarRoleType int
const (
NONE_CALENDARROLETYPE CalendarRoleType = iota
FREEBUSYREAD_CALENDARROLETYPE
LIMITEDREAD_CALENDARROLETYPE
READ_CALENDARROLETYPE
WRITE_CALENDARROLETYPE
DELEGATEWITHOUTPRIVATEEVENTACCESS_CALENDARROLETYPE
DELEGATEWITHPRIVATEEVENTACCESS_CALENDARROLETYPE
CUSTOM_CALENDARROLETYPE
)
func (i CalendarRoleType) String() string {
return []string{"none", "freeBusyRead", "limitedRead", "read", "write", "delegateWithoutPrivateEventAccess", "delegateWithPrivateEventAccess", "custom"}[i]
}
func ParseCalendarRoleType(v string) (any, error) {
result := NONE_CALENDARROLETYPE
switch v {
case "none":
result = NONE_CALENDARROLETYPE
case "freeBusyRead":
result = FREEBUSYREAD_CALENDARROLETYPE
case "limitedRead":
result = LIMITEDREAD_CALENDARROLETYPE
case "read":
result = READ_CALENDARROLETYPE
case "write":
result = WRITE_CALENDARROLETYPE
case "delegateWithoutPrivateEventAccess":
result = DELEGATEWITHOUTPRIVATEEVENTACCESS_CALENDARROLETYPE
case "delegateWithPrivateEventAccess":
result = DELEGATEWITHPRIVATEEVENTACCESS_CALENDARROLETYPE
case "custom":
result = CUSTOM_CALENDARROLETYPE
default:
return nil, nil
}
return &result, nil
}
func SerializeCalendarRoleType(values []CalendarRoleType) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i CalendarRoleType) isMultiValue() bool {
return false
}