-
Notifications
You must be signed in to change notification settings - Fork 5
/
TypeSqlProtectionSourceEnum.go
88 lines (78 loc) · 2.54 KB
/
TypeSqlProtectionSourceEnum.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
// Copyright 2019 Cohesity Inc.
package models
import(
"encoding/json"
)
/**
* Type definition for TypeSqlProtectionSourceEnum enum
*/
type TypeSqlProtectionSourceEnum int
/**
* Value collection for TypeSqlProtectionSourceEnum enum
*/
const (
TypeSqlProtectionSource_KINSTANCE TypeSqlProtectionSourceEnum = 1 + iota
TypeSqlProtectionSource_KDATABASE
TypeSqlProtectionSource_KAAG
TypeSqlProtectionSource_KAAGROOTCONTAINER
TypeSqlProtectionSource_KROOTCONTAINER
)
func (r TypeSqlProtectionSourceEnum) MarshalJSON() ([]byte, error) {
s := TypeSqlProtectionSourceEnumToValue(r)
return json.Marshal(s)
}
func (r *TypeSqlProtectionSourceEnum) UnmarshalJSON(data []byte) error {
var s string
json.Unmarshal(data, &s)
v := TypeSqlProtectionSourceEnumFromValue(s)
*r = v
return nil
}
/**
* Converts TypeSqlProtectionSourceEnum to its string representation
*/
func TypeSqlProtectionSourceEnumToValue(typeSqlProtectionSourceEnum TypeSqlProtectionSourceEnum) string {
switch typeSqlProtectionSourceEnum {
case TypeSqlProtectionSource_KINSTANCE:
return "kInstance"
case TypeSqlProtectionSource_KDATABASE:
return "kDatabase"
case TypeSqlProtectionSource_KAAG:
return "kAAG"
case TypeSqlProtectionSource_KAAGROOTCONTAINER:
return "kAAGRootContainer"
case TypeSqlProtectionSource_KROOTCONTAINER:
return "kRootContainer"
default:
return "kInstance"
}
}
/**
* Converts TypeSqlProtectionSourceEnum Array to its string Array representation
*/
func TypeSqlProtectionSourceEnumArrayToValue(typeSqlProtectionSourceEnum []TypeSqlProtectionSourceEnum) []string {
convArray := make([]string,len( typeSqlProtectionSourceEnum))
for i:=0; i<len(typeSqlProtectionSourceEnum);i++ {
convArray[i] = TypeSqlProtectionSourceEnumToValue(typeSqlProtectionSourceEnum[i])
}
return convArray
}
/**
* Converts given value to its enum representation
*/
func TypeSqlProtectionSourceEnumFromValue(value string) TypeSqlProtectionSourceEnum {
switch value {
case "kInstance":
return TypeSqlProtectionSource_KINSTANCE
case "kDatabase":
return TypeSqlProtectionSource_KDATABASE
case "kAAG":
return TypeSqlProtectionSource_KAAG
case "kAAGRootContainer":
return TypeSqlProtectionSource_KAAGROOTCONTAINER
case "kRootContainer":
return TypeSqlProtectionSource_KROOTCONTAINER
default:
return TypeSqlProtectionSource_KINSTANCE
}
}