This repository was archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathallocationstatus_enumer.go
More file actions
52 lines (42 loc) · 1.53 KB
/
allocationstatus_enumer.go
File metadata and controls
52 lines (42 loc) · 1.53 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
// Code generated by "enumer -type=AllocationStatus -trimprefix=AllocationStatus"; DO NOT EDIT.
//
package core
import (
"fmt"
)
const _AllocationStatusName = "AllocationUndefinedGrantedExhaustedNamespaceQuotaExceeded"
var _AllocationStatusIndex = [...]uint8{0, 19, 26, 35, 57}
func (i AllocationStatus) String() string {
if i < 0 || i >= AllocationStatus(len(_AllocationStatusIndex)-1) {
return fmt.Sprintf("AllocationStatus(%d)", i)
}
return _AllocationStatusName[_AllocationStatusIndex[i]:_AllocationStatusIndex[i+1]]
}
var _AllocationStatusValues = []AllocationStatus{0, 1, 2, 3}
var _AllocationStatusNameToValueMap = map[string]AllocationStatus{
_AllocationStatusName[0:19]: 0,
_AllocationStatusName[19:26]: 1,
_AllocationStatusName[26:35]: 2,
_AllocationStatusName[35:57]: 3,
}
// AllocationStatusString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func AllocationStatusString(s string) (AllocationStatus, error) {
if val, ok := _AllocationStatusNameToValueMap[s]; ok {
return val, nil
}
return 0, fmt.Errorf("%s does not belong to AllocationStatus values", s)
}
// AllocationStatusValues returns all values of the enum
func AllocationStatusValues() []AllocationStatus {
return _AllocationStatusValues
}
// IsAAllocationStatus returns "true" if the value is listed in the enum definition. "false" otherwise
func (i AllocationStatus) IsAAllocationStatus() bool {
for _, v := range _AllocationStatusValues {
if i == v {
return true
}
}
return false
}