-
Notifications
You must be signed in to change notification settings - Fork 5
/
AuthenticationStatusEnum.go
executable file
·83 lines (73 loc) · 2.25 KB
/
AuthenticationStatusEnum.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 AuthenticationStatusEnum enum
*/
type AuthenticationStatusEnum int
/**
* Value collection for AuthenticationStatusEnum enum
*/
const (
AuthenticationStatus_KPENDING AuthenticationStatusEnum = 1 + iota
AuthenticationStatus_KSCHEDULED
AuthenticationStatus_KFINISHED
AuthenticationStatus_KREFRESHINPROGRESS
)
func (r AuthenticationStatusEnum) MarshalJSON() ([]byte, error) {
s := AuthenticationStatusEnumToValue(r)
return json.Marshal(s)
}
func (r *AuthenticationStatusEnum) UnmarshalJSON(data []byte) error {
var s string
json.Unmarshal(data, &s)
v := AuthenticationStatusEnumFromValue(s)
*r = v
return nil
}
/**
* Converts AuthenticationStatusEnum to its string representation
*/
func AuthenticationStatusEnumToValue(authenticationStatusEnum AuthenticationStatusEnum) string {
switch authenticationStatusEnum {
case AuthenticationStatus_KPENDING:
return "kPending"
case AuthenticationStatus_KSCHEDULED:
return "kScheduled"
case AuthenticationStatus_KFINISHED:
return "kFinished"
case AuthenticationStatus_KREFRESHINPROGRESS:
return "kRefreshInProgress"
default:
return "kPending"
}
}
/**
* Converts AuthenticationStatusEnum Array to its string Array representation
*/
func AuthenticationStatusEnumArrayToValue(authenticationStatusEnum []AuthenticationStatusEnum) []string {
convArray := make([]string,len( authenticationStatusEnum))
for i:=0; i<len(authenticationStatusEnum);i++ {
convArray[i] = AuthenticationStatusEnumToValue(authenticationStatusEnum[i])
}
return convArray
}
/**
* Converts given value to its enum representation
*/
func AuthenticationStatusEnumFromValue(value string) AuthenticationStatusEnum {
switch value {
case "kPending":
return AuthenticationStatus_KPENDING
case "kScheduled":
return AuthenticationStatus_KSCHEDULED
case "kFinished":
return AuthenticationStatus_KFINISHED
case "kRefreshInProgress":
return AuthenticationStatus_KREFRESHINPROGRESS
default:
return AuthenticationStatus_KPENDING
}
}