-
Notifications
You must be signed in to change notification settings - Fork 0
/
drone_ci_trigger_status__generated.go
95 lines (82 loc) · 2.28 KB
/
drone_ci_trigger_status__generated.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
package enums
import (
"bytes"
"encoding"
"errors"
github_com_eden_framework_enumeration "github.com/eden-framework/enumeration"
)
var InvalidDroneCiTriggerStatus = errors.New("invalid DroneCiTriggerStatus")
func init() {
github_com_eden_framework_enumeration.RegisterEnums("DroneCiTriggerStatus", map[string]string{
"failure": "failure",
"success": "success",
})
}
func ParseDroneCiTriggerStatusFromString(s string) (DroneCiTriggerStatus, error) {
switch s {
case "":
return DRONE_CI_TRIGGER_STATUS_UNKNOWN, nil
case "failure":
return DRONE_CI_TRIGGER_STATUS__failure, nil
case "success":
return DRONE_CI_TRIGGER_STATUS__success, nil
}
return DRONE_CI_TRIGGER_STATUS_UNKNOWN, InvalidDroneCiTriggerStatus
}
func ParseDroneCiTriggerStatusFromLabelString(s string) (DroneCiTriggerStatus, error) {
switch s {
case "":
return DRONE_CI_TRIGGER_STATUS_UNKNOWN, nil
case "failure":
return DRONE_CI_TRIGGER_STATUS__failure, nil
case "success":
return DRONE_CI_TRIGGER_STATUS__success, nil
}
return DRONE_CI_TRIGGER_STATUS_UNKNOWN, InvalidDroneCiTriggerStatus
}
func (DroneCiTriggerStatus) EnumType() string {
return "DroneCiTriggerStatus"
}
func (DroneCiTriggerStatus) Enums() map[int][]string {
return map[int][]string{
int(DRONE_CI_TRIGGER_STATUS__failure): {"failure", "failure"},
int(DRONE_CI_TRIGGER_STATUS__success): {"success", "success"},
}
}
func (v DroneCiTriggerStatus) String() string {
switch v {
case DRONE_CI_TRIGGER_STATUS_UNKNOWN:
return ""
case DRONE_CI_TRIGGER_STATUS__failure:
return "failure"
case DRONE_CI_TRIGGER_STATUS__success:
return "success"
}
return "UNKNOWN"
}
func (v DroneCiTriggerStatus) Label() string {
switch v {
case DRONE_CI_TRIGGER_STATUS_UNKNOWN:
return ""
case DRONE_CI_TRIGGER_STATUS__failure:
return "failure"
case DRONE_CI_TRIGGER_STATUS__success:
return "success"
}
return "UNKNOWN"
}
var _ interface {
encoding.TextMarshaler
encoding.TextUnmarshaler
} = (*DroneCiTriggerStatus)(nil)
func (v DroneCiTriggerStatus) MarshalText() ([]byte, error) {
str := v.String()
if str == "UNKNOWN" {
return nil, InvalidDroneCiTriggerStatus
}
return []byte(str), nil
}
func (v *DroneCiTriggerStatus) UnmarshalText(data []byte) (err error) {
*v, err = ParseDroneCiTriggerStatusFromString(string(bytes.ToUpper(data)))
return
}