-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy patheducation_submission_status.go
48 lines (46 loc) · 1.6 KB
/
education_submission_status.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
package models
type EducationSubmissionStatus int
const (
WORKING_EDUCATIONSUBMISSIONSTATUS EducationSubmissionStatus = iota
SUBMITTED_EDUCATIONSUBMISSIONSTATUS
RELEASED_EDUCATIONSUBMISSIONSTATUS
RETURNED_EDUCATIONSUBMISSIONSTATUS
UNKNOWNFUTUREVALUE_EDUCATIONSUBMISSIONSTATUS
REASSIGNED_EDUCATIONSUBMISSIONSTATUS
EXCUSED_EDUCATIONSUBMISSIONSTATUS
)
func (i EducationSubmissionStatus) String() string {
return []string{"working", "submitted", "released", "returned", "unknownFutureValue", "reassigned", "excused"}[i]
}
func ParseEducationSubmissionStatus(v string) (any, error) {
result := WORKING_EDUCATIONSUBMISSIONSTATUS
switch v {
case "working":
result = WORKING_EDUCATIONSUBMISSIONSTATUS
case "submitted":
result = SUBMITTED_EDUCATIONSUBMISSIONSTATUS
case "released":
result = RELEASED_EDUCATIONSUBMISSIONSTATUS
case "returned":
result = RETURNED_EDUCATIONSUBMISSIONSTATUS
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_EDUCATIONSUBMISSIONSTATUS
case "reassigned":
result = REASSIGNED_EDUCATIONSUBMISSIONSTATUS
case "excused":
result = EXCUSED_EDUCATIONSUBMISSIONSTATUS
default:
return nil, nil
}
return &result, nil
}
func SerializeEducationSubmissionStatus(values []EducationSubmissionStatus) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i EducationSubmissionStatus) isMultiValue() bool {
return false
}