-
Notifications
You must be signed in to change notification settings - Fork 5
/
ProtocolAccessEnum.go
executable file
·83 lines (73 loc) · 1.94 KB
/
ProtocolAccessEnum.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
// Copyright 2019 Cohesity Inc.
package models
import(
"encoding/json"
)
/**
* Type definition for ProtocolAccessEnum enum
*/
type ProtocolAccessEnum int
/**
* Value collection for ProtocolAccessEnum enum
*/
const (
ProtocolAccess_KALL ProtocolAccessEnum = 1 + iota
ProtocolAccess_KNFSONLY
ProtocolAccess_KSMBONLY
ProtocolAccess_KS3ONLY
)
func (r ProtocolAccessEnum) MarshalJSON() ([]byte, error) {
s := ProtocolAccessEnumToValue(r)
return json.Marshal(s)
}
func (r *ProtocolAccessEnum) UnmarshalJSON(data []byte) error {
var s string
json.Unmarshal(data, &s)
v := ProtocolAccessEnumFromValue(s)
*r = v
return nil
}
/**
* Converts ProtocolAccessEnum to its string representation
*/
func ProtocolAccessEnumToValue(protocolAccessEnum ProtocolAccessEnum) string {
switch protocolAccessEnum {
case ProtocolAccess_KALL:
return "kAll"
case ProtocolAccess_KNFSONLY:
return "kNFSOnly"
case ProtocolAccess_KSMBONLY:
return "kSMBOnly"
case ProtocolAccess_KS3ONLY:
return "kS3Only"
default:
return "kAll"
}
}
/**
* Converts ProtocolAccessEnum Array to its string Array representation
*/
func ProtocolAccessEnumArrayToValue(protocolAccessEnum []ProtocolAccessEnum) []string {
convArray := make([]string,len( protocolAccessEnum))
for i:=0; i<len(protocolAccessEnum);i++ {
convArray[i] = ProtocolAccessEnumToValue(protocolAccessEnum[i])
}
return convArray
}
/**
* Converts given value to its enum representation
*/
func ProtocolAccessEnumFromValue(value string) ProtocolAccessEnum {
switch value {
case "kAll":
return ProtocolAccess_KALL
case "kNFSOnly":
return ProtocolAccess_KNFSONLY
case "kSMBOnly":
return ProtocolAccess_KSMBONLY
case "kS3Only":
return ProtocolAccess_KS3ONLY
default:
return ProtocolAccess_KALL
}
}