-
Notifications
You must be signed in to change notification settings - Fork 43
/
constants.go
144 lines (127 loc) · 4.17 KB
/
constants.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
package dsccompilationjob
import "strings"
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
type JobProvisioningState string
const (
JobProvisioningStateFailed JobProvisioningState = "Failed"
JobProvisioningStateProcessing JobProvisioningState = "Processing"
JobProvisioningStateSucceeded JobProvisioningState = "Succeeded"
JobProvisioningStateSuspended JobProvisioningState = "Suspended"
)
func PossibleValuesForJobProvisioningState() []string {
return []string{
string(JobProvisioningStateFailed),
string(JobProvisioningStateProcessing),
string(JobProvisioningStateSucceeded),
string(JobProvisioningStateSuspended),
}
}
func parseJobProvisioningState(input string) (*JobProvisioningState, error) {
vals := map[string]JobProvisioningState{
"failed": JobProvisioningStateFailed,
"processing": JobProvisioningStateProcessing,
"succeeded": JobProvisioningStateSucceeded,
"suspended": JobProvisioningStateSuspended,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := JobProvisioningState(input)
return &out, nil
}
type JobStatus string
const (
JobStatusActivating JobStatus = "Activating"
JobStatusBlocked JobStatus = "Blocked"
JobStatusCompleted JobStatus = "Completed"
JobStatusDisconnected JobStatus = "Disconnected"
JobStatusFailed JobStatus = "Failed"
JobStatusNew JobStatus = "New"
JobStatusRemoving JobStatus = "Removing"
JobStatusResuming JobStatus = "Resuming"
JobStatusRunning JobStatus = "Running"
JobStatusStopped JobStatus = "Stopped"
JobStatusStopping JobStatus = "Stopping"
JobStatusSuspended JobStatus = "Suspended"
JobStatusSuspending JobStatus = "Suspending"
)
func PossibleValuesForJobStatus() []string {
return []string{
string(JobStatusActivating),
string(JobStatusBlocked),
string(JobStatusCompleted),
string(JobStatusDisconnected),
string(JobStatusFailed),
string(JobStatusNew),
string(JobStatusRemoving),
string(JobStatusResuming),
string(JobStatusRunning),
string(JobStatusStopped),
string(JobStatusStopping),
string(JobStatusSuspended),
string(JobStatusSuspending),
}
}
func parseJobStatus(input string) (*JobStatus, error) {
vals := map[string]JobStatus{
"activating": JobStatusActivating,
"blocked": JobStatusBlocked,
"completed": JobStatusCompleted,
"disconnected": JobStatusDisconnected,
"failed": JobStatusFailed,
"new": JobStatusNew,
"removing": JobStatusRemoving,
"resuming": JobStatusResuming,
"running": JobStatusRunning,
"stopped": JobStatusStopped,
"stopping": JobStatusStopping,
"suspended": JobStatusSuspended,
"suspending": JobStatusSuspending,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := JobStatus(input)
return &out, nil
}
type JobStreamType string
const (
JobStreamTypeAny JobStreamType = "Any"
JobStreamTypeDebug JobStreamType = "Debug"
JobStreamTypeError JobStreamType = "Error"
JobStreamTypeOutput JobStreamType = "Output"
JobStreamTypeProgress JobStreamType = "Progress"
JobStreamTypeVerbose JobStreamType = "Verbose"
JobStreamTypeWarning JobStreamType = "Warning"
)
func PossibleValuesForJobStreamType() []string {
return []string{
string(JobStreamTypeAny),
string(JobStreamTypeDebug),
string(JobStreamTypeError),
string(JobStreamTypeOutput),
string(JobStreamTypeProgress),
string(JobStreamTypeVerbose),
string(JobStreamTypeWarning),
}
}
func parseJobStreamType(input string) (*JobStreamType, error) {
vals := map[string]JobStreamType{
"any": JobStreamTypeAny,
"debug": JobStreamTypeDebug,
"error": JobStreamTypeError,
"output": JobStreamTypeOutput,
"progress": JobStreamTypeProgress,
"verbose": JobStreamTypeVerbose,
"warning": JobStreamTypeWarning,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := JobStreamType(input)
return &out, nil
}