-
Notifications
You must be signed in to change notification settings - Fork 456
/
sdbootenrollkeys_enumer.go
98 lines (81 loc) · 3.15 KB
/
sdbootenrollkeys_enumer.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
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
94
95
96
97
98
// Code generated by "enumer -type SDBootEnrollKeys -linecomment -text"; DO NOT EDIT.
package profile
import (
"fmt"
"strings"
)
const _SDBootEnrollKeysName = "if-safemanualforceoff"
var _SDBootEnrollKeysIndex = [...]uint8{0, 7, 13, 18, 21}
const _SDBootEnrollKeysLowerName = "if-safemanualforceoff"
func (i SDBootEnrollKeys) String() string {
if i < 0 || i >= SDBootEnrollKeys(len(_SDBootEnrollKeysIndex)-1) {
return fmt.Sprintf("SDBootEnrollKeys(%d)", i)
}
return _SDBootEnrollKeysName[_SDBootEnrollKeysIndex[i]:_SDBootEnrollKeysIndex[i+1]]
}
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
func _SDBootEnrollKeysNoOp() {
var x [1]struct{}
_ = x[SDBootEnrollKeysIfSafe-(0)]
_ = x[SDBootEnrollKeysManual-(1)]
_ = x[SDBootEnrollKeysForce-(2)]
_ = x[SDBootEnrollKeysOff-(3)]
}
var _SDBootEnrollKeysValues = []SDBootEnrollKeys{SDBootEnrollKeysIfSafe, SDBootEnrollKeysManual, SDBootEnrollKeysForce, SDBootEnrollKeysOff}
var _SDBootEnrollKeysNameToValueMap = map[string]SDBootEnrollKeys{
_SDBootEnrollKeysName[0:7]: SDBootEnrollKeysIfSafe,
_SDBootEnrollKeysLowerName[0:7]: SDBootEnrollKeysIfSafe,
_SDBootEnrollKeysName[7:13]: SDBootEnrollKeysManual,
_SDBootEnrollKeysLowerName[7:13]: SDBootEnrollKeysManual,
_SDBootEnrollKeysName[13:18]: SDBootEnrollKeysForce,
_SDBootEnrollKeysLowerName[13:18]: SDBootEnrollKeysForce,
_SDBootEnrollKeysName[18:21]: SDBootEnrollKeysOff,
_SDBootEnrollKeysLowerName[18:21]: SDBootEnrollKeysOff,
}
var _SDBootEnrollKeysNames = []string{
_SDBootEnrollKeysName[0:7],
_SDBootEnrollKeysName[7:13],
_SDBootEnrollKeysName[13:18],
_SDBootEnrollKeysName[18:21],
}
// SDBootEnrollKeysString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func SDBootEnrollKeysString(s string) (SDBootEnrollKeys, error) {
if val, ok := _SDBootEnrollKeysNameToValueMap[s]; ok {
return val, nil
}
if val, ok := _SDBootEnrollKeysNameToValueMap[strings.ToLower(s)]; ok {
return val, nil
}
return 0, fmt.Errorf("%s does not belong to SDBootEnrollKeys values", s)
}
// SDBootEnrollKeysValues returns all values of the enum
func SDBootEnrollKeysValues() []SDBootEnrollKeys {
return _SDBootEnrollKeysValues
}
// SDBootEnrollKeysStrings returns a slice of all String values of the enum
func SDBootEnrollKeysStrings() []string {
strs := make([]string, len(_SDBootEnrollKeysNames))
copy(strs, _SDBootEnrollKeysNames)
return strs
}
// IsASDBootEnrollKeys returns "true" if the value is listed in the enum definition. "false" otherwise
func (i SDBootEnrollKeys) IsASDBootEnrollKeys() bool {
for _, v := range _SDBootEnrollKeysValues {
if i == v {
return true
}
}
return false
}
// MarshalText implements the encoding.TextMarshaler interface for SDBootEnrollKeys
func (i SDBootEnrollKeys) MarshalText() ([]byte, error) {
return []byte(i.String()), nil
}
// UnmarshalText implements the encoding.TextUnmarshaler interface for SDBootEnrollKeys
func (i *SDBootEnrollKeys) UnmarshalText(text []byte) error {
var err error
*i, err = SDBootEnrollKeysString(string(text))
return err
}