forked from kubeflow/hub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_execution_state.go
More file actions
120 lines (99 loc) · 3.23 KB
/
model_execution_state.go
File metadata and controls
120 lines (99 loc) · 3.23 KB
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
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: v1alpha3
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
"fmt"
)
// ExecutionState The state of the Execution. The state transitions are NEW -> RUNNING -> COMPLETE | CACHED | FAILED | CANCELED CACHED means the execution is skipped due to cached results. CANCELED means the execution is skipped due to precondition not met. It is different from CACHED in that a CANCELED execution will not have any event associated with it. It is different from FAILED in that there is no unexpected error happened and it is regarded as a normal state. See also: ml-metadata Execution.State
type ExecutionState string
// List of ExecutionState
const (
EXECUTIONSTATE_UNKNOWN ExecutionState = "UNKNOWN"
EXECUTIONSTATE_NEW ExecutionState = "NEW"
EXECUTIONSTATE_RUNNING ExecutionState = "RUNNING"
EXECUTIONSTATE_COMPLETE ExecutionState = "COMPLETE"
EXECUTIONSTATE_FAILED ExecutionState = "FAILED"
EXECUTIONSTATE_CACHED ExecutionState = "CACHED"
EXECUTIONSTATE_CANCELED ExecutionState = "CANCELED"
)
// All allowed values of ExecutionState enum
var AllowedExecutionStateEnumValues = []ExecutionState{
"UNKNOWN",
"NEW",
"RUNNING",
"COMPLETE",
"FAILED",
"CACHED",
"CANCELED",
}
func (v *ExecutionState) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := ExecutionState(value)
for _, existing := range AllowedExecutionStateEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid ExecutionState", value)
}
// NewExecutionStateFromValue returns a pointer to a valid ExecutionState
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewExecutionStateFromValue(v string) (*ExecutionState, error) {
ev := ExecutionState(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for ExecutionState: valid values are %v", v, AllowedExecutionStateEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v ExecutionState) IsValid() bool {
for _, existing := range AllowedExecutionStateEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to ExecutionState value
func (v ExecutionState) Ptr() *ExecutionState {
return &v
}
type NullableExecutionState struct {
value *ExecutionState
isSet bool
}
func (v NullableExecutionState) Get() *ExecutionState {
return v.value
}
func (v *NullableExecutionState) Set(val *ExecutionState) {
v.value = val
v.isSet = true
}
func (v NullableExecutionState) IsSet() bool {
return v.isSet
}
func (v *NullableExecutionState) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExecutionState(val *ExecutionState) *NullableExecutionState {
return &NullableExecutionState{value: val, isSet: true}
}
func (v NullableExecutionState) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExecutionState) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}