-
Notifications
You must be signed in to change notification settings - Fork 5
/
AlertSeverityListEnum.go
executable file
·78 lines (68 loc) · 1.91 KB
/
AlertSeverityListEnum.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
// Copyright 2019 Cohesity Inc.
package models
import(
"encoding/json"
)
/**
* Type definition for AlertSeverityListEnum enum
*/
type AlertSeverityListEnum int
/**
* Value collection for AlertSeverityListEnum enum
*/
const (
AlertSeverityList_KCRITICAL AlertSeverityListEnum = 1 + iota
AlertSeverityList_KWARNING
AlertSeverityList_KINFO
)
func (r AlertSeverityListEnum) MarshalJSON() ([]byte, error) {
s := AlertSeverityListEnumToValue(r)
return json.Marshal(s)
}
func (r *AlertSeverityListEnum) UnmarshalJSON(data []byte) error {
var s string
json.Unmarshal(data, &s)
v := AlertSeverityListEnumFromValue(s)
*r = v
return nil
}
/**
* Converts AlertSeverityListEnum to its string representation
*/
func AlertSeverityListEnumToValue(alertSeverityListEnum AlertSeverityListEnum) string {
switch alertSeverityListEnum {
case AlertSeverityList_KCRITICAL:
return "kCritical"
case AlertSeverityList_KWARNING:
return "kWarning"
case AlertSeverityList_KINFO:
return "kInfo"
default:
return "kCritical"
}
}
/**
* Converts AlertSeverityListEnum Array to its string Array representation
*/
func AlertSeverityListEnumArrayToValue(alertSeverityListEnum []AlertSeverityListEnum) []string {
convArray := make([]string,len( alertSeverityListEnum))
for i:=0; i<len(alertSeverityListEnum);i++ {
convArray[i] = AlertSeverityListEnumToValue(alertSeverityListEnum[i])
}
return convArray
}
/**
* Converts given value to its enum representation
*/
func AlertSeverityListEnumFromValue(value string) AlertSeverityListEnum {
switch value {
case "kCritical":
return AlertSeverityList_KCRITICAL
case "kWarning":
return AlertSeverityList_KWARNING
case "kInfo":
return AlertSeverityList_KINFO
default:
return AlertSeverityList_KCRITICAL
}
}