-
Notifications
You must be signed in to change notification settings - Fork 32
/
print_duplex_mode.go
39 lines (37 loc) · 1.11 KB
/
print_duplex_mode.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
package models
type PrintDuplexMode int
const (
FLIPONLONGEDGE_PRINTDUPLEXMODE PrintDuplexMode = iota
FLIPONSHORTEDGE_PRINTDUPLEXMODE
ONESIDED_PRINTDUPLEXMODE
UNKNOWNFUTUREVALUE_PRINTDUPLEXMODE
)
func (i PrintDuplexMode) String() string {
return []string{"flipOnLongEdge", "flipOnShortEdge", "oneSided", "unknownFutureValue"}[i]
}
func ParsePrintDuplexMode(v string) (any, error) {
result := FLIPONLONGEDGE_PRINTDUPLEXMODE
switch v {
case "flipOnLongEdge":
result = FLIPONLONGEDGE_PRINTDUPLEXMODE
case "flipOnShortEdge":
result = FLIPONSHORTEDGE_PRINTDUPLEXMODE
case "oneSided":
result = ONESIDED_PRINTDUPLEXMODE
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_PRINTDUPLEXMODE
default:
return nil, nil
}
return &result, nil
}
func SerializePrintDuplexMode(values []PrintDuplexMode) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i PrintDuplexMode) isMultiValue() bool {
return false
}